diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3e3390cd..981e69bb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 @@ -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/allure-report-action@v1.9 + 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 }} diff --git a/poetry.lock b/poetry.lock index 9d63ea1f..0274b58b 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,5 +1,35 @@ # This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand. +[[package]] +name = "allure-pytest" +version = "2.13.5" +description = "Allure pytest integration" +optional = false +python-versions = "*" +files = [ + {file = "allure-pytest-2.13.5.tar.gz", hash = "sha256:0ef8e1790c44a988db6b83c4d4f5e91451e2c4c8ea10601dfa88528d23afcf6e"}, + {file = "allure_pytest-2.13.5-py3-none-any.whl", hash = "sha256:94130bac32964b78058e62cf4b815ad97a5ac82a065e6dd2d43abac2be7640fc"}, +] + +[package.dependencies] +allure-python-commons = "2.13.5" +pytest = ">=4.5.0" + +[[package]] +name = "allure-python-commons" +version = "2.13.5" +description = "('Contains the API for end users as well as helper functions and classes to build Allure adapters for Python test frameworks',)" +optional = false +python-versions = ">=3.6" +files = [ + {file = "allure-python-commons-2.13.5.tar.gz", hash = "sha256:a232e7955811f988e49a4c1dd6c16cce7e9b81d0ea0422b1e5654d3254e2caf3"}, + {file = "allure_python_commons-2.13.5-py3-none-any.whl", hash = "sha256:8b0e837b6e32d810adec563f49e1d04127a5b6770e0232065b7cb09b9953980d"}, +] + +[package.dependencies] +attrs = ">=16.0.0" +pluggy = ">=0.4.0" + [[package]] name = "appdirs" version = "1.4.4" @@ -1754,4 +1784,4 @@ opentelemetry = ["opentelemetry-api", "opentelemetry-sdk"] [metadata] lock-version = "2.0" python-versions = "^3.8" -content-hash = "0e394859d0cd8522c57955db0e9358eacf18609cd0bd4bb0611403f2de7952c4" +content-hash = "1cf07eeb6b5bc0fcab9b618459b836b6653df8f2e67003e99abe51f1dc05754c" diff --git a/pyproject.toml b/pyproject.toml index a4ad2890..70a42e14 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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"