-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (74 loc) · 2.72 KB
/
ci.yml
File metadata and controls
90 lines (74 loc) · 2.72 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
name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
dependency-guard:
name: Dependency Guard + Clean Install
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'npm'
- name: Verify Dependency Integrity (Pre-Install)
run: npm run check:deps
- name: Clean Install
run: npm ci
- name: Verify Dependency Integrity (Post-Install)
run: npm run check:deps
- name: Configure Git User
run: |
# Redirect global git config to a file in /tmp to avoid polluting the host system
# and ensure we have write permissions regardless of the workspace setup.
touch /tmp/.gitconfig_ci
echo "GIT_CONFIG_GLOBAL=/tmp/.gitconfig_ci" >> $GITHUB_ENV
export GIT_CONFIG_GLOBAL="/tmp/.gitconfig_ci"
git config --global user.email "ci@git-cms.local"
git config --global user.name "CI Bot"
git config --global init.defaultBranch main
- name: Run Local Integration Tests
run: npm run test:local
unit-test:
name: Unit Tests (Docker)
runs-on: ubuntu-latest
needs: dependency-guard
steps:
- uses: actions/checkout@v4
- name: Run Unit Tests
run: ./test/run-docker.sh
e2e-test:
name: E2E Tests (Playwright)
runs-on: ubuntu-latest
needs: dependency-guard
container:
image: mcr.microsoft.com/playwright:v1.57.0-jammy
steps:
# Git is required in the container to perform plumbing operations during E2E tests.
# Installing it BEFORE checkout ensures actions/checkout performs a real clone.
- name: Install Git
run: apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/*
- uses: actions/checkout@v4
- name: Configure Git User
run: |
# Redirect global git config to a file in /tmp to avoid polluting the host system
# and ensure we have write permissions regardless of the workspace setup.
touch /tmp/.gitconfig_ci
echo "GIT_CONFIG_GLOBAL=/tmp/.gitconfig_ci" >> $GITHUB_ENV
export GIT_CONFIG_GLOBAL="/tmp/.gitconfig_ci"
git config --global user.email "ci@git-cms.local"
git config --global user.name "CI Bot"
git config --global init.defaultBranch main
- name: Install Dependencies
run: npm ci
- name: Run Playwright Tests
run: npm run test:e2e
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30