Repository navigation
132 lines (119 loc) · 4.92 KB
/
Copy pathcompat.yml
File metadata and controls
132 lines (119 loc) · 4.92 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
name: Angular compatibility
on:
push:
branches: [main]
schedule:
- cron: '0 6 * * 1'
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
page-side:
name: Angular ${{ matrix.angular }} on Node.js 22
runs-on: ubuntu-latest
timeout-minutes: 15
# The prerelease entry reports a private API rename early without failing the run.
continue-on-error: ${{ matrix.prerelease == true }}
strategy:
fail-fast: false
matrix:
# The oldest supported minor of each tested major, then each current major. The tests run
# on Node.js 22 for every version: they load Angular in jsdom, not through its CLI.
include:
- angular: '12.2'
range: '~12.2.0'
# Angular 12 ships View Engine bundles that its CLI compiles for Ivy with ngcc.
ngcc: true
- angular: '15.2'
range: '~15.2.0'
- angular: '17.3'
range: '~17.3.0'
- angular: '19.2'
range: '~19.2.0'
- angular: '20.0'
range: '~20.0.0'
# The last 20.x minor. Several debug APIs arrive within 20.x (`ɵgetTransferState` in 20.2,
# `ɵgetRouterInstance` in 20.3.5), and resource internals have no debug names until
# 21.0.1, so the folded resources test is skipped here and the unfolded case runs instead.
- angular: '20.3'
range: '~20.3.0'
- angular: '21'
range: '^21.0.0'
- angular: '22'
range: '^22.0.0'
- angular: 'next'
range: 'next'
prerelease: true
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- uses: ./.github/actions/setup
with:
node-version: 22
- name: Install Angular ${{ matrix.angular }}
env:
RANGE: ${{ matrix.range }}
# ngcc rewrites the installed files in place, so they are copied rather than linked to
# the pnpm store.
IMPORT_METHOD: ${{ matrix.ngcc && 'copy' || 'auto' }}
run: |
{
echo 'overrides:'
for pkg in animations common compiler core elements forms platform-browser platform-browser-dynamic platform-server router; do
echo " '@angular/$pkg': '$RANGE'"
done
} >> pnpm-workspace.yaml
pnpm install --no-frozen-lockfile --config.package-import-method="$IMPORT_METHOD"
- name: Compile Angular ${{ matrix.angular }} for Ivy
if: matrix.ngcc
run: |
version=$(node -p "require('@angular/core/package.json').version")
npm install --prefix "$RUNNER_TEMP/ngcc" --no-audit --no-fund --no-save \
"@angular/compiler-cli@$version" "@angular/compiler@$version" "@angular/core@$version" \
typescript@~4.3.5 rxjs@~7.8.0 zone.js@~0.11.4
# Each package's folder in the pnpm store links its dependencies. A package is compiled
# after the ones it depends on, so core and common go first.
for pkg in core common compiler platform-browser platform-browser-dynamic platform-server forms router elements animations; do
for dir in node_modules/.pnpm/@angular+"$pkg"@"$version"*/node_modules; do
[ -d "$dir" ] || continue
"$RUNNER_TEMP/ngcc/node_modules/.bin/ngcc" --source "$PWD/$dir" --properties main es2015 module --first-only
done
done
- name: List the versions under test
run: |
{
echo "- Node.js $(node --version)"
for pkg in core common router forms platform-browser; do
echo "- @angular/$pkg $(node -p "require('@angular/$pkg/package.json').version")"
done
} | tee -a "$GITHUB_STEP_SUMMARY"
- name: Test the page side
run: pnpm exec vitest run --root packages/devtools --config vitest.compat.config.ts
vite:
name: Vite ${{ matrix.vite }}
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
# The `vite` peer range is `>=6`; the workspace installs the newest major.
vite: ['6', '7']
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- uses: ./.github/actions/setup
- name: Install Vite ${{ matrix.vite }}
env:
VITE_MAJOR: ${{ matrix.vite }}
# Only this job's copy of the workspace changes; the committed lockfile stays as it is.
run: |
printf "\noverrides:\n vite: '^%s.0.0'\n" "$VITE_MAJOR" >> pnpm-workspace.yaml
pnpm install --no-frozen-lockfile
echo "- vite $(node -p "require('vite/package.json').version")" | tee -a "$GITHUB_STEP_SUMMARY"
- name: Test the Vite plugin
run: pnpm exec vitest run --root packages/devtools src/__tests__/vite- src/__tests__/lan-address.test.ts