From a77536a485b85c8b187f75568ecefc1112aad633 Mon Sep 17 00:00:00 2001 From: Nicolas Lecouflet Date: Wed, 4 Dec 2024 11:42:31 +0100 Subject: [PATCH] refactor(ci): move coverage to separate workflow --- .github/workflows/ci.yml | 43 ---------------------------------- .github/workflows/coverage.yml | 40 +++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 43 deletions(-) create mode 100644 .github/workflows/coverage.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8e590d2..d786e7e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -80,46 +80,3 @@ jobs: run: | echo "## Foundry Unit tests result" >> $GITHUB_STEP_SUMMARY echo "✅ Passed" >> $GITHUB_STEP_SUMMARY - - coverage: - needs: ['build', 'lint'] - runs-on: 'ubuntu-latest' - steps: - - uses: actions/checkout@v3 - with: - submodules: 'recursive' - - - name: Setup repo - uses: ./.github/actions/setup-repo - with: - registry-token: ${{ secrets.SDK_READ_ACCESS_TOKEN }} - - - name: 'Install lcov' - run: 'sudo apt-get install lcov' - - - uses: actions/cache/restore@v3 - with: - fail-on-cache-miss: true - path: | - cache-forge - out - node_modules - key: 'build-${{ github.sha }}' - - - name: 'Generate the coverage report using the unit and the integration tests' - run: 'bun ci:coverage' - env: - ETH_NODE_URI_OPTIMISM: ${{ secrets.ETH_NODE_URI_OPTIMISM }} - ETH_NODE_URI_ARBITRUM: ${{ secrets.ETH_NODE_URI_ARBITRUM }} - ETH_NODE_URI_MAINNET: ${{ secrets.ETH_NODE_URI_MAINNET }} - - - name: 'Upload coverage report to Codecov' - uses: 'codecov/codecov-action@v3' - with: - files: './lcov.info' - token: ${{ secrets.CODECOV_TOKEN }} - - - name: 'Add coverage summary' - run: | - echo "## Coverage result" >> $GITHUB_STEP_SUMMARY - echo "✅ Uploaded to Codecov" >> $GITHUB_STEP_SUMMARY diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 0000000..0126b89 --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,40 @@ +name: Coverage Report +on: + workflow_dispatch: + +jobs: + coverage: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + submodules: 'recursive' + + - name: Setup repo + uses: ./.github/actions/setup-repo + with: + registry-token: ${{ secrets.SDK_READ_ACCESS_TOKEN }} + + - name: Compile foundry + run: forge build + + - name: 'Install lcov' + run: 'sudo apt-get install lcov' + + - name: 'Generate the coverage report using the unit and the integration tests' + run: 'bun ci:coverage' + env: + ETH_NODE_URI_OPTIMISM: ${{ secrets.ETH_NODE_URI_OPTIMISM }} + ETH_NODE_URI_ARBITRUM: ${{ secrets.ETH_NODE_URI_ARBITRUM }} + ETH_NODE_URI_MAINNET: ${{ secrets.ETH_NODE_URI_MAINNET }} + + - name: 'Upload coverage report to Codecov' + uses: 'codecov/codecov-action@v3' + with: + files: './lcov.info' + token: ${{ secrets.CODECOV_TOKEN }} + + - name: 'Add coverage summary' + run: | + echo "## Coverage result" >> $GITHUB_STEP_SUMMARY + echo "✅ Uploaded to Codecov" >> $GITHUB_STEP_SUMMARY