Fix analysis lint issues #46
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: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| ci: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e ".[dev,data,stats,lang,dimred,seq]" | |
| - name: Run local CI gate | |
| run: make ci | |
| coverage-badge: | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| needs: [ci] | |
| permissions: | |
| contents: write | |
| runs-on: ubuntu-latest | |
| concurrency: | |
| group: coverage-badge-${{ github.ref }} | |
| cancel-in-progress: true | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.ref_name }} | |
| fetch-depth: 0 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| cache: pip | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e ".[dev,data,stats,lang,dimred,seq]" | |
| - name: Generate coverage artifacts | |
| run: make coverage | |
| - name: Generate coverage badge | |
| run: python scripts/generate_coverage_badge.py | |
| - name: Generate example badges | |
| run: make examples-metrics | |
| - name: Commit and push badges if changed | |
| env: | |
| BRANCH_NAME: ${{ github.ref_name }} | |
| run: | | |
| if ! git status --porcelain -- .github/badges/coverage.svg .github/badges/examples-passing.svg .github/badges/examples-api-coverage.svg | grep -q .; then | |
| echo "Badges unchanged." | |
| exit 0 | |
| fi | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git add .github/badges/coverage.svg .github/badges/examples-passing.svg .github/badges/examples-api-coverage.svg | |
| git commit -m "chore: update coverage and examples badges [skip ci]" | |
| git push origin "HEAD:${BRANCH_NAME}" |