-
-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (78 loc) · 2.22 KB
/
Copy pathpr-checks.yml
File metadata and controls
78 lines (78 loc) · 2.22 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
name: PR checks
on:
pull_request:
branches: [main]
push:
branches-ignore: [main]
workflow_dispatch:
concurrency:
group: "${{ github.workflow }} @ ${{ github.event.pull_request.head.ref || github.ref }}"
cancel-in-progress: true
permissions:
contents: read
jobs:
build:
name: Build
runs-on: ubuntu-latest
timeout-minutes: 5
env:
NODE_VERSION: 24
steps:
- name: Checkout repo
uses: actions/checkout@v6
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v6
with:
node-version: ${{ env.NODE_VERSION }}
- name: Cache node modules
uses: actions/cache@v5
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
run: npm ci
- name: Run builder
run: npm run build
- name: Archive build artifact
uses: actions/upload-artifact@v7
with:
name: dist
path: ${{ github.workspace }}/lib
test:
name: Test (Node ${{ matrix.node-version }})
runs-on: ubuntu-latest
timeout-minutes: 15
needs: build
strategy:
matrix:
node-version: [20, 22, 24]
env:
SERVICE_ACCOUNT: ${{ secrets.SERVICE_ACCOUNT }}
GOOGLE_APPLICATION_CREDENTIALS: ${{ github.workspace }}/serviceAccount.json
steps:
- name: Checkout repo
uses: actions/checkout@v6
- name: Download build artifact
uses: actions/download-artifact@v7
with:
name: dist
path: ${{ github.workspace }}/lib
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}
- name: Cache node modules
uses: actions/cache@v5
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
run: npm ci
- name: Write service account
run: echo "$SERVICE_ACCOUNT" > serviceAccount.json
- name: Run test
run: npm test