Skip to content

Commit 98ebc9f

Browse files
authored
Merge pull request #1054 from fluxcd/update-workflows
Update workflows
2 parents 82dc24c + 4081e4b commit 98ebc9f

File tree

7 files changed

+65
-76
lines changed

7 files changed

+65
-76
lines changed

.github/workflows/cifuzz.yaml

+5-12
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,14 @@ jobs:
1616
runs-on: ubuntu-latest
1717
steps:
1818
- name: Checkout
19-
uses: actions/checkout@v3
19+
uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0
2020
- name: Setup Go
21-
uses: actions/setup-go@v3
21+
uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 # v4.0.0
2222
with:
2323
go-version: 1.20.x
24-
- id: go-env
25-
run: |
26-
echo "go-mod-cache=$(go env GOMODCACHE)" >> $GITHUB_OUTPUT
27-
- name: Restore Go cache
28-
uses: actions/cache@v3
29-
with:
30-
path: ${{ steps.go-env.outputs.go-mod-cache }}
31-
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
32-
restore-keys: |
33-
${{ runner.os }}-go
24+
cache-dependency-path: |
25+
**/go.sum
26+
**/go.mod
3427
- name: Smoke test Fuzzers
3528
run: make fuzz-smoketest
3629
env:

.github/workflows/e2e.yaml

+11-12
Original file line numberDiff line numberDiff line change
@@ -19,25 +19,21 @@ jobs:
1919
runs-on: ubuntu-latest
2020
steps:
2121
- name: Checkout
22-
uses: actions/checkout@v3
22+
uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0
2323
- name: Setup Go
24-
uses: actions/setup-go@v3
24+
uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 # v4.0.0
2525
with:
2626
go-version: 1.20.x
27-
- name: Restore Go cache
28-
uses: actions/cache@v3
29-
with:
30-
path: /home/runner/work/_temp/_github_home/go/pkg/mod
31-
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
32-
restore-keys: |
33-
${{ runner.os }}-go-
27+
cache-dependency-path: |
28+
**/go.sum
29+
**/go.mod
3430
- name: Enable integration tests
3531
# Only run integration tests for main branch
3632
if: github.ref == 'refs/heads/main'
3733
run: |
3834
echo 'GO_TAGS=integration' >> $GITHUB_ENV
3935
- name: Setup Kubernetes
40-
uses: helm/[email protected]
36+
uses: helm/kind-action@d8ccf8fb623ce1bb360ae2f45f323d9d5c5e9f00 # v1.5.0
4137
with:
4238
version: v0.17.0
4339
cluster_name: kind
@@ -58,11 +54,14 @@ jobs:
5854
runs-on: [self-hosted, Linux, ARM64, equinix]
5955
steps:
6056
- name: Checkout
61-
uses: actions/checkout@v3
57+
uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0
6258
- name: Setup Go
63-
uses: actions/setup-go@v3
59+
uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 # v4.0.0
6460
with:
6561
go-version: 1.20.x
62+
cache-dependency-path: |
63+
**/go.sum
64+
**/go.mod
6665
- name: Enable integration tests
6766
# Only run integration tests for main branch
6867
if: github.ref == 'refs/heads/main'

.github/workflows/nightly.yml

+5-4
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,17 @@ jobs:
1414
build:
1515
runs-on: ubuntu-latest
1616
steps:
17-
- uses: actions/checkout@v3
17+
- name: Checkout
18+
uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0
1819
- name: Setup QEMU
19-
uses: docker/setup-qemu-action@v2
20+
uses: docker/setup-qemu-action@e81a89b1732b9c48d79cd809d8d81d79c4647a18 # v2.1.0
2021
- name: Setup Docker Buildx
2122
id: buildx
22-
uses: docker/setup-buildx-action@v2
23+
uses: docker/setup-buildx-action@4b4e9c3e2d4531116a6f8ba8e71fc6e2cb6e6c8c # v2.5.0
2324
with:
2425
buildkitd-flags: "--debug"
2526
- name: Build multi-arch container image
26-
uses: docker/build-push-action@v4
27+
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 # v4.0.0
2728
with:
2829
push: false
2930
builder: ${{ steps.buildx.outputs.name }}

.github/workflows/release.yml

