Skip to content

Commit 71c1da1

Browse files
authored
Merge pull request #520 from fluxcd/update-workflows
Update workflows and enable dependabot
2 parents 0bac431 + 973f8fb commit 71c1da1

File tree

6 files changed

+63
-84
lines changed

6 files changed

+63
-84
lines changed

.github/dependabot.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
version: 2
2+
3+
updates:
4+
- package-ecosystem: "github-actions"
5+
directory: "/"
6+
labels: ["area/build"]
7+
schedule:
8+
# by default this will be on a monday.
9+
interval: "weekly"

.github/workflows/build.yaml

Lines changed: 11 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,14 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- name: checkout
16-
uses: actions/checkout@v3
16+
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
1717
- name: Setup Go
18-
uses: actions/setup-go@v3
18+
uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
1919
with:
2020
go-version: 1.20.x
21-
- name: Restore go cache
22-
uses: actions/cache@v3
23-
with:
24-
# the ff is mounted into the container as ~/go/pkg/mod
25-
path: /home/runner/work/_temp/_github_home/go/pkg/mod
26-
key: ${{ runner.os }}-go-${{ hashFiles('go.sum') }}
27-
restore-keys: |
28-
${{ runner.os }}-go-
21+
cache-dependency-path: |
22+
**/go.sum
23+
**/go.mod
2924
- name: Run tests
3025
run: make test
3126
- name: Verify
@@ -36,12 +31,15 @@ jobs:
3631
# Docs: https://github.com/fluxcd/flux2/tree/main/.github/runners
3732
runs-on: [self-hosted, Linux, ARM64, equinix]
3833
steps:
39-
- name: Checkout
40-
uses: actions/checkout@v3
34+
- name: checkout
35+
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
4136
- name: Setup Go
42-
uses: actions/setup-go@v3
37+
uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
4338
with:
4439
go-version: 1.20.x
40+
cache-dependency-path: |
41+
**/go.sum
42+
**/go.mod
4543
- name: Run tests
4644
run: make test
4745
env:
@@ -54,28 +52,3 @@ jobs:
5452
SKIP_COSIGN_VERIFICATION: true
5553
- name: Verify
5654
run: make verify
57-
58-
# Runs 'make test' on macos-11 to assure development environment for
59-
# contributors using MacOS.
60-
darwin-amd64:
61-
runs-on: macos-11
62-
steps:
63-
- name: Checkout
64-
uses: actions/checkout@v3
65-
- name: Setup Go
66-
uses: actions/setup-go@v3
67-
with:
68-
go-version: 1.20.x
69-
- name: Restore Go cache
70-
uses: actions/cache@v3
71-
with:
72-
path: /home/runner/work/_temp/_github_home/go/pkg/mod
73-
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
74-
restore-keys: |
75-
${{ runner.os }}-go-
76-
- name: Run tests
77-
run: make test
78-
env:
79-
SKIP_COSIGN_VERIFICATION: true
80-
- name: Verify
81-
run: make verify

.github/workflows/cifuzz.yaml

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,24 @@
1-
name: CIFuzz
1+
name: fuzz
22
on:
33
pull_request:
44
branches:
55
- main
66

77
permissions:
8-
contents: read
8+
contents: read # for actions/checkout to fetch code
99

1010
jobs:
11-
Fuzzing:
11+
smoketest:
1212
runs-on: ubuntu-latest
1313
steps:
14-
- name: Checkout
15-
uses: actions/checkout@v3
16-
- name: Setup Go
17-
uses: actions/setup-go@v3
18-
with:
19-
go-version: 1.20.x
20-
- name: Restore Go cache
21-
uses: actions/cache@v3
22-
with:
23-
path: /home/runner/work/_temp/_github_home/go/pkg/mod
24-
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
25-
restore-keys: |
26-
${{ runner.os }}-go-
27-
- name: Smoke test Fuzzers
28-
run: make fuzz-smoketest
29-
env:
30-
SKIP_COSIGN_VERIFICATION: true
14+
- name: Checkout
15+
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
16+
- name: Setup Go
17+
uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
18+
with:
19+
go-version: 1.20.x
20+
cache-dependency-path: |
21+
**/go.sum
22+
**/go.mod
23+
- name: Smoke test Fuzzers
24+
run: make fuzz-smoketest

.github/workflows/nightly.yaml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,15 @@ jobs:
1414
build:
1515
runs-on: ubuntu-latest
1616
steps:
17-
- uses: actions/checkout@v3
17+
- name: Checkout
18+
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
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-
with:
24-
buildkitd-flags: "--debug"
23+
uses: docker/setup-buildx-action@4b4e9c3e2d4531116a6f8ba8e71fc6e2cb6e6c8c # v2.5.0
2524
- name: Build multi-arch container image
26-
uses: docker/build-push-action@v4
25+
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 # v4.0.0
2726
with:
2827
push: false
2928
builder: ${{ steps.buildx.outputs.name }}

