Skip to content

Commit 54dd5c6

Browse files
authored
Merge pull request #291 from arnested/tweaks
Tune GitHub Actions and add more linting
2 parents 517c9f1 + 193cb71 commit 54dd5c6

15 files changed

+153
-133
lines changed

.github/dependabot.yml

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
1+
---
12
version: 2
23
updates:
3-
- package-ecosystem: github-actions
4-
directory: "/"
5-
schedule:
6-
interval: daily
7-
time: '04:00'
8-
timezone: Europe/Copenhagen
9-
open-pull-requests-limit: 10
10-
reviewers:
11-
- arnested
12-
- package-ecosystem: gomod
13-
directory: "/"
14-
schedule:
15-
interval: daily
16-
time: '04:00'
17-
timezone: Europe/Copenhagen
18-
open-pull-requests-limit: 10
19-
reviewers:
20-
- arnested
4+
- package-ecosystem: github-actions
5+
directory: "/"
6+
schedule:
7+
interval: daily
8+
time: '04:00'
9+
timezone: Europe/Copenhagen
10+
open-pull-requests-limit: 10
11+
reviewers:
12+
- arnested
13+
- package-ecosystem: gomod
14+
directory: "/"
15+
schedule:
16+
interval: daily
17+
time: '04:00'
18+
timezone: Europe/Copenhagen
19+
open-pull-requests-limit: 10
20+
reviewers:
21+
- arnested

.github/workflows/build.yml

Lines changed: 15 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,25 @@
1+
---
12
name: Build and test
23
on:
3-
- push
4+
- push
45

56
permissions:
67
contents: read
78

89
jobs:
9-
go-version:
10-
name: Lookup go versions
11-
runs-on: ubuntu-latest
12-
outputs:
13-
minimal: ${{ steps.go-version.outputs.minimal }}
14-
matrix: ${{ steps.go-version.outputs.matrix }}
15-
steps:
16-
- uses: actions/checkout@v4
17-
- uses: arnested/go-version-action@v1
18-
id: go-version
1910
build_and_test:
2011
name: Build and test
21-
needs: go-version
22-
runs-on: ubuntu-latest
23-
strategy:
24-
matrix:
25-
go-version: ${{ fromJSON(needs.go-version.outputs.matrix) }}
12+
runs-on: ubuntu-24.04
2613
steps:
27-
- uses: actions/checkout@v4
28-
- name: Setup Go ${{ matrix.go-version }}.x
29-
uses: WillAbides/setup-go-faster@v1.14.0
30-
with:
31-
go-version: ${{ matrix.go-version }}.x
32-
ignore-local: true
33-
- run: go version
34-
- name: go test
35-
env:
36-
# We enable cgo to be able to test with `-race`.
37-
CGO_ENABLED: 1
38-
run: go test -v -race -cover -covermode=atomic -coverprofile=coverage.txt ./...
39-
- name: Upload coverage report to Codecov
40-
uses: codecov/codecov-action@v5
41-
with:
42-
flags: go${{ matrix.go-version }}
14+
- uses: actions/checkout@v4
15+
- name: Setup Go
16+
uses: WillAbides/setup-go-faster@v1.14.0
17+
with:
18+
go-version-file: go.mod
19+
- run: go version
20+
- name: Test
21+
uses: robherley/go-test-action@v0.6.0
22+
with:
23+
testArguments: -race -cover -covermode=atomic -coverprofile=coverage.txt ./...
24+
- name: Upload coverage report to Codecov
25+
uses: codecov/codecov-action@v5

.github/workflows/codeql-analysis.yml

Lines changed: 17 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
name: "CodeQL"
1+
---
2+
name: CodeQL
23

