Add e2e smoke tests #3
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
name: E2E tests | |
on: | |
pull_request: | |
schedule: | |
- cron: '0 11 * * *' #once a day at 11 UTC | |
permissions: | |
contents: read | |
id-token: write | |
jobs: | |
resolve-versions: | |
name: Resolve Grafana images | |
runs-on: ubuntu-latest | |
timeout-minutes: 3 | |
outputs: | |
matrix: ${{ steps.resolve-versions.outputs.matrix }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Resolve Grafana E2E versions | |
id: resolve-versions | |
uses: grafana/plugin-actions/e2e-version@main | |
with: | |
version-resolver-type: plugin-grafana-dependency | |
grafana-dependency: '>=8.5.0' | |
playwright-tests: | |
needs: resolve-versions | |
timeout-minutes: 60 | |
strategy: | |
fail-fast: false | |
matrix: | |
GRAFANA_IMAGE: ${{fromJson(needs.resolve-versions.outputs.matrix)}} | |
name: e2e ${{ matrix.GRAFANA_IMAGE.name }}@${{ matrix.GRAFANA_IMAGE.VERSION }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Node.js environment | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: .nvmrc | |
- name: Install yarn dependencies | |
run: yarn install | |
- name: Install Mage | |
uses: magefile/mage-action@v3 | |
with: | |
install-only: true | |
- name: Build binaries | |
run: mage -v build:linux | |
- name: Build frontend | |
run: yarn build | |
- name: Install Playwright Browsers | |
run: yarn playwright install --with-deps | |
- name: Start Grafana | |
run: | | |
docker compose pull | |
GRAFANA_VERSION=${{ matrix.GRAFANA_IMAGE.VERSION }} GRAFANA_IMAGE=${{ matrix.GRAFANA_IMAGE.NAME }} docker compose up -d | |
- name: Wait for grafana server | |
uses: grafana/plugin-actions/wait-for-grafana@main | |
- name: Run Playwright tests | |
id: run-tests | |
run: yarn playwright test | |
# Uncomment this step to upload the Playwright report to Github artifacts. | |
# If your repository is public, the report will be public on the Internet so beware not to expose sensitive information. | |
# - name: Upload artifacts | |
# uses: actions/upload-artifact@v4 | |
# if: ${{ (always() && steps.run-tests.outcome == 'success') || (failure() && steps.run-tests.outcome == 'failure') }} | |
# with: | |
# name: playwright-report-${{ matrix.GRAFANA_IMAGE.NAME }}-v${{ matrix.GRAFANA_IMAGE.VERSION }}-${{github.run_id}} | |
# path: playwright-report/ | |
# retention-days: 30 |