-
Notifications
You must be signed in to change notification settings - Fork 0
96 lines (91 loc) · 2.39 KB
/
build-lint-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
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
name: Build, Lint, and Test
on:
workflow_call:
jobs:
prepare:
name: Prepare
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: 'yarn'
- name: Install Yarn dependencies
run: yarn --immutable
build:
name: Build
runs-on: ubuntu-latest
needs:
- prepare
steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: 'yarn'
- run: yarn --immutable --immutable-cache
- run: yarn build
- name: Cache snap build
uses: actions/cache@v3
with:
path: ./packages/snap/dist
key: snap-${{ runner.os }}-${{ github.sha }}
- name: Require clean working directory
shell: bash
run: |
if ! git diff --exit-code; then
echo "Working tree dirty at end of job"
exit 1
fi
lint:
name: Lint
runs-on: ubuntu-latest
needs:
- prepare
steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: 'yarn'
- run: yarn --immutable --immutable-cache
- run: yarn lint
- name: Require clean working directory
shell: bash
run: |
if ! git diff --exit-code; then
echo "Working tree dirty at end of job"
exit 1
fi
# e2e-test:
# name: End-to-end Test
# runs-on: ubuntu-latest
# needs:
# - prepare
# - build
# steps:
# - uses: actions/checkout@v3
# - name: Use Node.js
# uses: actions/setup-node@v3
# with:
# node-version-file: '.nvmrc'
# cache: 'yarn'
# - name: Restore snap build cache
# uses: actions/cache@v3
# with:
# path: ./packages/snap/dist
# key: snap-${{ runner.os }}-${{ github.sha }}
# - run: yarn install --immutable
# - name: Run e2e tests
# run: yarn workspace snap run test
# - name: Require clean working directory
# shell: bash
# run: |
# if ! git diff --exit-code; then
# echo "Working tree dirty at end of job"
# exit 1
# fi