-
Notifications
You must be signed in to change notification settings - Fork 3
118 lines (98 loc) · 3.1 KB
/
test-plugins-against-cockpit.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
name: Test plugins against Cockpit
on:
pull_request: # TODO: change workflow trigger
permissions:
contents: read
env:
ACTIONS_STEP_DEBUG: true
jobs:
collect-shell-versions:
timeout-minutes: 30
runs-on: ubuntu-22.04
outputs:
shell_versions: ${{ steps.collect-shell-versions.outputs.shell_versions }}
steps:
- name: Collect Shell Versions
id: collect-shell-versions
uses: SoftwareAG/plugins-e2e-setup/collect-shell-versions@main
- name: Verify shell versions output
run: echo "Collected shell versions ${{ steps.collect-shell-versions.outputs.shell_versions }}"
build-plugins:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: build
if-no-files-found: error
retention-days: 5
path: |
dist/sag-pkg-community-plugins/**
run-tests-against-shell:
needs: [collect-shell-versions, build-plugins]
runs-on: ubuntu-22.04
strategy:
matrix:
version_data: ${{ fromJson(needs.collect-shell-versions.outputs.shell_versions) }}
env:
JSON: ${{ toJson(matrix.version_data) }}
VERSION: ${{ matrix.version_data.version }}
MAJOR: ${{ matrix.version_data.major }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Download build artifact
uses: actions/download-artifact@v4
with:
name: build
path: dist/apps/sag-pkg-community-plugins/
- name: Get shell app of particular version
uses: SoftwareAG/plugins-e2e-setup/get-shell-app@main
with:
shell-version: ${{ env.VERSION }}
- name: Cypress run
uses: cypress-io/github-action@v5
with:
start: npm run cypress:ctrl
install: false
wait-on: 'http://localhost:4200/apps/cockpit/index.html?remotes=%7B"sag-pkg-community-plugins"%3A%5B"ExampleWidgetPluginModule"%2C"DatapointsGraphWidgetModule"%5D%7D#'
browser: chrome
record: false
config-file: cypress.config.ts
env: C8Y_CTRL_MODE=mocking,grepTags=@${{ env.MAJOR }}
- name: Upload cypress screenshots
uses: actions/upload-artifact@v4
if: failure()
with:
retention-days: 5
name: cypress-screenshots
path: cypress/screenshots
- name: Upload cypress videos
uses: actions/upload-artifact@v4
if: always()
with:
retention-days: 5
name: cypress-videos
path: cypress/videos