1
- # This workflow performs basic checks:
2
- #
3
- # 1. run a preparation step to install and cache node modules
4
- # 2. once prep succeeds, lint and test run in parallel
5
- #
6
- # The checks only run on non-draft Pull Requests. They don't run on the main
7
- # branch prior to deploy. It's recommended to use branch protection to avoid
8
- # pushes straight to 'main'.
9
-
10
1
name : Checks
11
2
12
3
on :
19
10
20
11
env :
21
12
NODE : 18
13
+ WORKING_DIRECTORY : web-vite
22
14
23
15
jobs :
24
16
prep :
@@ -42,19 +34,19 @@ jobs:
42
34
- name : Get yarn cache directory path
43
35
id : yarn-cache-dir-path
44
36
run : echo "::set-output name=dir::$(yarn cache dir)"
45
- working-directory : web-vite
37
+ working-directory : ${{ env.WORKING_DIRECTORY }}
46
38
47
39
- uses : actions/cache@v3
48
40
id : yarn-cache
49
41
with :
50
42
path : ${{ steps.yarn-cache-dir-path.outputs.dir }}
51
- key : ${{ runner.os }}-yarn-${{ hashFiles('** /yarn.lock') }}
43
+ key : ${{ runner.os }}-yarn-${{ hashFiles('${{ env.WORKING_DIRECTORY }} /yarn.lock') }}
52
44
restore-keys : |
53
45
${{ runner.os }}-yarn-
54
46
55
47
- name : Install
56
48
run : yarn install
57
- working-directory : web-vite
49
+ working-directory : ${{ env.WORKING_DIRECTORY }}
58
50
59
51
lint :
60
52
needs : prep
@@ -72,19 +64,20 @@ jobs:
72
64
- name : Get yarn cache directory path
73
65
id : yarn-cache-dir-path
74
66
run : echo "::set-output name=dir::$(yarn cache dir)"
67
+ working-directory : ${{ env.WORKING_DIRECTORY }}
75
68
76
69
- uses : actions/cache@v3
77
70
id : yarn-cache
78
71
with :
79
72
path : ${{ steps.yarn-cache-dir-path.outputs.dir }}
80
- key : ${{ runner.os }}-yarn-${{ hashFiles('** /yarn.lock') }}
73
+ key : ${{ runner.os }}-yarn-${{ hashFiles('${{ env.WORKING_DIRECTORY }} /yarn.lock') }}
81
74
restore-keys : |
82
75
${{ runner.os }}-yarn-
83
76
84
77
- name : Install
85
78
run : yarn install
86
- working-directory : web-vite
79
+ working-directory : ${{ env.WORKING_DIRECTORY }}
87
80
88
81
- name : Lint
89
82
run : yarn lint
90
- working-directory : web-vite
83
+ working-directory : ${{ env.WORKING_DIRECTORY }}
0 commit comments