Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create allure reports in CI #615

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 58 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,15 @@ jobs:
- run: poetry install --no-root --all-extras
- run: poe lint
- run: poe build-develop
- run: poe test -s -o log_cli_level=DEBUG
- run: poe test -s --alluredir allure-results-${{ matrix.python }}-${{ matrix.os }} -o log_cli_level=DEBUG
- name: "Allure: upload artifact"
uses: actions/upload-artifact@master
if: always()
with:
# TODO: handle matrix build structure with allure
name: allure-results-${{ matrix.python }}-${{ matrix.os }}
path: allure-results-${{ matrix.python }}-${{ matrix.os }}
retention-days: 30
# Time skipping doesn't yet support ARM
- if: ${{ !endsWith(matrix.os, '-arm') }}
run: poe test -s -o log_cli_level=DEBUG --workflow-environment time-skipping
Expand Down Expand Up @@ -111,3 +119,52 @@ jobs:
version: ${{github.event.pull_request.head.ref}}
version-is-repo-ref: true
features-repo-ref: python-update-updates

# https://allurereport.org/docs/integrations-github/
# This must be a separate job since it uses container actions that are linux-only.

create-allure-report:
name: "Allure: load previous history, create report, and publish"
needs: build-lint-test
if: always()
runs-on: ubuntu-latest
strategy:
matrix:
python: ["3.8", "3.12"]
os: [ubuntu-latest, ubuntu-arm, macos-intel, macos-arm, windows-latest]
exclude:
- os: macos-arm
python: "3.8"
steps:
- name: "Allure: Download Artifacts"
uses: actions/download-artifact@v3
id: download
with:
path: allure-results-${{ matrix.python }}-${{ matrix.os }}
name: allure-results

- name: "Allure: load test report history"
uses: actions/checkout@v4
if: always()
continue-on-error: true
with:
ref: gh-pages
path: allure-report-data-${{ matrix.python }}-${{ matrix.os }}

- name: "Allure: build test report"
uses: simple-elf/[email protected]
if: always()
with:
gh_pages: allure-report-data-${{ matrix.python }}-${{ matrix.os }}
allure_results: allure-results
allure_history: allure-history-${{ matrix.python }}-${{ matrix.os }}

- name: "Allure: publish test report"
if: always()
uses: Wandalen/wretry.action@master
with:
action: peaceiris/actions-gh-pages@v4
with: |
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: gh-pages
publish_dir: allure-history-${{ matrix.python }}-${{ matrix.os }}
32 changes: 31 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ types-protobuf = ">=3.20"
typing-extensions = "^4.2.0"

[tool.poetry.dev-dependencies]
allure-pytest = "^2.13.5"
cibuildwheel = "^2.19.0"
grpcio-tools = "^1.48.0"
mypy = "^1.0.0"
Expand Down
Loading