Skip to content

Commit 48e58c1

Browse files
authored
ci: added integration test and added signing to release
1 parent 3e33848 commit 48e58c1

File tree

3 files changed

+67
-0
lines changed

3 files changed

+67
-0
lines changed
+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
concurrency:
2+
group: "${{ github.workflow }}-${{ github.ref }}"
3+
cancel-in-progress: true
4+
5+
on:
6+
workflow_dispatch: {}
7+
8+
# Declare default permissions as read only.
9+
permissions: read-all
10+
11+
name: Integration Test
12+
jobs:
13+
integration-test:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
17+
with:
18+
# Disabling shallow clone is recommended for improving relevancy of reporting
19+
fetch-depth: 0
20+
- uses: jdx/mise-action@0c39a522dfbced3ed83924152c45804a71ce216f # v2.0.4
21+
with:
22+
experimental: true
23+
- name: 'Login to GitHub Container Registry'
24+
uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 # v3
25+
with:
26+
registry: ghcr.io
27+
username: ${{github.actor}}
28+
password: ${{secrets.GITHUB_TOKEN}}
29+
- name: Get syft
30+
uses: anchore/sbom-action/download-syft@7ccf588e3cf3cc2611714c2eeae48550fbc17552 # v0.15.11
31+
- name: Set up Go
32+
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5
33+
with:
34+
go-version-file: 'go.mod'
35+
- id: snapshot-release
36+
name: Run GoReleaser
37+
uses: goreleaser/goreleaser-action@5742e2a039330cbb23ebf35f046f814d4c6ff811 # v5
38+
with:
39+
args: release --snapshot --clean
40+
env:
41+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42+
- name: Run integration check
43+
run: |
44+
image=$(echo '${{ steps.snapshot-release.outputs.artifacts }}' | jq '.[] | select(.type=="Docker Image") | select(.extra.DockerConfig.goos=="linux") | select(.extra.DockerConfig.goarch=="amd64") | select(.name|contains("-SNAPSHOT-")) | .name' -r)
45+
echo "Testing image ${image}"
46+
mise run test:integration --test-image="${image}"

.github/workflows/release.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ jobs:
1616
permissions:
1717
contents: write
1818
packages: write
19+
id-token: write
1920
runs-on: ubuntu-latest
2021
steps:
2122
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4

.goreleaser.yaml

+20
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,26 @@ docker_manifests:
8080
release:
8181
prerelease: auto
8282

83+
docker_signs:
84+
- cmd: "cosign"
85+
args:
86+
- "sign"
87+
- "--upload=false"
88+
- "${artifact}"
89+
- "--yes"
90+
artifacts: all
91+
output: true
92+
93+
signs:
94+
- cmd: "cosign"
95+
args:
96+
- "sign-blob"
97+
- "--upload=false"
98+
- "${artifact}"
99+
- "--yes"
100+
artifacts: all
101+
output: true
102+
83103
changelog:
84104
sort: asc
85105
filters:

0 commit comments

Comments
 (0)