Skip to content

Tweak ci

Tweak ci #14

Workflow file for this run

name: Node.js CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
setup:
runs-on: ubuntu-latest
outputs:
cache-key: ${{ steps.cache.outputs.key }}
steps:
- uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 20.x
cache: 'npm'
- name: Install Dependencies
run: npm ci
- run: npm run build --if-present
- run: npm run compile --if-present
- name: Start local chain
run: npm run chain & sleep 10
- name: Cache node modules
id: cache
uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
test:
needs: setup
runs-on: ubuntu-latest
strategy:
matrix:
package:
[
common,
ethernaut-ai,
ethernaut-challenges,
ethernaut-cli,
ethernaut-interact,
ethernaut-toolbox,
ethernaut-ui,
]
fail-fast: false
steps:
- uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 20.x
cache: 'npm'
- name: Restore Dependencies from Cache
uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ needs.setup.outputs.cache-key }}
- name: Test ${{ matrix.package }}
run: cd packages/${{ matrix.package }} && npm t