Repository navigation
91 lines (79 loc) · 2.7 KB
/
Copy pathvalidate-backend-e2e.yml
File metadata and controls
91 lines (79 loc) · 2.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
name: Validate Backend Browser E2E
run-name: Browser E2E @ ${{ github.event.pull_request.head.sha || github.sha }}
on:
push:
branches:
- main
paths:
- ".github/workflows/validate-backend-e2e.yml"
- "backend/**"
- "frontend/**"
- "package.json"
- "package-lock.json"
pull_request:
paths:
- ".github/workflows/validate-backend-e2e.yml"
- "backend/**"
- "frontend/**"
- "package.json"
- "package-lock.json"
workflow_dispatch:
permissions:
contents: read
# main must always get a completed run. Many sessions push to main, so a
# cancelling group never finished there. Without cancel-in-progress the
# running main build finishes, and GitHub keeps only the newest pending run
# behind it: at most one running and one waiting, which batches the pushes
# in between. Pull request branches still cancel superseded runs.
concurrency:
group: dataops-backend-e2e-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
browser-e2e:
name: Validate backend browser flows
runs-on: ubuntu-24.04
timeout-minutes: 45
env:
DTC_AUTH_HOME: ${{ github.workspace }}/.tmp/shared-auth
steps:
- name: Check out repository
uses: actions/checkout@v6
- name: Check out shared CLI device-login loop
uses: actions/checkout@v6
with:
repository: DataTalksClub/auth
ref: d286b5cc24fa37a6a6f1e312c770a46bc248063d
path: .tmp/shared-auth
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version-file: ".node-version"
cache: npm
cache-dependency-path: package-lock.json
- name: Install Node workspace dependencies
run: npm ci
- name: Install backend Playwright Chromium
run: npm exec --workspace dataops-backend -- playwright install --with-deps chromium
- name: Run backend Playwright E2E
run: npm --prefix backend run test:e2e
- name: Record tested commit
if: always()
env:
TESTED_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
JOB_STATUS: ${{ job.status }}
run: |
{
echo "### Browser E2E: ${JOB_STATUS}"
echo
echo "Tested commit: \`${TESTED_SHA}\` (${GITHUB_REF_NAME}, ${GITHUB_EVENT_NAME})"
} >> "$GITHUB_STEP_SUMMARY"
- name: Upload backend Playwright artifacts
if: failure()
uses: actions/upload-artifact@v4
with:
name: backend-playwright-artifacts
path: |
backend/playwright-report/
backend/test-results/
if-no-files-found: ignore
retention-days: 7