File tree 1 file changed +16
-9
lines changed
1 file changed +16
-9
lines changed Original file line number Diff line number Diff line change @@ -30,28 +30,35 @@ jobs:
30
30
- name : Check for changes in ${{ matrix.project }}
31
31
id : changes
32
32
run : |
33
- if git diff --name-only origin/$BASE_BRANCH HEAD | grep -q "^${{ matrix.project }}/"; then
34
- echo "changed=true" >> $GITHUB_ENV
35
- else
36
- echo "changed=false" >> $GITHUB_ENV
37
- fi
33
+ if ! git diff --name-only origin/$BASE_BRANCH HEAD | grep -q "^${{ matrix.project }}/"; then
34
+ echo "No changes in ${{ matrix.project }}, exiting job."
35
+ exit 0
36
+
37
+ - name : Set up Node.js
38
+ uses : actions/setup-node@v3
39
+ with :
40
+ node-version : ' 20'
41
+
42
+ - name : Cache dependencies for ${{ matrix.project }}
43
+ uses : actions/cache@v3
44
+ with :
45
+ path : ${{ matrix.project }}/node_modules
46
+ key : ${{ runner.os }}-yarn-${{ hashFiles(format('{0}/yarn.lock', matrix.project)) }}
47
+ restore-keys : |
48
+ ${{ runner.os }}-yarn-
38
49
39
50
- name : Install Dependencies for ${{ matrix.project }}
40
- if : env.changed == 'true'
41
51
run : yarn install
42
52
working-directory : ${{ matrix.project }}
43
53
44
54
- name : Lint ${{ matrix.project }}
45
- if : env.changed == 'true'
46
55
run : yarn format-check
47
56
working-directory : ${{ matrix.project }}
48
57
49
58
- name : Build ${{ matrix.project }}
50
- if : env.changed == 'true'
51
59
run : yarn build
52
60
working-directory : ${{ matrix.project }}
53
61
54
62
- name : Test ${{ matrix.project }}
55
- if : env.changed == 'true'
56
63
run : yarn test
57
64
working-directory : ${{ matrix.project }}
You can’t perform that action at this time.
0 commit comments