34
on:
45
push:
56
branches: [main]
67
pull_request:
7-
# The branches below must be a subset of the branches above
88
branches: [main]
99
schedule:
1010
- cron: '0 23 * * 4'
@@ -16,38 +16,19 @@ permissions:
1616
jobs:
1717
analyse:
1818
name: Analyse
19-
runs-on: ubuntu-latest
20-
19+
runs-on: ubuntu-24.04
2120
steps:
22-
- name: Checkout repository
23-
uses: actions/checkout@v4
24-
25-
- name: Setup Go
26-
uses: WillAbides/setup-go-faster@v1.14.0
27-
with:
28-
go-version-file: go.mod
29-
30-
# Initializes the CodeQL tools for scanning.
31-
- name: Initialize CodeQL
32-
uses: github/codeql-action/init@v3
33-
with:
34-
languages: go
35-
36-
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
37-
# If this step fails, then you should remove it and run the build manually (see below)
38-
- name: Autobuild
39-
uses: github/codeql-action/autobuild@v3
40-
41-
# ℹ️ Command-line programs to run using the OS shell.
42-
# 📚 https://git.io/JvXDl
43-
44-
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
45-
# and modify them (or add more) to build your code if your project
46-
# uses a compiled language
47-
48-
#- run: |
49-
# make bootstrap
50-
# make release
51-
52-
- name: Perform CodeQL Analysis
53-
uses: github/codeql-action/analyze@v3
21+
- name: Checkout repository
22+
uses: actions/checkout@v4
23+
- name: Setup Go
24+
uses: WillAbides/setup-go-faster@v1.14.0
25+
with:
26+
go-version-file: go.mod
27+
- name: Initialize CodeQL
28+
uses: github/codeql-action/init@v3
29+
with:
30+
languages: go
31+
- name: Autobuild
32+
uses: github/codeql-action/autobuild@v3
33+
- name: Perform CodeQL Analysis
34+
uses: github/codeql-action/analyze@v3

.github/workflows/dependency-review.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
name: 'Dependency Review'
23
on: [pull_request]
34

@@ -6,7 +7,7 @@ permissions:
67

78
jobs:
89
dependency-review:
9-
runs-on: ubuntu-latest
10+
runs-on: ubuntu-24.04
1011
steps:
1112
- name: 'Checkout Repository'
1213
uses: actions/checkout@v4

.github/workflows/go-version.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ permissions:
1111
jobs:
1212
stable:
1313
name: Stable
14-
runs-on: ubuntu-22.04
14+
runs-on: ubuntu-24.04
1515
steps:
1616
- uses: actions/checkout@v4
1717
- uses: arnested/go-version-action@v1
@@ -41,7 +41,7 @@ jobs:
4141
token: ${{ secrets.PAT_TOKEN }}
4242
unstable:
4343
name: Unstable
44-
runs-on: ubuntu-22.04
44+
runs-on: ubuntu-24.04
4545
steps:
4646
- uses: actions/checkout@v4
4747
- uses: arnested/go-version-action@v1

.github/workflows/golangci-lint.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
name: golangci-lint
23
on:
34
push:
@@ -13,7 +14,7 @@ permissions:
1314
jobs:
1415
golangci:
1516
name: lint
16-
runs-on: ubuntu-latest
17+
runs-on: ubuntu-24.04
1718
steps:
1819
- uses: actions/checkout@v4
1920
- name: Setup Go
@@ -24,7 +25,5 @@ jobs:
2425
uses: golangci/golangci-lint-action@v6
2526
with:
2627
version: latest
28+
install-mode: goinstall
2729
only-new-issues: true
28-
install-mode: "goinstall"
29-
30-

.github/workflows/lint.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
name: Lint
3+
on:
4+
- pull_request
5+
- push
6+
7+
permissions:
8+
contents: read
9+
pull-requests: write
10+
11+
jobs:
12+
actionlint:
13+
name: GitHub Actions workflow
14+
runs-on: ubuntu-24.04
15+
steps:
16+
- uses: actions/checkout@v4
17+
- uses: reviewdog/action-actionlint@v1
18+
markdownlint:
19+
name: Markdown
20+
runs-on: ubuntu-24.04
21+
steps:
22+
- uses: actions/checkout@v4
23+
- name: Run markdownlint
24+
uses: DavidAnson/markdownlint-cli2-action@v19
25+
yamllint:
26+
name: YAML
27+
runs-on: ubuntu-24.04
28+
steps:
29+
- uses: actions/checkout@v4
30+
- name: Run Yamllint
31+
uses: frenck/action-yamllint@v1.5.0
32+
with:
33+
strict: true

.github/workflows/release.yml

Lines changed: 32 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
name: Release
23

34
on:
@@ -12,37 +13,35 @@ permissions:
1213

