diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b552802d..30ad8c1d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -141,9 +141,13 @@ jobs: permissions: {} env: CI: "true" + if: always() steps: - - name: Done - run: echo OK + - name: Build result + run: echo ${{needs.matrix-test.result}} + - name: Set status based on matrix build + if: ${{ needs.matrix-test.result != 'success' }} + run: exit 1 package: name: package needs: build diff --git a/projenrc/build-workflow.ts b/projenrc/build-workflow.ts index 4e0681af..5d419007 100644 --- a/projenrc/build-workflow.ts +++ b/projenrc/build-workflow.ts @@ -220,7 +220,18 @@ export class BuildWorkflow { needs: ['matrix-test'], permissions: {}, runsOn: ['ubuntu-latest'], - steps: [{ name: 'Done', run: 'echo OK' }], + if: 'always()', + steps: [ + { + name: 'Build result', + run: 'echo ${{needs.matrix-test.result}}', + }, + { + if: "${{ needs.matrix-test.result != 'success' }}", + name: 'Set status based on matrix build', + run: 'exit 1', + }, + ], }, 'package': { env: { CI: 'true' },