trigger new workflow run #4
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: GitHub API Tests | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| # Grant GITHUB_TOKEN write permissions so it can deploy to gh-pages | |
| permissions: | |
| contents: write | |
| pages: write | |
| id-token: write | |
| jobs: | |
| api-tests: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Install dependencies | |
| run: pip install -r requirements.txt | |
| # The default GITHUB_TOKEN is an "integration" token and cannot access /user or create repos. | |
| # We must use a Personal Access Token (PAT) stored as a GitHub Secret. | |
| - name: Run API tests | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }} | |
| run: pytest tests/ -v --alluredir=allure-results | |
| - name: Load Allure history | |
| uses: actions/checkout@v4 | |
| if: always() | |
| continue-on-error: true | |
| with: | |
| ref: gh-pages | |
| path: gh-pages | |
| - name: Generate & deploy Allure report | |
| uses: simple-elf/allure-report-action@master | |
| if: always() | |
| with: | |
| allure_results: allure-results | |
| allure_history: allure-history | |
| - name: Fix Allure report permissions | |
| if: always() | |
| run: sudo chown -R $USER:$USER allure-history | |
| - uses: peaceiris/actions-gh-pages@v3 | |
| if: always() | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_branch: gh-pages | |
| publish_dir: allure-history |