Skip to content

Commit

Permalink
💚 fix ci build with cached node modules
Browse files Browse the repository at this point in the history
  • Loading branch information
Aboudjem committed Nov 8, 2023
1 parent 7055000 commit 851828e
Showing 1 changed file with 30 additions and 29 deletions.
59 changes: 30 additions & 29 deletions .github/workflows/push_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,61 +2,59 @@ name: Test workflow
on: push

jobs:
setup:
name: Setup & Build
setup_dependencies:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
outputs:
cache-key: ${{ steps.cache-modules.outputs.cache-key }}
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set Node.js version
uses: actions/setup-node@v3
- name: Cache node modules
uses: actions/cache@v2
id: cache-modules
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
path: |
**/node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }}

- name: Create a fake .secret file
run: echo "primary twist rack vendor diagram image used route theme frown either will" > .secret

- name: Install dependencies
- name: Install dependencies if cache missed
if: steps.cache-modules.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile

- name: Build
run: yarn build

lint:
name: Lint sources
needs: setup_dependencies
runs-on: ubuntu-latest
needs: setup
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
- name: Use Cached Dependencies
uses: actions/cache@v2
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
path: |
**/node_modules
key: ${{ needs.setup_dependencies.outputs.cache-key }}

- name: Lint sources
run: yarn lint:sol

unit_test:
name: Unit tests
needs: setup_dependencies
runs-on: ubuntu-latest
needs: setup
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
- name: Use Cached Dependencies
uses: actions/cache@v2
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
path: |
**/node_modules
key: ${{ needs.setup_dependencies.outputs.cache-key }}

- name: Create a fake .secret file
run: echo "primary twist rack vendor diagram image used route theme frown either will" > .secret

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
Expand All @@ -66,5 +64,8 @@ jobs:
- name: Install foundry dependencies
run: forge install

- name: Run tests
- name: Build Typechain and Foundry
run: yarn build

- name: Run Forge and Hardhat Tests
run: yarn test

0 comments on commit 851828e

Please sign in to comment.