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 a9d27b3 commit c000bc4
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 20 deletions.
46 changes: 32 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,34 +7,52 @@ on:
branches: [main]

jobs:
build:
setup:
runs-on: ubuntu-latest
outputs:
cache-key: ${{ steps.cache-keys.outputs.key }}
env:
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }}
ALCHEMY_API_KEY: ${{ secrets.ALCHEMY_API_KEY }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}

strategy:
matrix:
node-version: [20.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
- name: Use Node.js 20.x
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
node-version: 20.x
- 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
- run: cd packages/common && npm t
- run: cd packages/ethernaut-toolbox && npm t
- run: cd packages/ethernaut-ui && npm t
- run: cd packages/ethernaut-interact && npm t
- run: cd packages/ethernaut-challenges && npm t
- run: cd packages/ethernaut-ai && npm t
- run: cd packages/ethernaut-cli && npm t
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 # Keep running other jobs even if one fails
steps:
- uses: actions/checkout@v2
- name: Use Node.js 20.x
uses: actions/setup-node@v2
with:
node-version: 20.x
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
- name: Test ${{ matrix.package }}
run: cd packages/${{ matrix.package }} && npm t
14 changes: 8 additions & 6 deletions packages/ethernaut-challenges/test/tasks/info.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ describe('info', function () {
})

it('shows abi path', async function () {
assert.equal(
findLineWith('ABI path:', levelInfo),
'~/ethernaut-cli/packages/ethernaut-challenges/test/fixture-projects/basic-project/artifacts/interact/abis/Instance.json',
assert.ok(
levelInfo.includes(
'ethernaut-cli/packages/ethernaut-challenges/test/fixture-projects/basic-project/artifacts/interact/abis/Instance.json',
),
)
})

Expand Down Expand Up @@ -64,9 +65,10 @@ describe('info', function () {
})

it('shows abi path', async function () {
assert.equal(
findLineWith('ABI path:', levelInfo),
'~/ethernaut-cli/packages/ethernaut-challenges/test/fixture-projects/basic-project/artifacts/interact/abis/Fallback.json',
assert.ok(
levelInfo.includes(
'ethernaut-cli/packages/ethernaut-challenges/test/fixture-projects/basic-project/artifacts/interact/abis/Fallback.json',
),
)
})

Expand Down

0 comments on commit c000bc4

Please sign in to comment.