-
Notifications
You must be signed in to change notification settings - Fork 128
168 lines (139 loc) · 4.38 KB
/
admin.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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
name: 'Client: pmm and pmm-admin'
on:
push:
branches:
- main
- pmm-*
tags:
- v[0-9]+.[0-9]+.[0-9]+*
pull_request:
paths-ignore:
- "agent/**"
- "api-tests/**"
- "docs/**"
- "managed/**"
- "qan-api2/**"
- "update/**"
- "vmproxy/**"
jobs:
test:
name: Tests
runs-on: ubuntu-22.04
strategy:
fail-fast: false
defaults:
run:
working-directory: ${{ github.workspace }}/admin
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up Go release
uses: actions/setup-go@v5
with:
go-version-file: ${{ github.workspace }}/go.mod
cache: false
- name: Enable Go build cache
uses: actions/cache@v4
with:
path: ~/.cache/go-build
key: ${{ runner.os }}-go-build-${{ github.ref }}-${{ hashFiles('**') }}
restore-keys: |
${{ runner.os }}-go-build-${{ github.ref }}-
${{ runner.os }}-go-build-
- name: Enable Go modules cache
uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-modules-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-go-modules-
- name: Download Go modules
run: go mod download -x
- name: Build and install
run: make install
- name: Run tests
run: make test-cover
- name: Upload coverage results
uses: codecov/codecov-action@v4
with:
file: cover.out
flags: admin
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}
- name: Run debug commands on failure
if: ${{ failure() }}
run: |
env | sort
go env | sort
git status
cli-test:
name: CLI Tests
if: false
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
test-type: [ pmm-common, pmm-server-install, pmm-docker-test ]
defaults:
run:
working-directory: ${{ github.workspace }}/cli-tests
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up Go release
uses: actions/setup-go@v5
with:
go-version-file: ${{ github.workspace }}/go.mod
cache: false
- name: Enable Go build cache
uses: actions/cache@v4
with:
path: ~/.cache/go-build
key: ${{ runner.os }}-go-build-${{ github.ref }}-${{ hashFiles('**') }}
restore-keys: |
${{ runner.os }}-go-build-${{ github.ref }}-
${{ runner.os }}-go-build-
- name: Enable Go modules cache
uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-modules-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-go-modules-
- name: Download Go modules
run: go mod download -x
- name: Build and install
run: make -C ../admin install
- name: Setup tools
run: |
sudo ln -sf /home/runner/go/bin/pmm /usr/bin
sudo chown -R runner:docker /usr/bin/pmm
- name: Install Playwright
run: |
npm ci
npx playwright install
- name: Run "pmm" common tests
if: ${{ matrix.test-type == 'pmm-common' }}
run: npx playwright test tests/pmm-cli/pmm.spec.ts
- name: Run "pmm server install" tests
if: ${{ matrix.test-type == 'pmm-server-install' }}
run: npx playwright test tests/pmm-cli/server/install.spec.ts
- name: Run "pmm server upgrade" tests
if: ${{ matrix.test-type == 'pmm-server-update' }}
run: npx playwright test tests/pmm-cli/server/upgrade.spec.ts
- name: Run specific docker tests
if: ${{ matrix.test-type == 'pmm-docker-test' }}
run: npx playwright test tests/pmm-cli/server/docker-specific.spec.ts
- name: Attach the report on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: "report-${{ matrix.go-version }}-${{ matrix.test-type }}"
path: ${{ github.workspace }}/cli-tests/playwright-report/
- name: Run debug commands on failure
if: ${{ failure() }}
run: |
env | sort
go env | sort
git status
node --version
npx --version
npx playwright --version