test(python): add new tests for shell.py #28
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 & Test Report | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| # Best Practice: Prevent race conditions on the gh-pages branch | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: true | |
| # These permissions are required for the actions to post comments and push to the gh-pages branch | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.13' | |
| - name: Install Poetry | |
| run: pipx install poetry | |
| - name: Install dependencies | |
| run: poetry install --no-interaction --no-ansi | |
| - name: Install Allure Commandline | |
| run: | | |
| wget https://github.com/allure-framework/allure2/releases/download/2.29.0/allure-2.29.0.tgz | |
| sudo tar -zxvf allure-2.29.0.tgz -C /opt/ | |
| sudo ln -s /opt/allure-2.29.0/bin/allure /usr/bin/allure | |
| allure --version | |
| - name: Run CI Pipeline (Lint, Typecheck, Test) | |
| # This runs all checks and generates the raw 'allure-results' | |
| run: poetry run task ci | |
| - name: Check out gh-pages branch for history | |
| uses: actions/checkout@v4 | |
| if: always() | |
| continue-on-error: true | |
| with: | |
| ref: gh-pages | |
| # Checkout to a specific path | |
| path: gh-pages | |
| - name: Copy history from previous report | |
| run: | | |
| # This command enables the history trend graph in the new report | |
| cp -r gh-pages/history test/allure-results/ || echo "No history found on first run." | |
| - name: Create CI report metadata | |
| run: | | |
| # This creates the executor.json for clickable history links | |
| echo '{"name": "GitHub Actions", "type": "github", "buildName": "Run #${{ github.run_number }}", "buildUrl": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}", "reportUrl": "https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/"}' > ./test/allure-results/executor.json | |
| - name: Build Allure Report | |
| # This calls your new 'report_ci' task | |
| run: poetry run task report_ci | |
| - name: Set up Pages | |
| # This action prepares the artifact for deployment | |
| uses: actions/configure-pages@v5 | |
| - name: Upload artifact | |
| # This action uploads the report as a Pages artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: './test/allure-report' | |
| # This job deploys the report | |
| deploy: | |
| # It requires the 'build' job to finish successfully | |
| needs: build | |
| # Only run this job on pushes to the main branch | |
| if: github.ref == 'refs/heads/main' | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |