-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1074 from codeoverflow-org/migrate/pretty-quick-t…
…o-lint-staged Switch from pretty-quick to lint-staged for auto formatting on commit
- Loading branch information
Showing
16 changed files
with
1,148 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,10 +31,10 @@ jobs: | |
tar cvzf compilation-results.tar.gz --exclude "node_modules" **/*.js **/*.js.map **/*.d.ts **/*.d.ts.map **/*.tsbuildinfo **/*.ttf | ||
- name: Upload compilation results | ||
uses: actions/upload-artifact@v3 | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: compilation-results | ||
path: compilation-results.tar.gz | ||
name: compilation-results | ||
path: compilation-results.tar.gz | ||
|
||
tests: | ||
runs-on: ubuntu-latest | ||
|
@@ -60,8 +60,8 @@ jobs: | |
# You may check for other NodeCG runtime errors in the output (these | ||
# may not fail the run). | ||
strategy: | ||
matrix: | ||
os: [ubuntu-22.04, ubuntu-20.04, windows-2019] | ||
matrix: | ||
os: [ubuntu-22.04, ubuntu-20.04, windows-2019] | ||
runs-on: ${{ matrix.os }} | ||
continue-on-error: true | ||
steps: | ||
|
@@ -72,7 +72,7 @@ jobs: | |
- name: Download NodeCG | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: nodecg/nodecg | ||
repository: nodecg/nodecg | ||
|
||
- name: Get NodeCG commit hash | ||
id: nodecgHash | ||
|
@@ -83,15 +83,15 @@ jobs: | |
id: cache-nodecg-deps | ||
uses: actions/cache@v3 | ||
with: | ||
path: 'node_modules' | ||
key: ${{ runner.os }}-${{ env.NODECG_HASH }}-nodecg-deps | ||
path: "node_modules" | ||
key: ${{ runner.os }}-${{ env.NODECG_HASH }}-nodecg-deps | ||
|
||
- name: Cache NodeCG compilation outputs | ||
id: cache-nodecg-build | ||
uses: actions/cache@v3 | ||
with: | ||
path: 'build' | ||
key: ${{ runner.os }}-${{ env.NODECG_HASH }}-nodecg-build | ||
path: "build" | ||
key: ${{ runner.os }}-${{ env.NODECG_HASH }}-nodecg-build | ||
|
||
- name: Install NodeCG dependencies | ||
# Only get dependencies if we didn't get them from the cache | ||
|
@@ -124,14 +124,13 @@ jobs: | |
- name: Install system dependencies | ||
if: (matrix.os == 'ubuntu-22.04' || matrix.os == 'ubuntu-20.04') | ||
run: sudo apt update && sudo apt-get -y install libusb-1.0-0-dev libasound2-dev libudev-dev | ||
|
||
- name: Temp patch \#1030 (ubuntu 22.04) – Removing midi services / samples | ||
working-directory: ./nodecg-io | ||
if: matrix.os == 'ubuntu-22.04' | ||
run: | | ||
sudo rm -rf ./services/nodecg-io-midi-* | ||
sudo rm -rf ./samples/midi-* | ||
sudo rm -rf ./services/nodecg-io-midi-* | ||
sudo rm -rf ./samples/midi-* | ||
- name: Install node native development files | ||
shell: bash | ||
|
@@ -170,19 +169,19 @@ jobs: | |
if: startsWith(github.repository, 'codeoverflow-org') && github.actor != 'dependabot[bot]' && github.event_name != 'pull_request' && github.ref_type != 'tag' | ||
# Only publish anything if we're sure this version compiles (obviously) and all tests pass. | ||
needs: | ||
- build | ||
- tests | ||
- nodecg | ||
- build | ||
- tests | ||
- nodecg | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/[email protected] | ||
with: | ||
node-version: "18" | ||
node-version: "18" | ||
|
||
- name: Download compilation results # From the build step | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: compilation-results | ||
name: compilation-results | ||
|
||
- name: Extract compilation results | ||
run: tar xvf compilation-results.tar.gz | ||
|
@@ -195,13 +194,13 @@ jobs: | |
# to also reference the published tarball. | ||
- name: Patch twitch-auth dependency to use published current tarball | ||
run: | | ||
# Get current version as it is needed for the tarball file name | ||
TWITCH_AUTH_VERSION=$(cat utils/nodecg-io-twitch-auth/package.json | jq .version -r) | ||
# Get current version as it is needed for the tarball file name | ||
TWITCH_AUTH_VERSION=$(cat utils/nodecg-io-twitch-auth/package.json | jq .version -r) | ||
# Find usages in all package.json files and replace with the corresponding tarball url | ||
find . -name 'package.json' -exec grep -q -E '"nodecg-io-twitch-auth": ".+"' {} \; -print # Print found files for debug purposes | ||
find . -name 'package.json' -exec grep -q -E '"nodecg-io-twitch-auth": ".+"' {} \; -print0 | \ | ||
xargs -0 sed -i "s/\"nodecg-io-twitch-auth\": \".*\"/\"nodecg-io-twitch-auth\": \"https:\/\/codeoverflow-org.github.io\/nodecg-io-publish\/nodecg-io-twitch-auth-${TWITCH_AUTH_VERSION}.tgz\"/g" | ||
# Find usages in all package.json files and replace with the corresponding tarball url | ||
find . -name 'package.json' -exec grep -q -E '"nodecg-io-twitch-auth": ".+"' {} \; -print # Print found files for debug purposes | ||
find . -name 'package.json' -exec grep -q -E '"nodecg-io-twitch-auth": ".+"' {} \; -print0 | \ | ||
xargs -0 sed -i "s/\"nodecg-io-twitch-auth\": \".*\"/\"nodecg-io-twitch-auth\": \"https:\/\/codeoverflow-org.github.io\/nodecg-io-publish\/nodecg-io-twitch-auth-${TWITCH_AUTH_VERSION}.tgz\"/g" | ||
- name: Create npm tarballs | ||
run: npm pack --workspaces | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
npm run format-pre-commit | ||
npx lint-staged |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<!DOCTYPE html> | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.