Skip to content

Commit

Permalink
Tweak ci
Browse files Browse the repository at this point in the history
  • Loading branch information
eternauta1337 committed Feb 24, 2024
1 parent ef7cdd8 commit 3d96578
Showing 1 changed file with 29 additions and 31 deletions.
60 changes: 29 additions & 31 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,34 +7,11 @@ on:
branches: [main]

jobs:
setup:
runs-on: ubuntu-latest
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
uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
test:
needs: setup
prepare-and-test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x]
package:
[
common,
Expand All @@ -46,15 +23,36 @@ jobs:
ethernaut-ui,
]
fail-fast: false
env:
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }}
ALCHEMY_API_KEY: ${{ secrets.ALCHEMY_API_KEY }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}

steps:
- uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 20.x
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Restore Dependencies from Cache
uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}

- name: Install Dependencies
run: npm ci

- name: Build
run: npm run build --if-present

- name: Compile
run: npm run compile --if-present

- name: Start local chain
run: |
npm run chain &
sleep 10
# Dynamically navigate to package directory and run tests
- name: Run Tests in ${{ matrix.package }}
run: |
cd packages/${{ matrix.package }}
npm ci
npm t

0 comments on commit 3d96578

Please sign in to comment.