@@ -37,36 +37,35 @@ jobs:
37
37
uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
38
38
with :
39
39
fetch-depth : 0
40
+ ref : ${{ github.event.pull_request.head.sha }}
40
41
41
42
- name : Check Image and Relevant Changes
42
43
id : check-image
43
44
uses : ./.github/actions/check-image-and-changes
44
45
45
- - name : Check if build should be skipped
46
- run : |
47
- if [[ "${{ steps.check-image.outputs.relevant_changes }}" == "false" && "${{ steps.check-image.outputs.image_exists }}" == "true" ]]; then
48
- echo "Skipping build: Image already exists and no relevant changes detected."
49
- exit 0
50
- fi
51
-
52
46
- name : Setup Node.js
47
+ if : ${{ steps.check-image.outputs.is_skipped != 'true' }}
53
48
uses : actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
54
49
with :
55
50
node-version : ${{ matrix.node-version }}
56
51
registry-url : " https://registry.npmjs.org"
57
52
58
53
- name : Setup local Turbo cache
54
+ if : ${{ steps.check-image.outputs.is_skipped != 'true' }}
59
55
uses : dtinth/setup-github-actions-caching-for-turbo@cc723b4600e40a6b8815b65701d8614b91e2669e # v1
60
56
61
57
- name : Use app-config.example.yaml
58
+ if : ${{ steps.check-image.outputs.is_skipped != 'true' }}
62
59
run : rm app-config.yaml && mv app-config.example.yaml app-config.yaml
63
60
64
61
- name : Install dependencies
62
+ if : ${{ steps.check-image.outputs.is_skipped != 'true' }}
65
63
uses : backstage/actions/yarn-install@b3c1841fd69e1658ac631afafd0fb140a2309024 # v0.6.17
66
64
with :
67
65
cache-prefix : ${{ runner.os }}-v${{ matrix.node-version }}
68
66
69
67
- name : Build packages
68
+ if : ${{ steps.check-image.outputs.is_skipped != 'true' }}
70
69
run : yarn run build --continue --affected
71
70
72
71
test :
@@ -80,55 +79,60 @@ jobs:
80
79
uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
81
80
with :
82
81
fetch-depth : 0
82
+ ref : ${{ github.event.pull_request.head.sha }}
83
83
84
84
- name : Check Image and Relevant Changes
85
85
id : check-image
86
86
uses : ./.github/actions/check-image-and-changes
87
87
88
- - name : Check if tests should be skipped
89
- run : |
90
- if [[ "${{ steps.check-image.outputs.relevant_changes }}" == "false" && "${{ steps.check-image.outputs.image_exists }}" == "true" ]]; then
91
- echo "Skipping tests: No relevant changes detected."
92
- exit 0
93
- fi
94
-
95
88
- name : Setup Node.js
89
+ if : ${{ steps.check-image.outputs.is_skipped != 'true' }}
96
90
uses : actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
97
91
with :
98
92
node-version : ${{ matrix.node-version }}
99
93
registry-url : " https://registry.npmjs.org"
100
94
101
95
- name : Setup local Turbo cache
96
+ if : ${{ steps.check-image.outputs.is_skipped != 'true' }}
102
97
uses : dtinth/setup-github-actions-caching-for-turbo@cc723b4600e40a6b8815b65701d8614b91e2669e # v1
103
98
104
99
- name : Use app-config.example.yaml
100
+ if : ${{ steps.check-image.outputs.is_skipped != 'true' }}
105
101
run : rm app-config.yaml && mv app-config.example.yaml app-config.yaml
106
102
107
103
- name : Install dependencies
104
+ if : ${{ steps.check-image.outputs.is_skipped != 'true' }}
108
105
uses : backstage/actions/yarn-install@b3c1841fd69e1658ac631afafd0fb140a2309024 # v0.6.17
109
106
with :
110
107
cache-prefix : ${{ runner.os }}-v${{ matrix.node-version }}
111
108
112
109
- name : Run prettier
110
+ if : ${{ steps.check-image.outputs.is_skipped != 'true' }}
113
111
run : yarn prettier:check --continue --affected
114
112
115
113
- name : Run lint
114
+ if : ${{ steps.check-image.outputs.is_skipped != 'true' }}
116
115
run : yarn run lint:check --continue --affected
117
116
118
117
- name : Run monorepo tools
118
+ if : ${{ steps.check-image.outputs.is_skipped != 'true' }}
119
119
run : yarn run monorepo:check
120
120
121
121
- name : Regenerate dockerfiles
122
+ if : ${{ steps.check-image.outputs.is_skipped != 'true' }}
122
123
run : |
123
124
yarn run build:dockerfile; if [[ $(git diff --name-only | grep Dockerfile || true) != "" ]]; then \
124
125
echo "ERROR: Workspace is dirty! Must run 'yarn build:dockerfile' and commit changes!"; exit 1; \
125
126
fi
126
127
127
128
- name : Run tests
129
+ if : ${{ steps.check-image.outputs.is_skipped != 'true' }}
128
130
run : yarn run test --continue --affected
129
131
130
132
- name : Install dynamic plugin dependencies
133
+ if : ${{ steps.check-image.outputs.is_skipped != 'true' }}
131
134
run : cd ./dynamic-plugins && yarn install && cd ..
132
135
133
136
- name : Verify dynamic plugin wrappers
137
+ if : ${{ steps.check-image.outputs.is_skipped != 'true' }}
134
138
run : cd ./dynamic-plugins && yarn test && cd ..
0 commit comments