Merge pull request #206 from sfeifer/update-vulnerable-dependencies #484
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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:10.2.5', '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 Valkey 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 |