DashboardNewLayouts: Add e2e workflow for dashboardNewLayouts (#104995)

* rename dashboard new layouts e2e path for clarity

* add workflow for dashboardNewLayouts e2e

* adjust workflow error

* remove forced fail from workflow

* formatting
This commit is contained in:
Sergej-Vlasov
2025-05-07 15:27:53 +01:00
committed by GitHub
parent 750b90e756
commit 60ea65ca69
8 changed files with 68 additions and 5 deletions
@@ -0,0 +1,62 @@
name: Run e2e for dashboardNewLayouts
on:
pull_request:
branches:
- '**'
paths:
- 'e2e/dashboard-new-layouts/**'
- 'public/app/features/dashboard-scene/**'
env:
ARCH: linux-amd64
jobs:
dashboard-new-layouts-e2e:
runs-on: ubuntu-latest
continue-on-error: true
if: github.event.pull_request.draft == false
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Pin Go version to mod file
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- run: go version
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'yarn'
- name: Install dependencies
run: yarn install --immutable
- name: Build grafana
run: make build
- name: Install Cypress dependencies
uses: cypress-io/github-action@108b8684ae52e735ff7891524cbffbcd4be5b19f
with:
runTests: false
- name: Run dashboardNewLayouts e2e
run: yarn e2e:dashboard-new-layouts
- name: Post PR comment on fail
uses: actions/github-script@v7
if: failure()
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const prNumber = context.payload.pull_request.number;
const runId = context.runId;
const repoUrl = `https://github.com/${context.repo.owner}/${context.repo.repo}`;
const runUrl = `${repoUrl}/actions/runs/${runId}`;
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: prNumber,
body: `⚠️ E2E workflow for dashboardNewLayouts has failed. [Click here to view the run](${runUrl}).`
});
- name: Always succeed # This is a workaround to make the job pass even if the previous step fails
if: failure()
run: exit 0