-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathe2e-playwright-allure_report.yml
More file actions
122 lines (107 loc) · 4.17 KB
/
e2e-playwright-allure_report.yml
File metadata and controls
122 lines (107 loc) · 4.17 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
121
122
name: Playwright E2E Tests
permissions: {}
on:
workflow_dispatch:
inputs:
project:
description: 'Select the Browser to be used for E2E Testing'
required: true
default: 'chromium_test_workflow'
type: choice
options:
- chromium_test_workflow
- firefox_test_workflow
- webkit_test_workflow
schedule:
- cron: "0 0 * * *"
jobs:
run-playwright-e2e:
timeout-minutes: 30
runs-on: ubuntu-latest
outputs:
upload_success: ${{ steps.set-upload-status.outputs.upload_success }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # tag=v6.0.2
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # tag=v6.3.0
with:
node-version: lts/*
- name: Add Environment Variable To DependencyTrack Apiserver
run: |
cat <<EOF > docker-compose.override.yml
services:
apiserver:
environment:
ALPINE_BCRYPT_ROUNDS: "4"
EOF
- name: Checkout Hyades Repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # tag=v6.0.2
with:
repository: DependencyTrack/hyades
path: hyades
- name: Start DependencyTrack
run: |
docker compose -f ./hyades/docker-compose.yml -f docker-compose.override.yml --profile demo up -d --pull always
- name: Generate Random UUID for password use
run: |
RANDOM_PASSWORD=$(uuidgen -r)
echo "::add-mask::$RANDOM_PASSWORD" # Mask the value
echo "RANDOM_PASSWORD=$RANDOM_PASSWORD" >> $GITHUB_ENV
- name: Install necessary playwright dependencies
run: |
npm ci
npx playwright install --with-deps
- name: Generate BDD Tests
run: npx bddgen
- name: Run Playwright tests
run: npx playwright test --project=${{ inputs.project || 'chromium_test_workflow' }}
- name: Upload test results
id: upload-step
if: ${{ !cancelled() }}
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # tag=v7.0.0
with:
name: playwright-results
path: playwright-test-results/allure-results
- name: Set upload success output
id: set-upload-status
if: ${{ !cancelled() }}
run: |
if [ "${{ steps.upload-step.conclusion }}" == "success" ]; then
echo "upload_success=true" >> $GITHUB_OUTPUT
else
echo "upload_success=false" >> $GITHUB_OUTPUT
fi
publish-results:
permissions:
contents: write
needs: run-playwright-e2e
runs-on: ubuntu-latest
if: "${{ always() && needs.run-playwright-e2e.outputs.upload_success == 'true' && github.repository_owner == 'DependencyTrack' }}"
steps:
- name: Download test results
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # tag=v8.0.0
with:
name: playwright-results
path: playwright-test-results/allure-results
- name: Load test report history
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # tag=v6.0.2
if: always()
continue-on-error: true
with:
ref: allure-report
path: latest-test-results
- name: Build test report
uses: simple-elf/allure-report-action@53ebb757a2097edc77c53ecef4d454fc2f2f774c # tag=v1.13
if: always()
with:
gh_pages: latest-test-results
allure_results: playwright-test-results/allure-results # path in project to allure report
allure_history: allure-history # directory to be published
- name: Publish test report
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # tag=v4.0.0
if: always()
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: allure-report # branch-name to paste history to
publish_dir: allure-history # directory to be published
user_name: 'github-actions[bot]' # user for publishing
user_email: 'github-actions[bot]@users.noreply.github.com' # email for publishing