Moved linting to it's own step, removed duplicates (#1404)

This commit is contained in:
Micaiah Martin 2022-03-15 16:38:13 +00:00 committed by GitHub
parent c0170563f2
commit 703d390566
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 38 additions and 12 deletions

View File

@ -83,6 +83,28 @@ jobs:
echo "::set-output name=hotfix_branch_exists::0" echo "::set-output name=hotfix_branch_exists::0"
fi fi
lint:
name: Lint
runs-on: ubuntu-20.04
steps:
- name: Checkout repo
uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846
- name: Cache npm
id: npm-cache
uses: actions/cache@937d24475381cd9c75ae6db12cb4e79714b926ed
with:
path: '~/.npm'
key: ${{ runner.os }}-npm-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-
- name: Install Node dependencies
run: npm ci
- name: Run linter
run: npm run lint
linux: linux:
name: Linux Build name: Linux Build
@ -132,9 +154,6 @@ jobs:
- name: Install Node dependencies - name: Install Node dependencies
run: npm ci run: npm ci
- name: Run linter
run: npm run lint
- name: Build application - name: Build application
run: npm run dist:lin run: npm run dist:lin
@ -244,9 +263,6 @@ jobs:
- name: Install Node dependencies - name: Install Node dependencies
run: npm ci run: npm ci
- name: Run linter
run: npm run lint
- name: Build & Sign (dev) - name: Build & Sign (dev)
env: env:
ELECTRON_BUILDER_SIGN: 1 ELECTRON_BUILDER_SIGN: 1
@ -498,9 +514,6 @@ jobs:
- name: Install Node dependencies - name: Install Node dependencies
run: npm ci run: npm ci
- name: Run linter
run: npm run lint
- name: Build application (dev) - name: Build application (dev)
run: npm run build run: npm run build
@ -523,7 +536,10 @@ jobs:
macos-package-github: macos-package-github:
name: MacOS Package GitHub Release Assets name: MacOS Package GitHub Release Assets
runs-on: macos-11 runs-on: macos-11
needs: [setup, macos-build] needs:
- setup
- macos-build
- lint
env: env:
_PACKAGE_VERSION: ${{ needs.setup.outputs.package_version }} _PACKAGE_VERSION: ${{ needs.setup.outputs.package_version }}
steps: steps:
@ -709,7 +725,10 @@ jobs:
macos-package-mas: macos-package-mas:
name: MacOS Package Prod Release Asset name: MacOS Package Prod Release Asset
runs-on: macos-11 runs-on: macos-11
needs: [setup, macos-build] needs:
- setup
- macos-build
- lint
env: env:
_PACKAGE_VERSION: ${{ needs.setup.outputs.package_version }} _PACKAGE_VERSION: ${{ needs.setup.outputs.package_version }}
steps: steps:
@ -887,7 +906,10 @@ jobs:
name: MacOS Package Dev Release Asset name: MacOS Package Dev Release Asset
if: false # We need to look into how code signing works for dev if: false # We need to look into how code signing works for dev
runs-on: macos-11 runs-on: macos-11
needs: [setup, macos-build] needs:
- setup
- macos-build
- lint
env: env:
_PACKAGE_VERSION: ${{ needs.setup.outputs.package_version }} _PACKAGE_VERSION: ${{ needs.setup.outputs.package_version }}
steps: steps:
@ -1099,6 +1121,7 @@ jobs:
needs: needs:
- cloc - cloc
- setup - setup
- lint
- linux - linux
- windows - windows
- macos-build - macos-build
@ -1111,6 +1134,7 @@ jobs:
env: env:
CLOC_STATUS: ${{ needs.cloc.result }} CLOC_STATUS: ${{ needs.cloc.result }}
SETUP_STATUS: ${{ needs.setup.result }} SETUP_STATUS: ${{ needs.setup.result }}
LINT_STATUS: ${{ needs.lint.result }}
LINUX_STATUS: ${{ needs.linux.result }} LINUX_STATUS: ${{ needs.linux.result }}
WINDOWS_STATUS: ${{ needs.windows.result }} WINDOWS_STATUS: ${{ needs.windows.result }}
MACOS_BUILD_STATUS: ${{ needs.macos-build.result }} MACOS_BUILD_STATUS: ${{ needs.macos-build.result }}
@ -1122,6 +1146,8 @@ jobs:
exit 1 exit 1
elif [ "$SETUP_STATUS" = "failure" ]; then elif [ "$SETUP_STATUS" = "failure" ]; then
exit 1 exit 1
elif [ "$LINT_STATUS" = "failure" ]; then
exit 1
elif [ "$LINUX_STATUS" = "failure" ]; then elif [ "$LINUX_STATUS" = "failure" ]; then
exit 1 exit 1
elif [ "$WINDOWS_STATUS" = "failure" ]; then elif [ "$WINDOWS_STATUS" = "failure" ]; then