Skip to content

PLT-0000 feat(app): bundle a trace explorer app with the datasource #7

PLT-0000 feat(app): bundle a trace explorer app with the datasource

PLT-0000 feat(app): bundle a trace explorer app with the datasource #7

Workflow file for this run

name: CI
on:
workflow_dispatch:
push:
branches:
- master
- main
pull_request:
branches:
- master
- main
jobs:
build:
runs-on: ubuntu-latest
outputs:
e2e-matrix: ${{ steps.resolve-versions.outputs.matrix }}
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # ratchet:actions/checkout@v6
- name: Setup Node.js environment
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # ratchet:actions/setup-node@v6
with:
node-version: '22'
cache: 'npm'
- name: Cache node_modules for future jobs
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # ratchet:actions/cache@v4
with:
path: node_modules
key: node-modules-${{ hashFiles('package-lock.json') }}
- name: Install dependencies
run: npm ci
- name: Check types
run: npm run typecheck
- name: Lint
run: npm run lint
- name: Unit tests
run: npm run test:ci
- name: Build frontend
run: npm run 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@924ae3a1cded613372ab5595356fb5720e22ba16 # ratchet:actions/setup-go@v6
with:
go-version-file: 'go.mod'
- name: Test backend
if: steps.check-for-backend.outputs.has-backend == 'true'
uses: magefile/mage-action@a3d5bb52942181c125118a2be4b4664c3337aef6 # ratchet:magefile/mage-action@v2
with:
version: latest
args: coverage
- name: Build backend
if: steps.check-for-backend.outputs.has-backend == 'true'
uses: magefile/mage-action@a3d5bb52942181c125118a2be4b4664c3337aef6 # ratchet:magefile/mage-action@v2
with:
version: latest
args: buildAll
- name: Upload build artifact
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # ratchet:actions/upload-artifact@v4
with:
name: dist
path: dist/
- name: Resolve Grafana E2E versions
id: resolve-versions
uses: grafana/plugin-actions/e2e-version@09d9424ff9e927a13892275f0792e1f010ae4bfe # ratchet:grafana/plugin-actions/e2e-version@e2e-version/v1.2.1
with:
skip-grafana-react-19-preview-image: false
e2e:
runs-on: ubuntu-latest
timeout-minutes: 15
needs: build
strategy:
fail-fast: false
matrix:
GRAFANA_IMAGE: ${{ fromJson(needs.build.outputs.e2e-matrix) }}
QUICKWIT_VERSION: [edge]
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # ratchet:actions/checkout@v6
- name: Download build artifact
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # ratchet:actions/download-artifact@v4
with:
name: dist
path: dist/
- name: Restore executable permissions
run: chmod +x dist/datasources/quickwit/gpx_quickwit_*
- name: Setup Node.js environment
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # ratchet:actions/setup-node@v6
with:
node-version: '22'
- name: Restore node_modules
uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # ratchet:actions/cache/restore@v4
with:
path: node_modules
key: node-modules-${{ hashFiles('package-lock.json') }}
- name: Install Playwright
run: npx playwright install --with-deps chromium
- name: Start Grafana (${{ matrix.GRAFANA_IMAGE.name }}:${{ matrix.GRAFANA_IMAGE.version }}) + Quickwit (${{ matrix.QUICKWIT_VERSION }})
run: docker compose up -d --build
env:
GRAFANA_VERSION: ${{ matrix.GRAFANA_IMAGE.version }}
GRAFANA_IMAGE: ${{ matrix.GRAFANA_IMAGE.name }}
QUICKWIT_VERSION: ${{ matrix.QUICKWIT_VERSION }}
- name: Wait for Grafana and Quickwit to start
run: |
timeout 60 bash -c 'until curl -sf http://localhost:3000/api/health; do sleep 2; done' || { docker compose logs grafana; exit 1; }
timeout 60 bash -c 'until curl -sf http://localhost:7280/health/readyz; do sleep 2; done' || { docker compose logs quickwit; exit 1; }
- name: Run e2e tests
run: npm run e2e
- name: Stop Grafana
if: always()
run: docker compose down