-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (79 loc) · 2.38 KB
/
Copy pathci.yml
File metadata and controls
82 lines (79 loc) · 2.38 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
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
# Always try to output colored text.
FORCE_COLOR: 1
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: latest
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: lts/*
cache: pnpm
# Put Chrome installed by Puppeteer inside the pnpm store so it gets
# cached.
- name: Set PUPPETEER_CACHE_DIR
shell: bash
run: echo "PUPPETEER_CACHE_DIR=$(pnpm store path)" >> $GITHUB_ENV
- name: Install dependencies
run: pnpm install
# Install Chrome even if it's not needed for this job so it can be cached
# for other jobs.
- name: Install Chrome
run: pnpm install-chrome-for-puppeteer
- name: Lint files
run: pnpm lint
test:
name: Test on ${{ matrix.os }} using Node.js v${{ matrix.node }}
needs: lint
continue-on-error: true
strategy:
matrix:
os: [windows-latest, macos-latest, ubuntu-latest]
# This should also include Node.js v20, but snapshot testing is only
# available in Node.js v22.3 or later.
node: [22, 24, 25]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: latest
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node }}
cache: pnpm
# Put Chrome installed by Puppeteer inside the pnpm store so it gets
# cached.
- name: Set PUPPETEER_CACHE_DIR
shell: bash
run: echo "PUPPETEER_CACHE_DIR=$(pnpm store path)" >> $GITHUB_ENV
- name: Install dependencies
run: pnpm install
- name: Install Chrome
run: pnpm install-chrome-for-puppeteer
# Prevent `No usable sandbox!` error on Ubuntu. See:
# https://github.com/puppeteer/puppeteer/issues/13595
- name: Disable AppArmor
if: ${{ matrix.os == 'ubuntu-latest' }}
run:
echo 0 | sudo tee
/proc/sys/kernel/apparmor_restrict_unprivileged_userns
- name: Run tests
run: pnpm test