+11-10
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ jobs:
2222
build-push:
2323
runs-on: ubuntu-latest
2424
steps:
25-
- uses: actions/checkout@v3
25+
- name: Checkout
26+
uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0
2627
- name: Setup Kustomize
2728
uses: fluxcd/pkg/actions/kustomize@main
2829
- name: Prepare
@@ -35,32 +36,32 @@ jobs:
3536
echo "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT
3637
echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT
3738
- name: Setup QEMU
38-
uses: docker/setup-qemu-action@v2
39+
uses: docker/setup-qemu-action@e81a89b1732b9c48d79cd809d8d81d79c4647a18 # v2.1.0
3940
- name: Setup Docker Buildx
4041
id: buildx
41-
uses: docker/setup-buildx-action@v2
42+
uses: docker/setup-buildx-action@4b4e9c3e2d4531116a6f8ba8e71fc6e2cb6e6c8c # v2.5.0
4243
- name: Login to GitHub Container Registry
43-
uses: docker/login-action@v2
44+
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # v2.1.0
4445
with:
4546
registry: ghcr.io
4647
username: fluxcdbot
4748
password: ${{ secrets.GHCR_TOKEN }}
4849
- name: Login to Docker Hub
49-
uses: docker/login-action@v2
50+
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # v2.1.0
5051
with:
5152
username: fluxcdbot
5253
password: ${{ secrets.DOCKER_FLUXCD_PASSWORD }}
5354
- name: Generate images meta
5455
id: meta
55-
uses: docker/metadata-action@v4
56+
uses: docker/metadata-action@507c2f2dc502c992ad446e3d7a5dfbe311567a96 # v4.3.0
5657
with:
5758
images: |
5859
fluxcd/${{ env.CONTROLLER }}
5960
ghcr.io/fluxcd/${{ env.CONTROLLER }}
6061
tags: |
6162
type=raw,value=${{ steps.prep.outputs.VERSION }}
6263
- name: Publish images
63-
uses: docker/build-push-action@v4
64+
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 # v4.0.0
6465
with:
6566
sbom: true
6667
provenance: true
@@ -77,7 +78,7 @@ jobs:
7778
docker buildx imagetools inspect ghcr.io/fluxcd/${{ env.CONTROLLER }}:${{ steps.prep.outputs.VERSION }}
7879
docker pull docker.io/fluxcd/${{ env.CONTROLLER }}:${{ steps.prep.outputs.VERSION }}
7980
docker pull ghcr.io/fluxcd/${{ env.CONTROLLER }}:${{ steps.prep.outputs.VERSION }}
80-
- uses: sigstore/cosign-installer@v3
81+
- uses: sigstore/cosign-installer@c3667d99424e7e6047999fb6246c0da843953c65 # v3.0.1
8182
- name: Sign images
8283
env:
8384
COSIGN_EXPERIMENTAL: 1
@@ -91,10 +92,10 @@ jobs:
9192
kustomize build ./config/crd > ./config/release/${{ env.CONTROLLER }}.crds.yaml
9293
kustomize build ./config/manager > ./config/release/${{ env.CONTROLLER }}.deployment.yaml
9394
echo '[CHANGELOG](https://github.com/fluxcd/${{ env.CONTROLLER }}/blob/main/CHANGELOG.md)' > ./config/release/notes.md
94-
- uses: anchore/sbom-action/download-syft@v0
95+
- uses: anchore/sbom-action/download-syft@07978da4bdb4faa726e52dfc6b1bed63d4b56479 # v0.13.3
9596
- name: Create release and SBOM
9697
if: startsWith(github.ref, 'refs/tags/v')
97-
uses: goreleaser/goreleaser-action@v4
98+
uses: goreleaser/goreleaser-action@f82d6c1c344bcacabba2c841718984797f664a6b # v4.2.0
9899
with:
99100
version: latest
100101
args: release --release-notes=config/release/notes.md --rm-dist --skip-validate

.github/workflows/scan.yaml

