Skip to content

Commit

Permalink
refactor(ci): move coverage to separate workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
nlecoufl committed Dec 4, 2024
1 parent 91de161 commit a77536a
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 43 deletions.
43 changes: 0 additions & 43 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
40 changes: 40 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit a77536a

Please sign in to comment.