feat(tests): add coverage reports #1804
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: pull request checks | |
on: | |
pull_request: | |
branches: | |
- v2.0 | |
concurrency: | |
# Support push/pr as event types with different behaviors each: | |
# 1. push: queue up builds | |
# 2. pr: only allow one run per PR | |
group: ${{ github.workflow }}-${{ github.event.type }}${{ github.event.pull_request.number }} | |
# If there is already a workflow running for the same pull request, cancel it | |
cancel-in-progress: ${{ github.event_name == 'pull_request' }} | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
if: github.event.action == 'opened' || github.event.action == 'synchronize' | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
- name: setup-node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18.x | |
cache: "npm" | |
cache-dependency-path: "**/package-lock.json" | |
- name: install | |
run: npm ci | |
- name: build | |
run: npm run build | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: build-artifacts | |
path: | | |
packages/core/dist | |
packages/sign-client/dist | |
packages/types/dist | |
packages/utils/dist | |
packages/web3wallet/dist | |
providers/ethereum-provider/dist | |
providers/signer-connection/dist | |
providers/universal-provider/dist | |
code_style: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
style-command: | |
- lint | |
- prettier | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
- name: setup-node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18.x | |
cache: "npm" | |
cache-dependency-path: "**/package-lock.json" | |
- name: install | |
run: npm ci | |
- name: check | |
run: npm run ${{ matrix.style-command }} | |
test: | |
needs: [build, code_style] | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
test-prefix: | |
- packages/sign-client | |
- packages/core | |
- packages/web3wallet | |
- packages/utils | |
- providers/universal-provider | |
- providers/ethereum-provider | |
env: | |
TEST_RELAY_URL: ${{ secrets.TEST_RELAY_URL }} | |
TEST_PROJECT_ID: ${{ secrets.TEST_PROJECT_ID }} | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
- name: setup-node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18.x | |
cache: "npm" | |
cache-dependency-path: "**/package-lock.json" | |
- name: install | |
run: npm ci | |
- uses: actions/download-artifact@v3 | |
with: | |
name: build-artifacts | |
- run: npm run test --prefix=${{ matrix.test-prefix }} | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: coverage | |
path: ${{ matrix.test-prefix }}/coverage |