update #2576
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Tests | |
on: | |
push: | |
paths-ignore: | |
- '**/README.md' | |
jobs: | |
scoped-tests: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
project: [ | |
eth-providers, | |
eth-rpc-adapter, | |
eth-transactions, | |
] | |
steps: | |
- name: checkout | |
uses: actions/checkout@v3 | |
with: | |
submodules: 'recursive' | |
- name: setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- name: setup yarn | |
run: npm install -g yarn | |
- name: install deps | |
run: yarn install --immutable | |
- name: start test infra | |
run: docker compose up -d | |
- name: run tests | |
run: yarn workspace @acala-network/${{ matrix.project }} run test:coverage | |
- name: save coverage reports | |
uses: actions/upload-artifact@v3 | |
with: | |
name: coverage-${{ matrix.project }} | |
path: packages/${{ matrix.project }}/coverage | |
if-no-files-found: error | |
include-hidden-files: true | |
- name: dump docker logs on failure | |
if: failure() | |
uses: jwalton/gh-docker-logs@v2 | |
e2e-tests: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
project: [ | |
e2e-hardhat, | |
e2e-truffle, | |
# e2e-waffle, | |
e2e-viem, | |
] | |
steps: | |
- name: checkout | |
uses: actions/checkout@v3 | |
with: | |
submodules: 'recursive' | |
- name: setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- name: setup yarn | |
run: npm install -g yarn | |
- name: install deps | |
run: yarn install --immutable | |
- name: start test infra | |
run: docker compose up -d | |
- name: start coverage server | |
env: | |
COVERAGE_DIR: eth-rpc-adapter/coverage-${{ matrix.project }} | |
run: yarn workspace @acala-network/eth-rpc-adapter run start:coverage | |
- name: install deps for e2e tests | |
run: cd e2e-tests/${{ matrix.project }} && yarn install --immutable | |
- name: run e2e tests | |
run: cd e2e-tests/${{ matrix.project }} && yarn test:acalaFork | |
- name: stop coverage server and generate coverage report | |
run: yarn workspace @acala-network/eth-rpc-adapter run stop:coverage | |
- name: save coverage reports | |
uses: actions/upload-artifact@v3 | |
with: | |
name: coverage-${{ matrix.project }} | |
path: packages/eth-rpc-adapter/coverage-${{ matrix.project }} | |
if-no-files-found: error | |
include-hidden-files: true | |
- name: dump docker logs on failure | |
if: failure() | |
uses: jwalton/gh-docker-logs@v2 | |
merge-and-upload-coverage-reports: | |
runs-on: ubuntu-latest | |
needs: [scoped-tests, e2e-tests] | |
steps: | |
- name: checkout | |
uses: actions/checkout@v3 | |
with: | |
submodules: 'recursive' | |
- name: setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- name: setup yarn | |
run: npm install -g yarn | |
- name: install deps | |
run: yarn install --immutable | |
- name: download coverage reports for eth-providers | |
uses: actions/download-artifact@v3 | |
with: | |
name: coverage-eth-providers | |
path: packages/eth-providers/coverage | |
- name: download coverage reports for eth-rpc-adapter | |
uses: actions/download-artifact@v3 | |
with: | |
name: coverage-eth-rpc-adapter | |
path: packages/eth-rpc-adapter/coverage | |
- name: download coverage reports for eth-transactions | |
uses: actions/download-artifact@v3 | |
with: | |
name: coverage-eth-transactions | |
path: packages/eth-transactions/coverage | |
- name: download coverage reports for e2e-hardhat | |
uses: actions/download-artifact@v3 | |
with: | |
name: coverage-e2e-hardhat | |
path: packages/eth-rpc-adapter/coverage-e2e-hardhat | |
- name: download coverage reports for e2e-truffle | |
uses: actions/download-artifact@v3 | |
with: | |
name: coverage-e2e-truffle | |
path: packages/eth-rpc-adapter/coverage-e2e-truffle | |
- name: download coverage reports for e2e-viem | |
uses: actions/download-artifact@v3 | |
with: | |
name: coverage-e2e-viem | |
path: packages/eth-rpc-adapter/coverage-e2e-viem | |
- name: merge coverage reports | |
run: yarn merge-coverage | |
- name: upload merged coverage report | |
uses: codecov/codecov-action@v4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
fail_ci_if_error: true |