-
Notifications
You must be signed in to change notification settings - Fork 0
120 lines (101 loc) · 3.04 KB
/
Copy pathci.yml
File metadata and controls
120 lines (101 loc) · 3.04 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
name: CI
on:
push:
branches: ["**"]
pull_request:
branches: ["**"]
workflow_dispatch:
# Cancel superseded runs on the same ref to save CI minutes.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
test:
name: Test (headless Chrome)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "21"
cache: maven
- name: Set up Chrome
uses: browser-actions/setup-chrome@v1
with:
chrome-version: stable
- name: Run tests (TestNG + Cucumber)
run: mvn -B clean test -Dheadless=true
- name: Generate Allure report
if: always()
run: mvn -B allure:report
- name: Upload Allure results
if: always()
uses: actions/upload-artifact@v4
with:
name: allure-results
path: target/allure-results
if-no-files-found: ignore
- name: Upload Allure HTML report
if: always()
uses: actions/upload-artifact@v4
with:
name: allure-report
path: target/site/allure-maven-plugin
if-no-files-found: ignore
- name: Upload Surefire reports & logs
if: always()
uses: actions/upload-artifact@v4
with:
name: surefire-and-logs
path: |
target/surefire-reports
target/logs
if-no-files-found: ignore
# Publishes the latest Allure report (with execution history) to GitHub Pages.
# Runs only on main, and even when tests fail, so the published report always
# reflects the true state of the suite.
publish-report:
name: Publish Allure report to GitHub Pages
needs: test
if: always() && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "21"
- name: Download Allure results
uses: actions/download-artifact@v4
with:
name: allure-results
path: allure-results
- name: Restore previous report history
uses: actions/checkout@v4
continue-on-error: true
with:
ref: gh-pages
path: gh-pages
- name: Carry over execution history
run: |
mkdir -p allure-results/history
if [ -d gh-pages/history ]; then
cp -r gh-pages/history/. allure-results/history/
fi
- name: Generate Allure report
run: |
npm install -g allure-commandline --silent
allure generate allure-results --clean -o allure-report
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: gh-pages
publish_dir: allure-report