generated from grafana/grafana-starter-datasource-backend
-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
83 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
name: Grafana Bench | ||
on: | ||
push: | ||
# Only run on push to the main branch | ||
branches: [main, master] | ||
|
||
jobs: | ||
test: | ||
timeout-minutes: 60 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20' | ||
cache: 'yarn' | ||
|
||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version: 'stable' | ||
|
||
- name: Build backend | ||
uses: magefile/mage-action@v3 | ||
with: | ||
args: buildAll | ||
version: latest | ||
|
||
- name: Install frontend dependencies | ||
run: yarn install --frozen-lockfile | ||
|
||
- name: Build frontend | ||
run: yarn build | ||
env: | ||
NODE_OPTIONS: '--max_old_space_size=4096' | ||
|
||
- name: Install and run Docker Compose | ||
uses: hoverkraft-tech/[email protected] | ||
with: | ||
compose-file: './docker-compose.yml' | ||
|
||
- name: Wait for Grafana to start | ||
run: | | ||
curl http://localhost:3000 | ||
#RESPONSE=$(curl -s -o /dev/null -w "%{http_code}" http://localhost:3000) | ||
#echo $response | ||
#if [ $RESPONSE -ne 200 ]; then | ||
# sleep 5; | ||
# echo "Grafana is not accessible" | ||
# exit 1 | ||
#fi | ||
- name: Run Grafana Bench tests | ||
run: | | ||
docker run --rm \ | ||
--network=host \ | ||
--volume="./:/home/bench/tests/" \ | ||
us-docker.pkg.dev/grafanalabs-global/docker-grafana-bench-prod/grafana-bench:v0.3.0-rc3 test \ | ||
--grafana-admin-password "admin" \ | ||
--grafana-admin-user "admin" \ | ||
--grafana-url "http://localhost:3000" \ | ||
--log-level DEBUG \ | ||
--pw-execute-cmd "yarn e2e" \ | ||
--pw-prepare-cmd "yarn install --frozen-lockfile && yarn playwright install" \ | ||
--test-env-vars "CI=true" \ | ||
--test-runner "playwright" \ | ||
--test-suite-base "/home/bench/tests/" | ||
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