Skip to content

Commit 4ffc8cf

Browse files
committed
ci: allow e2e tests to be skipped and enable SBOM again
1 parent bf4a5f7 commit 4ffc8cf

2 files changed

Lines changed: 31 additions & 16 deletions

File tree

.github/workflows/release-app.yaml

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ on:
77
paths:
88
- deploy/helm/Chart.yaml
99
workflow_dispatch:
10+
inputs:
11+
skip-e2e:
12+
description: Skip e2e tests
13+
type: boolean
14+
default: false
1015

1116
concurrency:
1217
group: ${{ github.workflow }}
@@ -59,15 +64,19 @@ jobs:
5964

6065
e2e:
6166
needs: build-image
62-
if: ${{ needs.detect.outputs.skip == 'false' }}
67+
if: needs.detect.outputs.skip == 'false' && !inputs['skip-e2e']
6368
uses: ./.github/workflows/_reusable-e2e.yaml
6469
with:
6570
image_tag: ${{ github.sha }}
6671
secrets: inherit
6772

6873
release:
6974
needs: [detect, build-image, e2e]
70-
if: ${{ needs.detect.outputs.skip == 'false' }}
75+
if: >-
76+
always() &&
77+
needs.detect.outputs.skip == 'false' &&
78+
needs.build-image.result == 'success' &&
79+
(needs.e2e.result == 'success' || needs.e2e.result == 'skipped')
7180
runs-on: ubuntu-24.04
7281
permissions:
7382
contents: write
@@ -102,19 +111,20 @@ jobs:
102111
DIGEST=$(oras resolve "$IMAGE")
103112
cosign sign --yes "${{ env.REGISTRY }}/${{ github.repository }}@${DIGEST}"
104113
105-
# - name: Generate SBOM
106-
# uses: anchore/sbom-action@e22c389904149dbc22b58101806040fa8d37a610 # v0.24.0
107-
# with:
108-
# image: ${{ env.REGISTRY }}/${{ github.repository }}:${{ needs.detect.outputs.app_version }}
109-
# format: spdx-json
110-
# output-file: sbom.spdx.json
111-
# upload-artifact: false
112-
# upload-release-assets: false
113-
114-
# - name: Attest SBOM
115-
# run: |
116-
# IMAGE="${{ env.REGISTRY }}/${{ github.repository }}:${{ needs.detect.outputs.app_version }}"
117-
# cosign attest --yes --type spdx --predicate sbom.spdx.json "$IMAGE"
114+
- name: Generate SBOM
115+
uses: anchore/sbom-action@e22c389904149dbc22b58101806040fa8d37a610 # v0.24.0
116+
with:
117+
image: ${{ env.REGISTRY }}/${{ github.repository }}:${{ needs.detect.outputs.app_version }}
118+
format: spdx-json
119+
output-file: sbom.spdx.json
120+
upload-artifact: false
121+
upload-release-assets: false
122+
123+
- name: Attest SBOM
124+
run: |
125+
IMAGE="${{ env.REGISTRY }}/${{ github.repository }}:${{ needs.detect.outputs.app_version }}"
126+
DIGEST=$(oras resolve "$IMAGE")
127+
cosign attest --yes --type spdxjson --predicate sbom.spdx.json "${{ env.REGISTRY }}/${{ github.repository }}@${DIGEST}"
118128
119129
- name: Get release notes
120130
run: make release-notes TAG="${{ needs.detect.outputs.app_version }}" > .release_notes

.github/workflows/release-helm.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ on:
1111
paths:
1212
- deploy/helm/Chart.yaml
1313
workflow_dispatch:
14+
inputs:
15+
skip-e2e:
16+
description: Skip e2e tests
17+
type: boolean
18+
default: false
1419

1520
permissions:
1621
contents: read
@@ -61,7 +66,7 @@ jobs:
6166
# has been bumped as well. The release-app action will then run the E2E tests instead.
6267
e2e:
6368
needs: detect
64-
if: ${{ needs.detect.outputs.skip == 'false' && needs.detect.outputs.app_version_bumped == 'false' }}
69+
if: needs.detect.outputs.skip == 'false' && needs.detect.outputs.app_version_bumped == 'false' && !inputs['skip-e2e']
6570
uses: ./.github/workflows/_reusable-e2e.yaml
6671
secrets: inherit
6772

0 commit comments

Comments
 (0)