-
-
Notifications
You must be signed in to change notification settings - Fork 6
41 lines (38 loc) · 1.03 KB
/
ci.yml
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
name: CI
on:
push:
branches:
- main
pull_request:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- name: Get the Yarn cache path
id: yarn-cache-path
run: echo "::set-output name=path::$(yarn config get cacheFolder)"
- uses: actions/cache@v4
with:
path: ${{ steps.yarn-cache-path.outputs.path }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install packages
run: yarn install --immutable
- name: Check formatting
run: yarn run format:check
- name: Lint the code
run: yarn run lint
- name: Build the site
run: yarn run build:prod
env:
MOCK_HEADLINES: 1
- name: Serve the site
run: yarn serve dist -p 3000 &
- name: Run tests
run: yarn run test:ci
timeout-minutes: 3