-
Notifications
You must be signed in to change notification settings - Fork 114
81 lines (68 loc) · 2.09 KB
/
allure-test-reporter.yml
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
name: Allure Test Reporter
on:
pull_request:
types:
- opened
- reopened
- synchronize
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.sha }}
cancel-in-progress: true
permissions:
id-token: write
contents: write # Required for gh-pages deployment
jobs:
test_and_publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]
- name: Setup Node
uses: actions/[email protected]
with:
node-version-file: '.nvmrc'
cache: 'npm'
- name: Install Dependencies
run: npm ci
- name: Run Tests and Generate Report
run: |
npm run test:ts
- name: Load test report history
uses: actions/checkout@v4
if: always()
continue-on-error: true
with:
ref: gh-pages
path: gh-pages
- name: Generate Allure Report
uses: simple-elf/allure-report-action@master
if: always()
with:
gh_pages: gh-pages
allure_results: allure-results
allure_history: allure-history
keep_reports: 20
- name: Publish to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
if: always()
with:
github_token: ${{ secrets.PAT }}
publish_branch: gh-pages
publish_dir: allure-history
- name: Add Test Report Link as Comment on PR
uses: actions/github-script@v7
with:
github-token: ${{ secrets.PAT }}
script: |
const { owner, repo } = context.repo;
const prNumber = context.payload.pull_request.number;
const repoUrl = context.payload.repository.html_url;
const commentBody = `Allure Test reports for this run are available at:
- Allure Report: https://rudderlabs.github.io/rudder-transformer`;
// Comment on the pull request
await github.rest.issues.createComment({
owner,
repo,
issue_number: prNumber,
body: commentBody
});