-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Test Grafana v10 and v11 in CI
* Split CI jobs in multiple files Signed-off-by: Mahendra Paipuri <mahendra.paipuri@gmail.com>
- Loading branch information
1 parent
c69d2ca
commit d5f4b7d
Showing
7 changed files
with
279 additions
and
170 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
name: build | ||
run-name: Build and Unit Tests | ||
|
||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
build: | ||
name: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Setup Node.js environment | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20' | ||
cache: 'yarn' | ||
|
||
- name: Install dependencies | ||
run: yarn install --immutable --prefer-offline | ||
|
||
- name: Check types | ||
run: yarn typecheck | ||
|
||
- name: Lint | ||
run: yarn lint | ||
|
||
- name: Unit tests | ||
run: yarn test:ci | ||
|
||
- name: Build frontend | ||
run: yarn build | ||
|
||
- name: Check for backend | ||
id: check-for-backend | ||
run: | | ||
if [ -f "Magefile.go" ] | ||
then | ||
echo "has-backend=true" >> $GITHUB_OUTPUT | ||
fi | ||
- name: Setup Go environment | ||
if: steps.check-for-backend.outputs.has-backend == 'true' | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: '1.22' | ||
|
||
- name: Test backend | ||
if: steps.check-for-backend.outputs.has-backend == 'true' | ||
uses: magefile/mage-action@v3 | ||
with: | ||
version: latest | ||
args: coverage | ||
|
||
- name: Build backend | ||
if: steps.check-for-backend.outputs.has-backend == 'true' | ||
uses: magefile/mage-action@v3 | ||
with: | ||
version: latest | ||
args: build | ||
|
||
- name: Upload build artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: build-artifacts | ||
path: dist | ||
retention-days: 1 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
name: e2e-tests | ||
run-name: End2End tests | ||
|
||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
tests: | ||
name: tests | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
# Grafana v10 | ||
- grafana-version: 10.4.5 | ||
# Grafana v11 | ||
- grafana-version: 11.1.0 | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Download build artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: build-artifacts | ||
path: dist | ||
|
||
- name: Setup Node.js environment | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20' | ||
cache: 'yarn' | ||
|
||
- name: Install dependencies | ||
run: yarn install --immutable --prefer-offline | ||
|
||
# Install chrome as we will use it in e2e tests | ||
- uses: browser-actions/setup-chrome@v1 | ||
with: | ||
install-dependencies: true | ||
|
||
- name: Run e2e tests | ||
run: | | ||
# Upload/Download artifacts wont preserve permissions | ||
# https://github.com/actions/upload-artifact?tab=readme-ov-file#permission-loss | ||
# Add +x bits on executables | ||
chmod -R +x dist/gpx_* | ||
GRAFANA_VERSION=${{ matrix.grafana-version }} yarn e2e:server:up | ||
# Sleep for a while for containers to be up and running | ||
sleep 20 | ||
# Run e2e tests | ||
yarn e2e | ||
# Run API tests | ||
yarn e2e:report | ||
# yarn e2e:server:down | ||
- name: Compare PDF report from plain server | ||
uses: nowsprinting/diff-pdf-action@v1 | ||
with: | ||
file1: default.pdf | ||
file2: .ci/reports/default.pdf | ||
options: --verbose | ||
|
||
- name: Compare PDF report from TLS server | ||
uses: nowsprinting/diff-pdf-action@v1 | ||
with: | ||
file1: alternative.pdf | ||
file2: .ci/reports/alternative.pdf | ||
options: --verbose | ||
|
||
- name: Collect docker logs on failure | ||
if: failure() | ||
uses: jwalton/gh-docker-logs@v2 | ||
with: | ||
dest: docker-logs | ||
|
||
- name: Upload UI Test artifacts | ||
if: failure() | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ui-test-output-${{ matrix.grafana-version }} | ||
path: | | ||
test-results | ||
docker-logs | ||
default.pdf | ||
alternative.pdf | ||
retention-days: 1 |
Oops, something went wrong.