File tree 1 file changed +17
-9
lines changed
1 file changed +17
-9
lines changed Original file line number Diff line number Diff line change @@ -30,28 +30,36 @@ 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
+ fi
37
+
38
+ - name : Set up Node.js
39
+ uses : actions/setup-node@v3
40
+ with :
41
+ node-version : ' 20'
42
+
43
+ - name : Cache dependencies for ${{ matrix.project }}
44
+ uses : actions/cache@v3
45
+ with :
46
+ path : ${{ matrix.project }}/node_modules
47
+ key : ${{ runner.os }}-yarn-${{ hashFiles(format('{0}/yarn.lock', matrix.project)) }}
48
+ restore-keys : |
49
+ ${{ runner.os }}-yarn-
38
50
39
51
- name : Install Dependencies for ${{ matrix.project }}
40
- if : env.changed == 'true'
41
52
run : yarn install
42
53
working-directory : ${{ matrix.project }}
43
54
44
55
- name : Lint ${{ matrix.project }}
45
- if : env.changed == 'true'
46
56
run : yarn format-check
47
57
working-directory : ${{ matrix.project }}
48
58
49
59
- name : Build ${{ matrix.project }}
50
- if : env.changed == 'true'
51
60
run : yarn build
52
61
working-directory : ${{ matrix.project }}
53
62
54
63
- name : Test ${{ matrix.project }}
55
- if : env.changed == 'true'
56
64
run : yarn test
57
65
working-directory : ${{ matrix.project }}
You can’t perform that action at this time.
0 commit comments