-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (60 loc) · 2.32 KB
/
ci.yml
File metadata and controls
72 lines (60 loc) · 2.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: CI & Test Report
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
# Best Practice: Prevent race conditions on the gh-pages branch
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
# These permissions are required for the actions to post comments and push to the gh-pages branch
permissions:
contents: write
pull-requests: write
jobs:
build-and-report:
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
- 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
uses: actions/checkout@v4
if: always()
continue-on-error: true # This allows the workflow to continue if the branch doesn't exist yet
with:
ref: gh-pages
path: gh-pages
- name: Generate Allure Report with History
uses: mgrybyk-org/allure-report-branch-js-action@v1
# This is crucial: The report should be generated even if tests fail
if: always()
# Give the step an ID so we can reference its outputs later
id: allure_report
with:
# The folder where raw Allure results are stored
report_dir: 'test/allure/results'
gh_pages: 'gh-pages'
- name: Comment on Pull Request with Report Link
# Only run this step for pull request events
if: github.event_name == 'pull_request'
uses: thollander/actions-comment-pull-request@v2
with:
# Use the outputs from the previous step to build a nice message
message: |
${{ steps.allure_report.outputs.test_result_icon }} **Allure Test Report** is ready!
* **Report Link:** ${{ steps.allure_report.outputs.report_url }}
* **History:** ${{ steps.allure_report.outputs.report_history_url }}
# This tag allows the action to update its own comment instead of creating new ones
comment_tag: allure_report