Add GitHub workflow for testing and coverage reporting #2
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: Test | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python 3.12 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| cache: 'pip' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install pytest-cov codecov | |
| pip install -e . | |
| - name: Run tests with coverage | |
| env: | |
| ANKR_ENDPOINT: ${{ secrets.ANKR_ENDPOINT }} | |
| ANKR_PRIVATE_KEY: ${{ secrets.ANKR_PRIVATE_KEY }} | |
| run: | | |
| pytest --cov=web3_mcp --cov-report=xml --cov-report=term | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| file: ./coverage.xml | |
| fail_ci_if_error: false | |
| # Token is optional for public repositories | |
| token: ${{ secrets.CODECOV_TOKEN }} |