Skip to content

Commit b275a24

Browse files
Align github actions with upstream CAPI
Signed-off-by: killianmuldoon <[email protected]>
1 parent 78e402b commit b275a24

10 files changed

+122
-27
lines changed

.github/dependabot.yml

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,35 +11,24 @@ updates:
1111
prefix: ":seedling:"
1212
labels:
1313
- "ok-to-test"
14+
1415
# Go
1516
- package-ecosystem: "gomod"
1617
directory: "/"
1718
schedule:
1819
interval: "weekly"
20+
day: "monday"
1921
ignore:
20-
# Ignore k8s modules as they are upgraded manually
21-
# together with controller-runtime and CAPI dependencies.
22+
# Ignore controller-runtime as its upgraded manually.
23+
- dependency-name: "sigs.k8s.io/controller-runtime"
24+
update-types: [ "version-update:semver-major", "version-update:semver-minor" ]
25+
# Ignore k8s and its transitives modules as they are upgraded manually
26+
# together with controller-runtime.
2227
- dependency-name: "k8s.io/*"
23-
- dependency-name: "sigs.k8s.io/*"
28+
update-types: [ "version-update:semver-major", "version-update:semver-minor" ]
2429
- dependency-name: "sigs.k8s.io/cluster-api/test"
2530
update-types: ["version-update:semver-major", "version-update:semver-minor"]
2631
commit-message:
2732
prefix: ":seedling:"
2833
labels:
2934
- "ok-to-test"
30-
31-
- package-ecosystem: "gomod"
32-
directory: "/hack/tools"
33-
schedule:
34-
interval: "weekly"
35-
ignore:
36-
# Ignore k8s modules as they are upgraded manually
37-
# together with controller-runtime and CAPI dependencies.
38-
- dependency-name: "k8s.io/*"
39-
update-types: ["version-update:semver-major", "version-update:semver-minor"]
40-
- dependency-name: "sigs.k8s.io/*"
41-
update-types: ["version-update:semver-major", "version-update:semver-minor"]
42-
commit-message:
43-
prefix: ":seedling:"
44-
labels:
45-
- "ok-to-test"

.github/workflows/golangci-lint.yaml renamed to .github/workflows/pr-golangci-lint.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: golangci-lint
1+
name: PR golangci-lint
22

33
on:
44
pull_request:
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: PR check Markdown links
2+
3+
on:
4+
pull_request:
5+
types: [opened, edited, synchronize, reopened]
6+
paths:
7+
- '**.md'
8+
9+
# Remove all permissions from GITHUB_TOKEN except metadata.
10+
permissions: {}
11+
12+
jobs:
13+
markdown-link-check:
14+
name: Broken Links
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # tag=v3.5.3
18+
- uses: gaurav-nelson/github-action-markdown-link-check@5c5dfc0ac2e225883c0e5f03a85311ec2830d368 # tag=v1
19+
with:
20+
use-quiet-mode: 'yes'
21+
config-file: .markdownlinkcheck.json
22+
check-modified-files-only: 'yes'
23+
base-branch: main

.github/workflows/verify-pr.yml renamed to .github/workflows/pr-verify.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Verify PR
1+
name: PR Verify
22

33
on:
44
pull_request_target:
@@ -14,6 +14,6 @@ jobs:
1414
steps:
1515
- name: Verifier action
1616
id: verifier
17-
uses: kubernetes-sigs/[email protected]
17+
uses: kubernetes-sigs/kubebuilder-release-tools@4f3d1085b4458a49ed86918b4b55505716715b77 # tag=v0.3.0
1818
with:
1919
github_token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/scan.yaml renamed to .github/workflows/weekly-image-scan.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: scan-images
1+
name: Weekly image scan
22

