Skip to content

feat(ApiClient): Support multiple data sources #5

feat(ApiClient): Support multiple data sources

feat(ApiClient): Support multiple data sources #5

Workflow file for this run

name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
backend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Go environment
if: steps.check-for-backend.outputs.has-backend == 'true'
uses: actions/setup-go@v4
with:
go-version: '1.19'
- name: Install Mage
uses: magefile/mage-action@v3
with:
version: latest
install-only: true
- name: Test backend
if: steps.check-for-backend.outputs.has-backend == 'true'
run: mage coverage
- name: Build backend (linux only)
run: mage build:linux
- uses: actions/upload-artifact@v4
if: always()
with:
name: build-backend
path: dist
retention-days: 1
frontend:
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 --frozen-lockfile
# lint
- name: Check TS types
run: yarn typecheck
- name: Lint
run: yarn lint
- name: Unit tests
run: yarn test:ci
- name: Report test coverage
uses: MishaKav/[email protected]
with:
title: Unit test coverage
- name: Build frontend
run: yarn build
- uses: actions/upload-artifact@v4
if: always()
with:
name: build-frontend
path: dist
retention-days: 1
end-to-end:
runs-on: ubuntu-latest
timeout-minutes: 15
needs: [backend, frontend]
steps:
- uses: actions/checkout@v4
- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'yarn'
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
pattern: build-*
merge-multiple: true
path: dist
- name: Make backend build executable
run: chmod +x dist/gpx_pyroscope_app_*
# e2e tests
- name: Start Grafana server
run: yarn e2e:ci:server:up
- name: Prepare e2e tests
run: yarn e2e:ci:prepare
# commented to save time during the build (building this action takes ~30s)
# the next step "Prepare e2e test" takes ~20s, which gives us the time needed
# uncomment it if you experience flakiness
# - uses: cygnetdigital/[email protected]
# with:
# url: 'http://localhost:3000/a/grafana-pyroscope-app/single'
# responseCode: '200'
# timeout: 20000
# interval: 500
- name: Launch e2e tests
run: yarn e2e:ci
- name: Stop Grafana server
run: yarn e2e:ci:server:down
- uses: actions/upload-artifact@v4
if: always()
with:
name: e2e-test-reports-and-results
path: |
e2e/test-reports
e2e/test-results
retention-days: 15