Repository navigation
127 lines (103 loc) · 3.59 KB
/
Copy pathmain.yaml
File metadata and controls
127 lines (103 loc) · 3.59 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
name: Main
on: push
permissions:
contents: read
jobs:
checks:
runs-on: ubuntu-latest
name: ${{ matrix.script-name }}
strategy:
fail-fast: false
matrix:
script-name: [lint, build]
steps:
- name: Checkout the repo
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Cache node modules
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Setup node
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version-file: package.json
- name: Install dependencies
run: npm ci
- name: Running ${{ matrix.script-name }}
run: npm run ${{ matrix.script-name }}
env:
# The build has no Firestore to read content from, so it builds the pages without content.
FIRESTORE_TARGET: none
test-project:
runs-on: ubuntu-latest
name: test (${{ matrix.project }})
strategy:
fail-fast: false
matrix:
project: [Web, Server, Hydration, Functions, CLI, Firestore, Translations]
steps:
- name: Checkout the repo
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Cache node modules
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Setup node
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version-file: package.json
- name: Setup Java (required by the Firestore emulator)
if: matrix.project == 'Firestore'
uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6 # v6.0.1
with:
distribution: temurin
java-version: '21'
- name: Install dependencies
run: npm ci
- name: Running ${{ matrix.project }} tests
run: npx vitest run --project ${{ matrix.project }}
# Builds the site with each feature off, and builds a minimal site.
smoke:
runs-on: ubuntu-latest
name: smoke
steps:
- name: Checkout the repo
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Cache node modules
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Setup node
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version-file: package.json
- name: Install dependencies
run: npm ci
- name: Running smoke tests
run: npx vitest run --project 'Smoke*'
# One required check that passes only when every test project and the smoke tests pass.
test:
runs-on: ubuntu-latest
name: test
needs: [test-project, smoke]
if: always()
steps:
- name: Check test results
run: |
test "${{ needs.test-project.result }}" = success
test "${{ needs.smoke.result }}" = success