1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-12-26 17:08:33 +01:00

BEEEP - organize linting in CI (#1520)

This commit is contained in:
Micaiah Martin 2022-03-07 09:02:23 -07:00 committed by GitHub
parent 0e515bc6c1
commit 5cb3941190
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -30,6 +30,26 @@ jobs:
- name: Print lines of code
run: cloc --include-lang TypeScript,JavaScript,HTML,Sass,CSS --vcs git
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@c64c572235d810460d0d6876e9c705ad5002b353 # v2.1.6
with:
path: "~/.npm"
key: ${{ runner.os }}-npm-lint-${{ hashFiles('**/package-lock.json') }}
- name: Install dependencies
run: npm ci
- name: Run linter
run: npm run lint
setup:
name: Setup
runs-on: ubuntu-20.04
@ -46,7 +66,9 @@ jobs:
build-oss-selfhost:
name: Build OSS zip
runs-on: ubuntu-20.04
needs: setup
needs:
- setup
- lint
env:
_VERSION: ${{ needs.setup.outputs.version }}
steps:
@ -93,7 +115,9 @@ jobs:
build-cloud:
name: Build Cloud zip
runs-on: ubuntu-20.04
needs: setup
needs:
- setup
- lint
env:
_VERSION: ${{ needs.setup.outputs.version }}
steps:
@ -140,7 +164,9 @@ jobs:
build-commercial-selfhost:
name: Build SelfHost Docker image
runs-on: ubuntu-20.04
needs: setup
needs:
- setup
- lint
env:
_VERSION: ${{ needs.setup.outputs.version }}
steps:
@ -246,6 +272,9 @@ jobs:
build-qa:
name: Build Docker images for QA environment
runs-on: ubuntu-20.04
needs:
- setup
- lint
steps:
- name: Set up Node
uses: actions/setup-node@46071b5c7a2e0c34e49c3cb8a0e792e86e18d5ea
@ -377,9 +406,6 @@ jobs:
- name: Install dependencies
run: npm ci
- name: Run linter
run: npm run lint
- name: NPM build
run: npm run build:bit:cloud
@ -428,6 +454,7 @@ jobs:
needs:
- cloc
- setup
- lint
- build-oss-selfhost
- build-cloud
- build-commercial-selfhost
@ -439,6 +466,7 @@ jobs:
if: ${{ (github.ref == 'refs/heads/master') || (github.ref == 'refs/heads/rc') }}
env:
CLOC_STATUS: ${{ needs.cloc.result }}
LINT_STATUS: ${{ needs.lint.result }}
SETUP_STATUS: ${{ needs.setup.result }}
BUILD_OSS_SELFHOST_STATUS: ${{ needs.build-oss-selfhost.result }}
BUILD_CLOUD_STATUS: ${{ needs.build-cloud.result }}
@ -449,6 +477,8 @@ jobs:
run: |
if [ "$CLOC_STATUS" = "failure" ]; then
exit 1
elif [ "$LINT_STATUS" = "failure" ]; then
exit 1
elif [ "$SETUP_STATUS" = "failure" ]; then
exit 1
elif [ "$BUILD_OSS_SELFHOST_STATUS" = "failure" ]; then