+13-9
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@ jobs:
1717
name: FOSSA
1818
runs-on: ubuntu-latest
1919
steps:
20-
- uses: actions/checkout@v3
20+
- name: Checkout
21+
uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0
2122
- name: Run FOSSA scan and upload build data
22-
uses: fossa-contrib/fossa-action@v1
23+
uses: fossa-contrib/fossa-action@6728dc6fe9a068c648d080c33829ffbe56565023 # v2.0.0
2324
with:
2425
# FOSSA Push-Only API Token
2526
fossa-api-key: 5ee8bf422db1471e0bcf2bcb289185de
@@ -29,17 +30,20 @@ jobs:
2930
name: CodeQL
3031
runs-on: ubuntu-latest
3132
steps:
32-
- name: Checkout repository
33-
uses: actions/checkout@v3
34-
- name: Set up Go
35-
uses: actions/setup-go@v2
33+
- name: Checkout
34+
uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0
35+
- name: Setup Go
36+
uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 # v4.0.0
3637
with:
3738
go-version: 1.20.x
39+
cache-dependency-path: |
40+
**/go.sum
41+
**/go.mod
3842
- name: Initialize CodeQL
39-
uses: github/codeql-action/init@v2
43+
uses: github/codeql-action/init@168b99b3c22180941ae7dbdd5f5c9678ede476ba # v2.2.7
4044
with:
4145
languages: go
4246
- name: Autobuild
43-
uses: github/codeql-action/autobuild@v2
47+
uses: github/codeql-action/autobuild@168b99b3c22180941ae7dbdd5f5c9678ede476ba # v2.2.7
4448
- name: Perform CodeQL Analysis
45-
uses: github/codeql-action/analyze@v2
49+
uses: github/codeql-action/analyze@168b99b3c22180941ae7dbdd5f5c9678ede476ba # v2.2.7

.github/workflows/tests.yaml

+15-20
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,14 @@ jobs:
2020
runs-on: ubuntu-latest
2121
steps:
2222
- name: Checkout
23-
uses: actions/checkout@v3
23+
uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0
2424
- name: Setup Go
25-
uses: actions/setup-go@v3
25+
uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 # v4.0.0
2626
with:
2727
go-version: 1.20.x
28-
- name: Restore Go cache
29-
uses: actions/cache@v3
30-
with:
31-
path: /home/runner/work/_temp/_github_home/go/pkg/mod
32-
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
33-
restore-keys: |
34-
${{ runner.os }}-go-
28+
cache-dependency-path: |
29+
**/go.sum
30+
**/go.mod
3531
- name: Run tests
3632
env:
3733
SKIP_COSIGN_VERIFICATION: true
@@ -45,11 +41,14 @@ jobs:
4541
runs-on: [self-hosted, Linux, ARM64, equinix]
4642
steps:
4743
- name: Checkout
48-
uses: actions/checkout@v3
44+
uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0
4945
- name: Setup Go
50-
uses: actions/setup-go@v3
46+
uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 # v4.0.0
5147
with:
5248
go-version: 1.20.x
49+
cache-dependency-path: |
50+
**/go.sum
51+
**/go.mod
5352
- name: Run tests
5453
env:
5554
SKIP_COSIGN_VERIFICATION: true
@@ -76,18 +75,14 @@ jobs:
7675
runs-on: ${{ matrix.os }}
7776
steps:
7877
- name: Checkout
79-
uses: actions/checkout@v3
78+
uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0
8079
- name: Setup Go
81-
uses: actions/setup-go@v3
80+
uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 # v4.0.0
8281
with:
8382
go-version: 1.20.x
84-
- name: Restore Go cache
85-
uses: actions/cache@v3
86-
with:
87-
path: /home/runner/work/_temp/_github_home/go/pkg/mod
88-
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
89-
restore-keys: |
90-
${{ runner.os }}-go-
83+
cache-dependency-path: |
84+
**/go.sum
85+
**/go.mod
9186
- name: Install and configure Docker using colima
9287
# Ref: https://github.com/abiosoft/colima/blob/main/docs/FAQ.md#cannot-connect-to-the-docker-daemon-at-unixvarrundockersock-is-the-docker-daemon-running
9388
run: |

.github/workflows/verify.yaml

+5-9
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,13 @@ jobs:
2020
runs-on: ubuntu-latest
2121
steps:
2222
- name: Checkout
23-
uses: actions/checkout@v3
23+
uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0
2424
- name: Setup Go
25-
uses: actions/setup-go@v3
25+
uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 # v4.0.0
2626
with:
2727
go-version: 1.20.x
28-
- name: Restore Go cache
29-
uses: actions/cache@v3
30-
with:
31-
path: /home/runner/work/_temp/_github_home/go/pkg/mod
32-
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
33-
restore-keys: |
34-
${{ runner.os }}-go-
28+
cache-dependency-path: |
29+
**/go.sum
30+
**/go.mod
3531
- name: Verify
3632
run: make verify

0 commit comments

Comments
 (0)