-
Notifications
You must be signed in to change notification settings - Fork 1
70 lines (55 loc) · 1.72 KB
/
build_and_test.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
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
name: Build and test
on:
push:
branches-ignore:
- release
jobs:
build_and_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use LTS node
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
- uses: pnpm/action-setup@v3
- name: Get pnpm cache directory path
id: nodejs-deps-cache-dir-path
run: echo "::set-output name=dir::$(corepack pnpm store path)"
- uses: actions/cache@v4
name: Caching Node.js dependencies
id: nodejs-deps-cache
with:
path: ${{ steps.nodejs-deps-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-pnpm-v1-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-v1
- uses: actions/cache@v4
name: Caching Gatsby
with:
path: .cache
key: ${{ runner.os }}-gatsby-cache-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-gatsby-cache
- name: Install
run: corepack pnpm install --frozen-lockfile
- name: Install Playwright Browsers
run: corepack pnpm exec playwright install --with-deps
- name: Lint
run: corepack pnpm lint
- name: Build
run: corepack pnpm build
- name: Test
run: corepack pnpm test
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30
- name: Deploying master branch
if: github.ref == 'refs/heads/master'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
corepack pnpm run deploy