1314
jobs:
1415
release:
15-
runs-on: ubuntu-latest
16+
runs-on: ubuntu-24.04
1617
steps:
17-
- uses: actions/checkout@v4
18-
with:
19-
fetch-depth: '0'
20-
- name: Bump version and push tag
21-
uses: anothrNick/github-tag-action@1.71.0
22-
id: version
23-
env:
24-
GITHUB_TOKEN: ${{ github.token }}
25-
WITH_V: true
26-
DEFAULT_BUMP: patch
27-
DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
28-
- uses: arnested/go-version-action@v1
29-
id: go-version
30-
- name: Set up Go ${{ steps.go-version.outputs.latest }}.x
31-
uses: WillAbides/setup-go-faster@v1.14.0
32-
with:
33-
go-version: ${{ steps.go-version.outputs.latest }}.x
34-
ignore-local: true
35-
- run: go version
36-
- name: Run GoReleaser
37-
uses: goreleaser/goreleaser-action@v6
38-
with:
39-
version: latest
40-
args: release
41-
env:
42-
GITHUB_TOKEN: ${{ github.token }}
43-
- name: Post status to Google Chat
44-
if: ${{ always() }}
45-
uses: containrrr/shoutrrr-action@v1
46-
with:
47-
url: "${{ secrets.WATCHTOWER_NOTIFICATION_URL }}"
48-
message: "Released `${{ github.repository }}`@`${{ github.sha }}` as ${{ steps.version.outputs.tag }}: *${{ job.status }}*."
18+
- uses: actions/checkout@v4
19+
with:
20+
fetch-depth: '0'
21+
- name: Bump version and push tag
22+
uses: anothrNick/github-tag-action@1.71.0
23+
id: version
24+
env:
25+
GITHUB_TOKEN: ${{ github.token }}
26+
WITH_V: true
27+
DEFAULT_BUMP: patch
28+
DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
29+
- name: Setup Go
30+
uses: WillAbides/setup-go-faster@v1.14.0
31+
with:
32+
go-version-file: go.mod
33+
ignore-local: true
34+
- run: go version
35+
- name: Run GoReleaser
36+
uses: goreleaser/goreleaser-action@v6
37+
with:
38+
version: latest
39+
args: release
40+
env:
41+
GITHUB_TOKEN: ${{ github.token }}
42+
- name: Post status to Google Chat
43+
if: ${{ always() }}
44+
uses: containrrr/shoutrrr-action@v1
45+
with:
46+
url: "${{ secrets.WATCHTOWER_NOTIFICATION_URL }}"
47+
message: "Released `${{ github.repository }}`@`${{ github.sha }}` as ${{ steps.version.outputs.tag }}: *${{ job.status }}*."

.golangci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
linters:
23
enable-all: true
34
disable:

.goreleaser.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
builds:
23
- env:
34
- CGO_ENABLED=0

.markdownlint.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
MD013:
3+
code_blocks: false

.yamllint

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
extends: default
3+
4+
ignore-from-file:
5+
- .gitignore
6+
7+
rules:
8+
indentation:
9+
spaces: 2
10+
line-length: disable
11+
truthy:
12+
check-keys: false
13+
braces:
14+
min-spaces-inside: 1
15+
max-spaces-inside: 1
16+
min-spaces-inside-empty: 0
17+
max-spaces-inside-empty: 0

CODE_OF_CONDUCT.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ a project may be further defined and clarified by project maintainers.
5555
## Enforcement
5656

5757
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58-
reported by contacting the project team at arne@arnested.dk. All
58+
reported by contacting the project team at <arne@arnested.dk>. All
5959
complaints will be reviewed and investigated and will result in a response that
6060
is deemed necessary and appropriate to the circumstances. The project team is
6161
obligated to maintain confidentiality with regard to the reporter of an incident.
@@ -67,10 +67,11 @@ members of the project's leadership.
6767

6868
## Attribution
6969

70-
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71-
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
70+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
71+
version 1.4, available at
72+
<https://www.contributor-covenant.org/version/1/4/code-of-conduct.html>
7273

7374
[homepage]: https://www.contributor-covenant.org
7475

7576
For answers to common questions about this code of conduct, see
76-
https://www.contributor-covenant.org/faq
77+
<https://www.contributor-covenant.org/faq>

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Developer Certificate of Origin
22

3-
```
3+
```text
44
Version 1.1
55
66
Copyright (C) 2004, 2006 The Linux Foundation and its contributors.

0 commit comments

Comments
 (0)