feat: interop for ethers adapter #173
Workflow file for this run
This file contains hidden or 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: ci-run-tests | |
| on: | |
| pull_request: | |
| push: | |
| branches: [main] | |
| concurrency: | |
| group: test-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| unit-tests: | |
| name: unit-tests 🧪 | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@735343b667d3e6f658f44d0eca948eb6282f2b76 # v2.0.2 | |
| with: | |
| bun-version: '1.3.5' | |
| - name: Install deps | |
| run: bun install | |
| - name: Build | |
| run: bun run build | |
| - name: Run unit tests w/ coverage | |
| run: | | |
| bun test src | |
| test -f coverage/lcov.info || (echo "lcov not found for unit tests" && exit 1) | |
| mv coverage/lcov.info lcov.unit.info | |
| - name: Upload unit coverage | |
| uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 | |
| with: | |
| name: lcov-unit | |
| path: lcov.unit.info | |
| e2e-tests: | |
| name: e2e-tests 🔚2️⃣🔚 | |
| runs-on: ubuntu-latest | |
| needs: unit-tests | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@3d267786b128fe76c2f16a390aa2448b815359f3 # v2.0.2 | |
| with: | |
| bun-version: '1.3.5' | |
| - name: Install deps | |
| run: bun install --frozen-lockfile | |
| - name: Install build deps | |
| run: sudo apt-get update && sudo apt-get install -y --no-install-recommends lcov | |
| - name: Install Foundry (anvil) | |
| uses: foundry-rs/foundry-toolchain@8b0419c685ef46cb79ec93fbdc131174afceb730 # v1.6.0 | |
| with: | |
| version: v1.5.1 | |
| - name: Run ZKsync OS (L1-L2) | |
| uses: dutterbutter/zksync-server-action@54ebddef27a0bd7ef30246f94add1c9091ae23be # v0.2.0 | |
| with: | |
| version: v0.15.1 | |
| protocol_version: v30.2 | |
| - name: Compile test contracts | |
| working-directory: tests/contracts | |
| run: | | |
| forge build | |
| - name: Run ethers e2e | |
| run: | | |
| bun run test:e2e:ethers | |
| test -f coverage/lcov.info || (echo "lcov not found for e2e ethers" && exit 1) | |
| mv coverage/lcov.info lcov.e2e.ethers.info | |
| - name: Run viem e2e | |
| run: | | |
| bun run test:e2e:viem | |
| test -f coverage/lcov.info || (echo "lcov not found for e2e viem" && exit 1) | |
| mv coverage/lcov.info lcov.e2e.viem.info | |
| - name: Merge E2E LCOV | |
| run: | | |
| lcov -a lcov.e2e.ethers.info -a lcov.e2e.viem.info -o lcov.e2e.info | |
| - name: Upload e2e coverage | |
| uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 | |
| with: | |
| name: lcov-e2e | |
| path: lcov.e2e.info | |
| coverage-merge: | |
| name: coverage-merge 📊 | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| needs: [unit-tests, e2e-tests] | |
| steps: | |
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0 | |
| with: | |
| name: lcov-unit | |
| path: ./cov | |
| - uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0 | |
| with: | |
| name: lcov-e2e | |
| path: ./cov | |
| - name: Install lcov and merge | |
| run: | | |
| sudo apt-get update && sudo apt-get install -y lcov | |
| lcov -a ./cov/lcov.unit.info -a ./cov/lcov.e2e.info -o ./cov/lcov.merged.info | |
| - name: Report coverage on PR | |
| if: ${{ github.event_name == 'pull_request' }} | |
| uses: zgosalvez/github-actions-report-lcov@8ead3c903cefbc389528f5e032e793a5d0e5b626 # v5.0.2 | |
| with: | |
| coverage-files: ./cov/lcov.merged.info | |
| minimum-coverage: 80 | |
| artifact-name: coverage-html | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| update-comment: true | |
| title-prefix: "ci-run-tests" | |
| - name: Upload merged LCOV | |
| uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 | |
| with: | |
| name: lcov-merged | |
| path: ./cov/lcov.merged.info | |
| if-no-files-found: error | |
| retention-days: 7 | |
| codecov: | |
| name: codecov ☁️ | |
| runs-on: ubuntu-latest | |
| needs: coverage-merge | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| with: | |
| fetch-depth: 2 | |
| - name: Download merged LCOV | |
| uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0 | |
| with: | |
| name: lcov-merged | |
| path: ./cov | |
| - name: Upload to Codecov | |
| uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2 | |
| with: | |
| files: ./cov/lcov.merged.info | |
| flags: combined | |
| disable_search: true | |
| verbose: true | |
| fail_ci_if_error: false | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
| docs-examples: | |
| name: docs-examples 📑 | |
| permissions: | |
| contents: read | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| suite: | |
| - "docs/snippets/core" | |
| - "docs/snippets/ethers" | |
| - "docs/snippets/viem" | |
| steps: | |
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| - name: Install build deps | |
| run: sudo apt-get update && sudo apt-get install -y --no-install-recommends lcov | |
| - name: Install Foundry (anvil) | |
| uses: foundry-rs/foundry-toolchain@8b0419c685ef46cb79ec93fbdc131174afceb730 # v1.6.0 | |
| with: | |
| version: v1.5.1 | |
| - name: Run ZKsync OS (L1-L2) | |
| uses: dutterbutter/zksync-server-action@54ebddef27a0bd7ef30246f94add1c9091ae23be # v0.2.0 | |
| with: | |
| version: v0.15.1 | |
| protocol_version: v30.2 | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@735343b667d3e6f658f44d0eca948eb6282f2b76 # v2.0.2 | |
| with: | |
| bun-version: '1.3.5' | |
| - name: Install deps | |
| run: bun install | |
| - name: Build | |
| run: bun run build | |
| - name: Run docs examples tests | |
| env: | |
| L1_RPC: http://localhost:8545 | |
| L2_RPC: http://localhost:3050 | |
| PRIVATE_KEY: '0x7726827caac94a7f9e1b160f7ea819f172f7b6f9d2a97f992c38edeab82d4110' | |
| run: | | |
| bun test ${{ matrix.suite }} --timeout 100000 |