Updated. #98
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: Tests | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| statuses: write | |
| id-token: write | |
| checks: write | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| container: | |
| image: ghcr.io/xu-cheng/texlive-debian:latest | |
| strategy: | |
| matrix: | |
| python-version: ['3.13'] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install just | |
| uses: extractions/setup-just@v3 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v4 | |
| with: | |
| version: "latest" | |
| - name: Set up Python ${{ matrix.python-version }} | |
| run: | | |
| uv python install ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: just sync | |
| - name: Run tests with pytest | |
| run: just test | |
| - name: Upload coverage reports to Codecov with GitHub Action | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| files: ./.coverage.xml | |
| use_oidc: true | |
| # env: | |
| # CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
| pages-build: | |
| runs-on: ubuntu-latest | |
| if: github.ref == 'refs/heads/main' && github.event_name == 'push' | |
| needs: test | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install just | |
| uses: extractions/setup-just@v3 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v4 | |
| with: | |
| version: "latest" | |
| - name: Set up Python 3.13 | |
| run: | | |
| uv python install 3.13 | |
| - name: Install dependencies | |
| run: just sync | |
| - name: Build documentation | |
| env: | |
| TERM: dumb | |
| run: just docs-build | |
| - name: Build wheel for docs site | |
| run: | | |
| uv build --package mcqpy | |
| just docs-copy-wheels | |
| - name: Upload to GitHub Pages | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: ./docs/site | |
| pages-deploy: | |
| permissions: | |
| pages: write # to deploy to Pages | |
| id-token: write # to verify the deployment originates from an appropriate source | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-latest | |
| needs: pages-build | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 | |