.github/workflows/release.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
build-push:
2323
runs-on: ubuntu-latest
2424
steps:
25-
- uses: actions/checkout@v3
25+
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
2626
- name: Setup Kustomize
2727
uses: fluxcd/pkg/actions/kustomize@main
2828
- name: Prepare
@@ -35,32 +35,32 @@ jobs:
3535
echo "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT
3636
echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT
3737
- name: Setup QEMU
38-
uses: docker/setup-qemu-action@v2
38+
uses: docker/setup-qemu-action@e81a89b1732b9c48d79cd809d8d81d79c4647a18 # v2.1.0
3939
- name: Setup Docker Buildx
4040
id: buildx
41-
uses: docker/setup-buildx-action@v2
41+
uses: docker/setup-buildx-action@4b4e9c3e2d4531116a6f8ba8e71fc6e2cb6e6c8c # v2.5.0
4242
- name: Login to GitHub Container Registry
43-
uses: docker/login-action@v2
43+
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # v2.1.0
4444
with:
4545
registry: ghcr.io
4646
username: fluxcdbot
4747
password: ${{ secrets.GHCR_TOKEN }}
4848
- name: Login to Docker Hub
49-
uses: docker/login-action@v2
49+
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # v2.1.0
5050
with:
5151
username: fluxcdbot
5252
password: ${{ secrets.DOCKER_FLUXCD_PASSWORD }}
5353
- name: Generate images meta
5454
id: meta
55-
uses: docker/metadata-action@v4
55+
uses: docker/metadata-action@c4ee3adeed93b1fa6a762f209fb01608c1a22f1e # v4.4.0
5656
with:
5757
images: |
5858
fluxcd/${{ env.CONTROLLER }}
5959
ghcr.io/fluxcd/${{ env.CONTROLLER }}
6060
tags: |
6161
type=raw,value=${{ steps.prep.outputs.VERSION }}
6262
- name: Publish images
63-
uses: docker/build-push-action@v4
63+
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 # v4.0.0
6464
with:
6565
sbom: true
6666
provenance: true
@@ -77,7 +77,7 @@ jobs:
7777
docker buildx imagetools inspect ghcr.io/fluxcd/${{ env.CONTROLLER }}:${{ steps.prep.outputs.VERSION }}
7878
docker pull docker.io/fluxcd/${{ env.CONTROLLER }}:${{ steps.prep.outputs.VERSION }}
7979
docker pull ghcr.io/fluxcd/${{ env.CONTROLLER }}:${{ steps.prep.outputs.VERSION }}
80-
- uses: sigstore/cosign-installer@v3
80+
- uses: sigstore/cosign-installer@dd6b2e2b610a11fd73dd187a43d57cc1394e35f9 # v3.0.5
8181
- name: Sign images
8282
env:
8383
COSIGN_EXPERIMENTAL: 1
@@ -91,10 +91,10 @@ jobs:
9191
kustomize build ./config/crd > ./config/release/${{ env.CONTROLLER }}.crds.yaml
9292
kustomize build ./config/manager > ./config/release/${{ env.CONTROLLER }}.deployment.yaml
9393
echo '[CHANGELOG](https://github.com/fluxcd/${{ env.CONTROLLER }}/blob/main/CHANGELOG.md)' > ./config/release/notes.md
94-
- uses: anchore/sbom-action/download-syft@v0
94+
- uses: anchore/sbom-action/download-syft@4d571ad1038a9cc29d676154ef265ab8f9027042 # v0.14.2
9595
- name: Create release and SBOM
9696
if: startsWith(github.ref, 'refs/tags/v')
97-
uses: goreleaser/goreleaser-action@v4
97+
uses: goreleaser/goreleaser-action@f82d6c1c344bcacabba2c841718984797f664a6b # v4.2.0
9898
with:
9999
version: latest
100100
args: release --release-notes=config/release/notes.md --rm-dist --skip-validate

.github/workflows/scan.yml

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Scan
1+
name: scan
22

33
on:
44
push:
@@ -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@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
2122
- name: Run FOSSA scan and upload build data
22-
uses: fossa-contrib/fossa-action@v2
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@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
35+
- name: Setup Go
36+
uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
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@29b1f65c5e92e24fe6b6647da1eaabe529cec70f # v2.3.3
4044
with:
4145
languages: go
4246
- name: Autobuild
43-
uses: github/codeql-action/autobuild@v2
47+
uses: github/codeql-action/autobuild@29b1f65c5e92e24fe6b6647da1eaabe529cec70f # v2.3.3
4448
- name: Perform CodeQL Analysis
45-
uses: github/codeql-action/analyze@v2
49+
uses: github/codeql-action/analyze@29b1f65c5e92e24fe6b6647da1eaabe529cec70f # v2.3.3

0 commit comments

Comments
 (0)