-
-
Notifications
You must be signed in to change notification settings - Fork 19
99 lines (83 loc) · 2.56 KB
/
ci.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
name: CI
on:
push:
branches:
- '**'
tags-ignore:
- 'v**'
pull_request:
jobs:
build:
name: Build and Test
runs-on: ubuntu-22.04
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Setup Node.js 17
uses: actions/setup-node@v3
with:
node-version: 17
- name: Install jsonnet, jsonnet-bundler and grafana/plugin-validator
run: |
go install github.com/google/go-jsonnet/cmd/jsonnet@latest
go install github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb@latest
go install github.com/grafana/plugin-validator/pkg/cmd/plugincheck2@latest
echo "$HOME/go/bin" >> $GITHUB_PATH
- name: Install dependencies
run: make deps
- name: Test plugin
run: make test-frontend-coverage test-backend-coverage
- name: Build plugin
run: make build
- name: Create plugin zip file
run: make zip
- name: Run plugincheck
# ignore unsigned plugin error in CI
run: make plugincheck || true
- name: Publish build artifact
uses: actions/upload-artifact@v3
with:
name: build
path: build
uitests:
name: 'UI Tests (${{ matrix.grafana_image }})'
needs: build
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
grafana_image: ['grafana:latest', 'grafana:9.0.9']
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node.js 17
uses: actions/setup-node@v3
with:
node-version: 17
- name: Download the build artifact
uses: actions/download-artifact@v3
with:
name: build
path: build
- name: Start PCP and Redis in a pod
run: |
# workaround required on GitHub Actions to allow running systemd in rootless containers
# https://github.com/actions/virtual-environments/issues/3536
# https://github.com/ansible-community/molecule/discussions/3155
loginctl enable-linger $(whoami)
make test-ui-start-pod
- name: Run UI Tests
uses: cypress-io/github-action@v4
with:
browser: chrome
env:
CYPRESS_BASE_URL: http://127.0.0.1:3001
RESET_GRAFANA_CMD: make GRAFANA_IMAGE=docker.io/grafana/${{ matrix.grafana_image }} test-ui-start-grafana-build
- name: Publish screenshots and videos from UI tests
uses: actions/upload-artifact@v3
if: failure()
with:
name: cypress
path: |
cypress/screenshots
cypress/videos