Skip to content

Commit

Permalink
Split the longest-to-run workflow job into two
Browse files Browse the repository at this point in the history
  • Loading branch information
imnasnainaec committed Oct 23, 2023
1 parent 2459886 commit ef969b3
Showing 1 changed file with 30 additions and 7 deletions.
37 changes: 30 additions & 7 deletions .github/workflows/frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ permissions: # added using https://github.com/step-security/secure-workflows
contents: read

jobs:
lint_test_build:
lint_build:
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -28,16 +28,42 @@ jobs:
api.github.com:443
github.com:443
registry.npmjs.org:443
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- name: Checkout repository
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run fmt-frontend-check
- run: npm run lint
- run: npm run build

# Coverage.
test_coverage:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18]
steps:
# See https://docs.stepsecurity.io/harden-runner/getting-started/ for instructions on
# configuring harden-runner and identifying allowed endpoints.
- name: Harden Runner
uses: step-security/harden-runner@1b05615854632b887b69ae1be8cbefe72d3ae423 # v2.6.0
with:
disable-sudo: true
egress-policy: block
allowed-endpoints: >
*.actions.githubusercontent.com:443
api.github.com:443
github.com:443
registry.npmjs.org:443
- name: Checkout repository
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run test-frontend:coverage
env:
CI: true
Expand All @@ -49,11 +75,8 @@ jobs:
path: coverage/clover.xml
retention-days: 7

# Release build.
- run: npm run build

upload_coverage:
needs: lint_test_build
needs: test_coverage
runs-on: ubuntu-latest
steps:
# See https://docs.stepsecurity.io/harden-runner/getting-started/ for instructions on
Expand Down

0 comments on commit ef969b3

Please sign in to comment.