Skip to content

Commit

Permalink
switch to playwright
Browse files Browse the repository at this point in the history
  • Loading branch information
briangann committed Mar 29, 2024
1 parent cca94bf commit ddb5f76
Showing 1 changed file with 32 additions and 29 deletions.
61 changes: 32 additions & 29 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,35 +63,6 @@ jobs:
version: latest
args: buildAll

- name: Check for E2E
id: check-for-e2e
run: |
if [ -d "cypress" ]
then
echo "has-e2e=true" >> $GITHUB_OUTPUT
fi
- name: Start grafana docker
if: steps.check-for-e2e.outputs.has-e2e == 'true'
run: docker-compose up -d

- name: Run e2e tests
id: run-e2e-tests
if: steps.check-for-e2e.outputs.has-e2e == 'true'
run: npm run e2e

- name: Stop grafana docker
if: steps.check-for-e2e.outputs.has-e2e == 'true'
run: docker-compose down

- name: Archive E2E output
uses: actions/upload-artifact@v4
if: steps.check-for-e2e.outputs.has-e2e == 'true' && steps.run-e2e-tests.outcome != 'success'
with:
name: cypress-videos
path: cypress/videos
retention-days: 5

- name: Warn missing Grafana access policy token
run: |
echo Please generate a Grafana access policy token: https://grafana.com/developers/plugin-tools/publish-a-plugin/sign-a-plugin#generate-an-access-policy-token
Expand Down Expand Up @@ -157,3 +128,35 @@ jobs:
./ccbin/cc-test-reporter sum-coverage out/codeclimate.*.json -d -p 1 -o out/codeclimate.total.json
./ccbin/cc-test-reporter upload-coverage -i out/codeclimate.total.json
- name: E2E - Check for playwright
id: e2e-check-for-playwright
run: |
if [ -d "playwright" ]
then
echo "has-e2e-playwright=true" >> $GITHUB_OUTPUT
fi
- name: E2E - Start Grafana in Docker
if: steps.e2e-check-for-playwright.outputs.has-e2e-playwright == 'true'
run: docker-compose up -d

- name: E2E - Install playwright dependencies
if: steps.e2e-check-for-playwright.outputs.has-e2e-playwright == 'true'
run: sudo apt-get update && yarn playwright install --with-deps

- name: E2E - Run tests
id: e2e-run-tests
if: steps.e2e-check-for-playwright.outputs.has-e2e-playwright == 'true'
run: yarn run e2e:playwright

- name: E2E - Stop Grafana in Docker
if: steps.e2e-check-for-playwright.outputs.has-e2e-playwright == 'true'
run: docker-compose down

- name: E2E - Archive output
uses: actions/upload-artifact@v4
if: steps.e2e-check-for-playwright.outputs.has-e2e-playwright == 'true'
with:
name: playwright-report
path: playwright-report/
retention-days: 30

0 comments on commit ddb5f76

Please sign in to comment.