ci: all inclusive with badges #2
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 | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| ci: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| target: | |
| - test | |
| - coverage | |
| steps: | |
| - name: checkout repository | |
| uses: actions/checkout@main | |
| - name: Install Foundry | |
| uses: foundry-rs/foundry-toolchain@v1 | |
| with: | |
| version: nightly | |
| - name: Initializing env file | |
| run: | | |
| echo '# github action setup' >> ./contracts/.env | |
| echo MAINNET_URL=${{ secrets.MAINNET_URL }} >> ./contracts/.env | |
| echo SEPOLIA_URL=${{ secrets.SEPOLIA_URL }} >> ./contracts/.env | |
| echo MAINNET_FORK_BLOCK=${{ secrets.MAINNET_FORK_BLOCK }} >> ./contracts/.env | |
| echo PRIVATE_KEY=${{ secrets.PRIVATE_KEY }} >> ./contracts/.env | |
| echo ETHERSCAN_API_KEY=${{ secrets.ETHERSCAN_API_KEY }} >> ./contracts/.env | |
| - name: Execute ${{ matrix.target }} | |
| run: make -C ./contracts ${{ matrix.target == 'test' && 'test' || 'coverage_ci' }} | |
| - name: Upload coverage reports to Codecov | |
| if: matrix.target == 'coverage' | |
| uses: codecov/codecov-action@v3 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| files: ./contracts/lcov.info |