From 703d39056606b4be23627285b6a6d866c24cdea6 Mon Sep 17 00:00:00 2001 From: Micaiah Martin <77340197+mimartin12@users.noreply.github.com> Date: Tue, 15 Mar 2022 16:38:13 +0000 Subject: [PATCH] Moved linting to it's own step, removed duplicates (#1404) --- .github/workflows/build.yml | 50 ++++++++++++++++++++++++++++--------- 1 file changed, 38 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b06b9776..4e575f15 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -83,6 +83,28 @@ jobs: echo "::set-output name=hotfix_branch_exists::0" 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: name: Linux Build @@ -132,9 +154,6 @@ jobs: - name: Install Node dependencies run: npm ci - - name: Run linter - run: npm run lint - - name: Build application run: npm run dist:lin @@ -244,9 +263,6 @@ jobs: - name: Install Node dependencies run: npm ci - - name: Run linter - run: npm run lint - - name: Build & Sign (dev) env: ELECTRON_BUILDER_SIGN: 1 @@ -498,9 +514,6 @@ jobs: - name: Install Node dependencies run: npm ci - - name: Run linter - run: npm run lint - - name: Build application (dev) run: npm run build @@ -523,7 +536,10 @@ jobs: macos-package-github: name: MacOS Package GitHub Release Assets runs-on: macos-11 - needs: [setup, macos-build] + needs: + - setup + - macos-build + - lint env: _PACKAGE_VERSION: ${{ needs.setup.outputs.package_version }} steps: @@ -709,7 +725,10 @@ jobs: macos-package-mas: name: MacOS Package Prod Release Asset runs-on: macos-11 - needs: [setup, macos-build] + needs: + - setup + - macos-build + - lint env: _PACKAGE_VERSION: ${{ needs.setup.outputs.package_version }} steps: @@ -887,7 +906,10 @@ jobs: name: MacOS Package Dev Release Asset if: false # We need to look into how code signing works for dev runs-on: macos-11 - needs: [setup, macos-build] + needs: + - setup + - macos-build + - lint env: _PACKAGE_VERSION: ${{ needs.setup.outputs.package_version }} steps: @@ -1099,6 +1121,7 @@ jobs: needs: - cloc - setup + - lint - linux - windows - macos-build @@ -1111,6 +1134,7 @@ jobs: env: CLOC_STATUS: ${{ needs.cloc.result }} SETUP_STATUS: ${{ needs.setup.result }} + LINT_STATUS: ${{ needs.lint.result }} LINUX_STATUS: ${{ needs.linux.result }} WINDOWS_STATUS: ${{ needs.windows.result }} MACOS_BUILD_STATUS: ${{ needs.macos-build.result }} @@ -1122,6 +1146,8 @@ jobs: exit 1 elif [ "$SETUP_STATUS" = "failure" ]; then exit 1 + elif [ "$LINT_STATUS" = "failure" ]; then + exit 1 elif [ "$LINUX_STATUS" = "failure" ]; then exit 1 elif [ "$WINDOWS_STATUS" = "failure" ]; then