chore: upgrade GitHub Actions to latest stable versions #566
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-script | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| # Removed hardcoded test API key - use secrets instead if needed | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v7 | |
| - name: Set up Python 3.10 | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.10' | |
| cache: pip | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| pip install -r requirements.dev.txt | |
| - name: Lint with flake8 | |
| run: flake8 --max-line-length=200 . | |
| continue-on-error: true | |
| - name: Type check with mypy | |
| run: | | |
| mypy structkit tests | |
| continue-on-error: true | |
| - name: Run tests | |
| env: | |
| REPORT_OUTPUT: md_report.md | |
| shell: bash | |
| run: | | |
| echo "REPORT_FILE=${REPORT_OUTPUT}" >> "$GITHUB_ENV" | |
| pytest --cov=structkit --cov-branch --cov-report=xml -v --md-report --md-report-flavor gfm --md-report-exclude-outcomes passed skipped xpassed --md-report-output "$REPORT_OUTPUT" --pyargs tests | |
| - name: Upload coverage reports to Codecov | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| - name: Output reports to the job summary when tests fail | |
| if: failure() | |
| shell: bash | |
| run: | | |
| if [ -f "$REPORT_FILE" ]; then | |
| echo "<details><summary>Failed Test Report</summary>" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| cat "$REPORT_FILE" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "</details>" >> $GITHUB_STEP_SUMMARY | |
| fi |