Skip to content

Commit 0ada192

Browse files
Copilotcameri
andauthored
fix(ci): require checks for source changes
Co-authored-by: cameri <378886+cameri@users.noreply.github.com>
1 parent 98b1d04 commit 0ada192

2 files changed

Lines changed: 14 additions & 7 deletions

File tree

‎.github/workflows/checks.yml‎

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -219,11 +219,16 @@ jobs:
219219
- post-tests
220220
if: >-
221221
always() && github.event_name == 'push' && github.ref == 'refs/heads/main' &&
222-
(needs.changes.result == 'success' || needs.changes.result == 'skipped') &&
223-
(needs.lint.result == 'success' || needs.lint.result == 'skipped') &&
224-
(needs.build-check.result == 'success' || needs.build-check.result == 'skipped') &&
225-
(needs.test-units-and-cover.result == 'success' || needs.test-units-and-cover.result == 'skipped') &&
226-
(needs.test-integrations-and-cover.result == 'success' || needs.test-integrations-and-cover.result == 'skipped') &&
222+
needs.changes.result == 'success' &&
223+
(
224+
needs.changes.outputs.src != 'true' ||
225+
(
226+
needs.lint.result == 'success' &&
227+
needs.build-check.result == 'success' &&
228+
needs.test-units-and-cover.result == 'success' &&
229+
needs.test-integrations-and-cover.result == 'success'
230+
)
231+
) &&
227232
needs.post-tests.result == 'success'
228233
env:
229234
REGISTRY: ghcr.io

‎test/unit/ci/publish-container-image.spec.ts‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,10 @@ describe('container image publishing workflow', () => {
2525
'post-tests',
2626
])
2727
expect(publish.if).to.include("always() && github.event_name == 'push' && github.ref == 'refs/heads/main'")
28-
for (const job of publish.needs.filter((job) => job !== 'post-tests')) {
29-
expect(publish.if).to.include(`needs.${job}.result == 'success' || needs.${job}.result == 'skipped'`)
28+
expect(publish.if).to.include("needs.changes.result == 'success'")
29+
expect(publish.if).to.include("needs.changes.outputs.src != 'true'")
30+
for (const job of publish.needs.filter((job) => !['changes', 'post-tests'].includes(job))) {
31+
expect(publish.if).to.include(`needs.${job}.result == 'success'`)
3032
}
3133
expect(publish.if).to.include("needs.post-tests.result == 'success'")
3234
expect(existsSync(join(process.cwd(), '.github', 'workflows', 'publish-container-image.yml'))).to.equal(false)

0 commit comments

Comments
 (0)