|
14 | 14 | jobs: |
15 | 15 | build: |
16 | 16 | runs-on: ubuntu-latest |
| 17 | + outputs: |
| 18 | + e2e-matrix: ${{ steps.resolve-versions.outputs.matrix }} |
17 | 19 | steps: |
18 | 20 | - uses: actions/checkout@v6 |
19 | 21 | - name: Setup Node.js environment |
|
22 | 24 | node-version: '22' |
23 | 25 | cache: 'npm' |
24 | 26 |
|
| 27 | + - name: Cache node_modules for future jobs |
| 28 | + uses: actions/cache@v4 |
| 29 | + with: |
| 30 | + path: node_modules |
| 31 | + key: node-modules-${{ hashFiles('package-lock.json') }} |
| 32 | + |
25 | 33 | - name: Install dependencies |
26 | 34 | run: npm ci |
27 | 35 |
|
|
34 | 42 | - name: Build frontend |
35 | 43 | run: npm run build |
36 | 44 |
|
37 | | - - name: Start grafana docker |
38 | | - run: docker compose up -d |
39 | | - |
40 | | - - name: Run e2e tests |
41 | | - run: npm run e2e |
42 | | - |
43 | | - - name: Stop grafana docker |
44 | | - run: docker compose down |
45 | | - |
46 | 45 | - name: Check for backend |
47 | 46 | id: check-for-backend |
48 | 47 | run: | |
|
70 | 69 | with: |
71 | 70 | version: latest |
72 | 71 | args: buildAll |
| 72 | + |
| 73 | + - name: Upload build artifact |
| 74 | + uses: actions/upload-artifact@v4 |
| 75 | + with: |
| 76 | + name: dist |
| 77 | + path: dist/ |
| 78 | + |
| 79 | + - name: Resolve Grafana E2E versions |
| 80 | + id: resolve-versions |
| 81 | + uses: grafana/plugin-actions/e2e-version@e2e-version/v1.2.1 |
| 82 | + with: |
| 83 | + skip-grafana-react-19-preview-image: false |
| 84 | + |
| 85 | + e2e: |
| 86 | + runs-on: ubuntu-latest |
| 87 | + timeout-minutes: 15 |
| 88 | + needs: build |
| 89 | + strategy: |
| 90 | + fail-fast: false |
| 91 | + matrix: |
| 92 | + GRAFANA_IMAGE: ${{ fromJson(needs.build.outputs.e2e-matrix) }} |
| 93 | + QUICKWIT_VERSION: [edge] |
| 94 | + steps: |
| 95 | + - uses: actions/checkout@v6 |
| 96 | + |
| 97 | + - name: Download build artifact |
| 98 | + uses: actions/download-artifact@v4 |
| 99 | + with: |
| 100 | + name: dist |
| 101 | + path: dist/ |
| 102 | + |
| 103 | + - name: Restore executable permissions |
| 104 | + run: chmod +x dist/gpx_quickwit_* |
| 105 | + |
| 106 | + - name: Setup Node.js environment |
| 107 | + uses: actions/setup-node@v6 |
| 108 | + with: |
| 109 | + node-version: '22' |
| 110 | + |
| 111 | + - name: Restore node_modules |
| 112 | + uses: actions/cache/restore@v4 |
| 113 | + with: |
| 114 | + path: node_modules |
| 115 | + key: node-modules-${{ hashFiles('package-lock.json') }} |
| 116 | + |
| 117 | + - name: Install Playwright |
| 118 | + run: npx playwright install --with-deps chromium |
| 119 | + |
| 120 | + - name: Start Grafana (${{ matrix.GRAFANA_IMAGE.name }}:${{ matrix.GRAFANA_IMAGE.version }}) + Quickwit (${{ matrix.QUICKWIT_VERSION }}) |
| 121 | + run: docker compose up -d --build |
| 122 | + env: |
| 123 | + GRAFANA_VERSION: ${{ matrix.GRAFANA_IMAGE.version }} |
| 124 | + GRAFANA_IMAGE: ${{ matrix.GRAFANA_IMAGE.name }} |
| 125 | + QUICKWIT_VERSION: ${{ matrix.QUICKWIT_VERSION }} |
| 126 | + |
| 127 | + - name: Wait for Grafana and Quickwit to start |
| 128 | + run: | |
| 129 | + timeout 60 bash -c 'until curl -sf http://localhost:3000/api/health; do sleep 2; done' || { docker compose logs grafana; exit 1; } |
| 130 | + timeout 60 bash -c 'until curl -sf http://localhost:7280/health/readyz; do sleep 2; done' || { docker compose logs quickwit; exit 1; } |
| 131 | +
|
| 132 | + - name: Run e2e tests |
| 133 | + run: npm run e2e |
| 134 | + |
| 135 | + - name: Stop Grafana |
| 136 | + if: always() |
| 137 | + run: docker compose down |
0 commit comments