Skip to content

Commit c981142

Browse files
lubronzhanchrischdi
authored andcommitted
Grouped CI related cherry-picks
- Add args to golangci-lint to show lines number kubernetes-sigs#2180 - Align github actions with upstream CAPI kubernetes-sigs#2167 - flavorgen generates all flavors by default kubernetes-sigs#2172 - only CI parts - Add verify-govulncheck target and integrate to scan action kubernetes-sigs#2174 - Use shellcheck binary instead of self-built docker image kubernetes-sigs#2211 - Add doctoc and generate + verify targets kubernetes-sigs#2147 - only CI parts
1 parent 16071ea commit c981142

File tree

121 files changed

+490
-14765
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

121 files changed

+490
-14765
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: 4 additions & 3 deletions
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:
@@ -17,10 +17,11 @@ jobs:
1717
id: vars
1818
run: echo "go_version=$(make go-version)" >> $GITHUB_OUTPUT
1919
- name: Set up Go
20-
uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # tag=v4.0.1
20+
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # tag=v4.1.0
2121
with:
2222
go-version: ${{ steps.vars.outputs.go_version }}
2323
- name: golangci-lint
2424
uses: golangci/golangci-lint-action@639cd343e1d3b897ff35927a75193d57cfcba299 # tag=v3.6.0
2525
with:
26-
version: v1.53.3
26+
version: v1.53.3
27+
args: --out-format=colored-line-number
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/release.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- name: Calculate go version
2424
run: echo "go_version=$(make go-version)" >> $GITHUB_ENV
2525
- name: Set up Go
26-
uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # tag=v4.0.1
26+
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # tag=v4.1.0
2727
with:
2828
go-version: ${{ env.go_version }}
2929
- name: generate release artifacts

.github/workflows/scan.yaml

Lines changed: 0 additions & 32 deletions
This file was deleted.
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: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Weekly security scan
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+
scan:
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
branch: [ main, release-1.8, release-1.7, release-1.6, release-1.5 ]
17+
name: Trivy
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Check out code
21+
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # tag=v3.5.3
22+
with:
23+
ref: ${{ matrix.branch }}
24+
- name: Calculate go version
25+
id: vars
26+
run: echo "go_version=$(make go-version)" >> $GITHUB_OUTPUT
27+
- name: Set up Go
28+
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # tag=v4.1.0
29+
with:
30+
go-version: ${{ steps.vars.outputs.go_version }}
31+
- name: Run verify security target
32+
run: make verify-security
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@93397bea11091df50f3d7e59dc26a7711a8bcfbe # tag=v4.1.0
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+
}

0 commit comments

Comments
 (0)