-
Notifications
You must be signed in to change notification settings - Fork 0
140 lines (124 loc) · 3.98 KB
/
test_integration_playwright.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
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
name: Integration Test [Playwright]
on:
workflow_dispatch:
inputs:
deployment:
required: true
type: choice
default: "ccv.cardanoapi.io"
options:
- "ccv.cardanoapi.io"
workflow_run:
workflows:
- Build and deploy CCVA
types:
- completed
jobs:
integration-tests:
runs-on: ubuntu-20.04
defaults:
run:
working-directory: integration_test
env:
HOST_URL: https://ccv.cardanoapi.io
CI: ture
KUBER_API_URL: ${{vars.KUBER_API_URL}}
KUBER_API_KEY: ${{secrets.KUBER_API_KEY}}
TEST_WORKERS: ${{vars.TEST_WORKERS}}
BLOCKFROST_API_KEY: ${{secrets.BLOCKFROST_API_KEY}}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "18"
cache: "npm"
cache-dependency-path: "./integration_test/package-lock.json"
- name: Install dependencies
run: npm ci
- name: Cache Playwright browsers
id: cache-playwright-browsers
uses: actions/cache@v3
with:
path: |
~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-browsers
- name: Install Playwright browsers if not cached
if: steps.cache-playwright-browsers.outputs.cache-hit != 'true'
run: npx playwright install --with-deps
- name: Run tests
run: |
npm test
- name: Upload report
uses: actions/upload-artifact@v3
if: always()
with:
name: allure-results
path: integration_test/allure-results
publish-report:
runs-on: ubuntu-20.04
if: always()
needs: integration-tests
steps:
- uses: actions/checkout@v4
- name: Download report
uses: actions/download-artifact@v3
with:
name: allure-results
path: allure-results
- name: Get Allure history
uses: actions/checkout@v4
continue-on-error: true
with:
ref: gh-pages
path: gh-pages
repository: cardanoapi/ccv-test-reports
token: ${{ secrets.GH_PAGE_DEPLOY_KEY }}
# ssh-key:
- name: Register report
id: register-project
if: ${{success()}}
run: |
chmod +x .github/scripts/register_report.sh
.github/scripts/register_report.sh
- if: steps.register-project.outputs.project_exists != 'true'
uses: JamesIves/github-pages-deploy-action@v4
with:
token: ${{ secrets.GH_PAGE_DEPLOY_KEY }}
# ssh-key:
repository-name: cardanoapi/ccv-test-reports
branch: gh-pages
folder: project
- name: Generate report details
id: report-details
run: |
chmod +x .github/scripts/generate_report_details.sh
.github/scripts/generate_report_details.sh
- name: Build report
uses: simple-elf/allure-report-action@master
if: always()
id: allure-report
with:
allure_results: allure-results
gh_pages: gh-pages/${{ env.REPORT_NAME }}
allure_report: allure-report
allure_history: allure-history
keep_reports: 2000
report_url: ${{steps.report-details.outputs.report_url}}
github_run_num: ${{steps.report-details.outputs.report_number}}
- name: Generate Latest Report
run: |
chmod +x .github/scripts/generate_latest_report_redirect.sh
.github/scripts/generate_latest_report_redirect.sh ${{steps.report-details.outputs.report_number}}
- name: Deploy report to Github Pages
uses: JamesIves/[email protected]
with:
token: ${{ secrets.GH_PAGE_DEPLOY_KEY }}
# ssh-key:
repository-name: cardanoapi/ccv-test-reports
branch: gh-pages
folder: build
target-folder: integration-tests
env:
REPORT_NAME: integration-tests
GH_PAGES: cardanoapi/ccv-test-reports
CI: ture