-
Notifications
You must be signed in to change notification settings - Fork 14
117 lines (117 loc) · 4.64 KB
/
Copy pathtest.yaml
File metadata and controls
117 lines (117 loc) · 4.64 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
name: Test
on:
# Ensure GitHub actions are not run twice for same commits
push:
branches: [main]
pull_request:
types: [opened, synchronize, reopened]
branches:
- '**'
- '!release-please--**'
merge_group:
jobs:
test:
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
node-version: ['24']
# `node-install-version` is what `setup-node` actually installs.
# `node-version` is the display value used in the matrix job name
# (which required status checks are pinned to), so it must stay stable.
node-install-version: ['24.15.0']
include:
- os: ubuntu-latest
# Many of our dependencies require 20.6.0, so we use the same minimum.
# But there is a blocking bug in 20.6.0, fixed in 20.6.1:
# https://github.com/nuxt/nuxt/issues/23020#issuecomment-1719828889
node-version: '20.6.1'
node-install-version: '20.6.1'
fail-fast: false
steps:
# Increasing the maximum number of open files. See:
# https://github.com/actions/virtual-environments/issues/268
- name: Increase open file limit
run: sudo ulimit -Sn 65536
if: "${{ matrix.os == 'macOS-latest' }}"
- run: git config --global core.symlinks true
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Node.js ${{ matrix.node-install-version }}
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-install-version }}
cache: 'npm'
# Use npm@10 on Node 22+ due to https://github.com/npm/cli/issues/8489
- name: Setup npm version
run: npm install -g npm@10
if: "${{ matrix.node-version == '24' }}"
- name: Setup Deno
uses: denoland/setup-deno@v1
with:
deno-version: 2.9.0
- name: Setup Deno dependencies
run: deno cache https://deno.land/x/eszip@v0.55.2/eszip.ts
- name: Install dependencies
run: npm ci
- name: Install playwright browsers
run: npx playwright install --with-deps chromium
- name: Build
run: npm run build --workspaces=true
# Fork PRs don't have access to secrets, so live E2E tests (e.g. Netlify
# deploy tests) must be skipped.
- name: Flag fork PR
if:
${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name !=
'netlify/primitives' }}
run: echo "SKIP_LIVE_TESTS=true" >> "$GITHUB_ENV"
- name: Tests
run: npm run test --workspaces=true
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
- name: Warn if live tests were skipped
if: ${{ env.SKIP_LIVE_TESTS == 'true' }}
run: |
echo "::warning::Live E2E tests were skipped because secrets are not available (likely a fork PR)."
echo "## ⚠️ Live E2E tests were skipped" >> "$GITHUB_STEP_SUMMARY"
echo "" >> "$GITHUB_STEP_SUMMARY"
echo "This workflow run does not have access to secrets (likely a fork PR)." >> "$GITHUB_STEP_SUMMARY"
echo "Live tests that deploy to Netlify were skipped." >> "$GITHUB_STEP_SUMMARY"
echo "Maintainers: before merging, verify that these tests pass or aren't relevant." >> "$GITHUB_STEP_SUMMARY"
test-node18:
name: Test Node.js 18 for specific packages
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
fail-fast: false
steps:
- run: git config --global core.symlinks true
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Node.js 18.14.0
uses: actions/setup-node@v6
with:
node-version: 18.14.0
cache: 'npm'
- name: Setup Deno
uses: denoland/setup-deno@v1
with:
deno-version: 2.9.0
- name: Setup Deno dependencies
run: deno cache https://deno.land/x/eszip@v0.55.2/eszip.ts
- name: Install dependencies
run: npm ci
- name: Build
# NOTE: These are run in the specified order, so they must be in topological order
run: >-
npm run build -w ./packages/types -w ./packages/dev-utils -w ./packages/runtime-utils -w ./packages/otel -w
./packages/blobs -w ./packages/edge-functions -w ./packages/functions
- name: Tests
run: >-
npm run test -w ./packages/types -w ./packages/dev-utils -w ./packages/runtime-utils -w ./packages/otel -w
./packages/blobs -w ./packages/edge-functions -w ./packages/functions