Skip to content

Commit

Permalink
Update the github workflow to work with multiple events
Browse files Browse the repository at this point in the history
  • Loading branch information
nazarhussain committed Sep 27, 2023
1 parent 6a12f73 commit 286fc1f
Showing 1 changed file with 18 additions and 10 deletions.
28 changes: 18 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ jobs:
lib/
packages/*/lib
packages/*/.git-data.json
key: ${{ runner.os }}-${{ matrix.node }}-${{ github.event.pull_request.head.sha }}
key: ${{ runner.os }}-node-${{ matrix.node }}-${{ github.sha }}
- name: Install & build
if: steps.cache-build-restore.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile && yarn build
- name: Build
run: yarn build
if: steps.cache-build-restore.outputs.cache-hit == 'true'
run: yarn build
- name: Check Build
run: yarn check-build
- name: Test root binary exists
Expand All @@ -70,17 +70,21 @@ jobs:
lib/
packages/*/lib
packages/*/.git-data.json
key: ${{ runner.os }}-${{ matrix.node }}-${{ github.event.pull_request.head.sha }}
key: ${{ runner.os }}-node-${{ matrix.node }}-${{ github.sha }}

lint:
name: Lint
needs: build
runs-on: 'ubuntu-latest'
strategy:
fail-fast: false
matrix:
node: [20]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 20
node-version: ${{ matrix.node }}
check-latest: true
cache: yarn
- name: Restore build cache
Expand All @@ -93,7 +97,7 @@ jobs:
lib/
packages/*/lib
packages/*/.git-data.json
key: ${{ runner.os }}-20-${{ github.event.pull_request.head.sha }}
key: ${{ runner.os }}-node-${{ matrix.node }}-${{ github.sha }}
- name: Assert yarn prints no warnings
run: scripts/assert_no_yarn_warnings.sh
- name: Lint Code
Expand All @@ -109,11 +113,15 @@ jobs:
name: Type Checks
needs: build
runs-on: 'ubuntu-latest'
strategy:
fail-fast: false
matrix:
node: [20]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 20
node-version: ${{ matrix.node }}
check-latest: true
cache: yarn
- name: Restore build cache
Expand All @@ -126,7 +134,7 @@ jobs:
lib/
packages/*/lib
packages/*/.git-data.json
key: ${{ runner.os }}-20-${{ github.event.pull_request.head.sha }}
key: ${{ runner.os }}-node-${{ matrix.node }}-${{ github.sha }}

- name: Check Types
run: yarn check-types
Expand Down Expand Up @@ -159,7 +167,7 @@ jobs:
lib/
packages/*/lib
packages/*/.git-data.json
key: ${{ runner.os }}-${{ matrix.node }}-${{ github.event.pull_request.head.sha }}
key: ${{ runner.os }}-node-${{ matrix.node }}-${{ github.sha }}
# Cache validator slashing protection data tests
- name: Restore spec tests cache
uses: actions/cache@master
Expand Down Expand Up @@ -198,7 +206,7 @@ jobs:
lib/
packages/*/lib
packages/*/.git-data.json
key: ${{ runner.os }}-${{ matrix.node }}-${{ github.event.pull_request.head.sha }}
key: ${{ runner.os }}-node-${{ matrix.node }}-${{ github.sha }}

- name: Run the e2e test environment
run: scripts/run_e2e_env.sh start
Expand Down Expand Up @@ -244,7 +252,7 @@ jobs:
lib/
packages/*/lib
packages/*/.git-data.json
key: ${{ runner.os }}-${{ matrix.node }}-${{ github.event.pull_request.head.sha }}
key: ${{ runner.os }}-node-${{ matrix.node }}-${{ github.sha }}

- name: Browser tests
run: |
Expand Down

0 comments on commit 286fc1f

Please sign in to comment.