-
-
Notifications
You must be signed in to change notification settings - Fork 3
141 lines (127 loc) · 4.08 KB
/
Copy pathangular-tests.yml
File metadata and controls
141 lines (127 loc) · 4.08 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
name: Angular Tests
on:
push:
branches:
- '**'
paths:
- 'src/**'
- 'api/**'
- 'middleware.ts'
- 'generate-env.js'
- 'scripts/**'
- 'vercel.json'
- 'package.json'
- 'pnpm-lock.yaml'
- 'pnpm-workspace.yaml'
- '.node-version'
- 'angular.json'
- 'tsconfig*.json'
- '.github/workflows/angular-tests.yml'
pull_request:
paths:
- 'src/**'
- 'api/**'
- 'middleware.ts'
- 'generate-env.js'
- 'scripts/**'
- 'vercel.json'
- 'package.json'
- 'pnpm-lock.yaml'
- 'pnpm-workspace.yaml'
- '.node-version'
- 'angular.json'
- 'tsconfig*.json'
- '.github/workflows/angular-tests.yml'
workflow_dispatch:
concurrency:
group: angular-tests-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
env:
CI: true
COREPACK_ENABLE_DOWNLOAD_PROMPT: '0'
HUSKY: '0'
defaults:
run:
shell: bash
jobs:
tests:
name: ${{ matrix.name }}
runs-on: ubuntu-latest
timeout-minutes: 12
strategy:
fail-fast: false
matrix:
include:
- name: Lint
cache_scope: lint
cache_angular: true
command: pnpm run lint
- name: Stylelint
cache_scope: stylelint
cache_angular: false
command: pnpm run lint:styles
- name: Unit tests
cache_scope: unit-tests
cache_angular: true
command: pnpm run ci
- name: Function tests
cache_scope: function-tests
cache_angular: false
command: pnpm run test:functions
- name: Production build + smoke
cache_scope: production-build-smoke
cache_angular: true
supabase_url: https://ci.supabase.invalid
supabase_anon_key: ci-test-anon-key
command: pnpm run build && pnpm run check:bundle && pnpm run test:e2e:prod:run
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup PNPM
uses: pnpm/action-setup@v4
with:
version: 10.0.0
run_install: false
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.node-version'
cache: pnpm
cache-dependency-path: pnpm-lock.yaml
- name: Install dependencies
run: pnpm install --frozen-lockfile --prefer-offline
- name: Generate environment files
run: node generate-env.js
env:
SUPABASE_URL: ${{ secrets.SUPABASE_URL }}
SUPABASE_ANON_KEY: ${{ secrets.SUPABASE_ANON_KEY }}
- name: Cache Angular build data
if: matrix.cache_angular
uses: actions/cache@v4
with:
path: .angular/cache
key: angular-${{ runner.os }}-node-${{ hashFiles('.node-version') }}-${{ matrix.cache_scope }}-${{ hashFiles('angular.json', 'tsconfig*.json', 'package.json', 'pnpm-lock.yaml') }}
restore-keys: |
angular-${{ runner.os }}-node-${{ hashFiles('.node-version') }}-${{ matrix.cache_scope }}-
angular-${{ runner.os }}-node-${{ hashFiles('.node-version') }}-
- name: Cache Playwright browsers
if: matrix.name == 'Production build + smoke'
uses: actions/cache@v4
with:
path: ~/.cache/ms-playwright
key: playwright-${{ runner.os }}-node-${{ hashFiles('.node-version') }}-${{ hashFiles('package.json', 'pnpm-lock.yaml') }}
restore-keys: |
playwright-${{ runner.os }}-node-${{ hashFiles('.node-version') }}-
playwright-${{ runner.os }}-
- name: Install Playwright Chromium
if: matrix.name == 'Production build + smoke'
# Skip --with-deps: ubuntu-latest already has Chromium's system libs,
# and --with-deps shells out to apt-get for another ~30s.
run: pnpm exec playwright install chromium
- name: Run checks
run: ${{ matrix.command }}
env:
SUPABASE_URL: ${{ matrix.supabase_url }}
SUPABASE_ANON_KEY: ${{ matrix.supabase_anon_key }}