33
on:
44
schedule:
@@ -13,7 +13,7 @@ jobs:
1313
strategy:
1414
fail-fast: false
1515
matrix:
16-
branch: [ main, release-1.7, release-1.6, release-1.5 ]
16+
branch: [ main, release-1.8, release-1.7, release-1.6, release-1.5 ]
1717
name: Trivy
1818
runs-on: ubuntu-latest
1919
steps:
@@ -25,7 +25,7 @@ jobs:
2525
id: vars
2626
run: echo "go_version=$(make go-version)" >> $GITHUB_OUTPUT
2727
- name: Set up Go
28-
uses: actions/setup-go@v4.0.1 # tag=v3.5.0
28+
uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # tag=v4.0.1
2929
with:
3030
go-version: ${{ steps.vars.outputs.go_version }}
3131
- name: Run verify container script
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Weekly check all Markdown links
2+
3+
on:
4+
schedule:
5+
# Cron for every Monday at 12:00 UTC.
6+
- cron: "0 12 * * 1"
7+
8+
# Remove all permissions from GITHUB_TOKEN except metadata.
9+
permissions: {}
10+
11+
jobs:
12+
markdown-link-check:
13+
name: Broken Links
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
branch: [ main, release-1.8, release-1.7, release-1.6, release-1.5 ]
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # tag=v3.5.3
21+
with:
22+
ref: ${{ matrix.branch }}
23+
- uses: gaurav-nelson/github-action-markdown-link-check@5c5dfc0ac2e225883c0e5f03a85311ec2830d368 # tag=v1
24+
with:
25+
use-quiet-mode: 'yes'
26+
config-file: .markdownlinkcheck.json
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Weekly release test
2+
3+
# Note: This workflow does not build for releases. It attempts to build release binaries periodically to ensure the repo
4+
# release machinery is in a good state.
5+
6+
on:
7+
schedule:
8+
# Cron for every day at 12:00 UTC.
9+
- cron: "0 12 * * *"
10+
11+
# Remove all permissions from GITHUB_TOKEN except metadata.
12+
permissions: {}
13+
14+
jobs:
15+
weekly-test-release:
16+
name: Test release
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
branch: [ main, release-1.8, release-1.7, release-1.6, release-1.5 ]
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # tag=v3.5.3
24+
with:
25+
ref: ${{ matrix.branch }}
26+
fetch-depth: 0
27+
- name: Set env
28+
run: echo "RELEASE_TAG=v9.9.9-fake" >> $GITHUB_ENV
29+
- name: Set fake tag for release
30+
run: |
31+
git tag ${{ env.RELEASE_TAG }}
32+
- name: Calculate go version
33+
run: echo "go_version=$(make go-version)" >> $GITHUB_ENV
34+
- name: Set up Go
35+
uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # tag=v4.0.1
36+
with:
37+
go-version: ${{ env.go_version }}
38+
- name: Test release
39+
run: |
40+
make release

.markdownlinkcheck.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"ignorePatterns": [{
3+
"pattern": "^http://localhost"
4+
}],
5+
"httpHeaders": [{
6+
"comment": "Workaround as suggested here: https://github.com/tcort/markdown-link-check/issues/201",
7+
"urls": ["https://docs.github.com/"],
8+
"headers": {
9+
"Accept-Encoding": "zstd, br, gzip, deflate"
10+
}
11+
}],
12+
"timeout": "10s",
13+
"retryOn429": true,
14+
"retryCount": 5,
15+
"fallbackRetryDelay": "30s",
16+
"aliveStatusCodes": [200, 206]
17+
}

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ GINKGO := $(abspath $(TOOLS_BIN_DIR)/$(GINKGO_BIN)-$(GINGKO_VER))
145145
GINKGO_PKG := github.com/onsi/ginkgo/v2/ginkgo
146146

147147
GOLANGCI_LINT_BIN := golangci-lint
148-
GOLANGCI_LINT_VER := $(shell cat .github/workflows/golangci-lint.yaml | grep [[:space:]]version: | sed 's/.*version: //')
148+
GOLANGCI_LINT_VER := $(shell cat .github/workflows/pr-golangci-lint.yaml | grep [[:space:]]version: | sed 's/.*version: //')
149149
GOLANGCI_LINT := $(abspath $(TOOLS_BIN_DIR)/$(GOLANGCI_LINT_BIN)-$(GOLANGCI_LINT_VER))
150150
GOLANGCI_LINT_PKG := github.com/golangci/golangci-lint/cmd/golangci-lint
151151

docs/release/release-tasks.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ From this point forward changes which should land in the release have to be cher
108108
- Adjust branches: `^main$` => `^release-1.8$`.
109109
5. Remove tests for old release branches if necessary
110110
6. Verify the jobs and dashboards a day later by taking a look at [testgrid](https://testgrid.k8s.io/sig-cluster-lifecycle-cluster-api-provider-vsphere)
111-
7. Update `.github/workflows/scan.yaml` - to set up Trivy scanning for the currently supported branches.
111+
7. Update `.github/workflows/weekly-image-scan.yaml` - to setup Trivy scanning - `.github/workflows/weekly-md-link-check.yaml` - to setup link checking in the CAPI book - and `.github/workflows/weekly-test-release.yaml` - to verify the release target is working - for the currently supported branches.
112112

113113
## Cut a release
114114

0 commit comments

Comments
 (0)