Skip to content

Commit ca8af97

Browse files
committed
update CI
1 parent 5e897d0 commit ca8af97

File tree

2 files changed

+40
-13
lines changed

2 files changed

+40
-13
lines changed

.github/dependabot.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,17 @@
11
version: 2
22

33
updates:
4-
- package-ecosystem: gomod
4+
- package-ecosystem: "github-actions"
5+
directory: "/"
6+
schedule:
7+
interval: "monthly"
8+
ignore:
9+
- dependency-name: "*"
10+
update-types:
11+
- "version-update:semver-minor"
12+
- "version-update:semver-patch"
13+
14+
- package-ecosystem: "gomod"
515
directory: "/"
616
schedule:
717
interval: "monthly"

.github/workflows/ci.yml

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,38 +3,55 @@ name: CI
33
on:
44
push:
55
branches: [ master ]
6+
tags: [ v* ]
67
pull_request:
78
branches: [ master ]
89

10+
env:
11+
GO_VERSION: ^1.20
12+
GOLANGCI_LINT_VERSION: v1.56.2
13+
14+
permissions:
15+
contents: read
16+
917
jobs:
1018
go_install:
19+
if: ${{ !github.event.pull_request.head.repo.fork }}
1120
runs-on: ubuntu-latest
1221
steps:
13-
- uses: rlespinasse/github-slug-action@v4
14-
- uses: actions/setup-go@v4
22+
- uses: rlespinasse/github-slug-action@v4.4.1
23+
- uses: actions/setup-go@v5
1524
with:
16-
go-version: ^1.21
17-
- run: cd /tmp && go install github.com/Antonboom/nilnil@${{ env.GITHUB_REF_NAME }} && nilnil -h
25+
go-version: ${{ env.GO_VERSION }}
26+
- run: cd /tmp && go install github.com/Antonboom/nilnil@${{ env.version }} && nilnil -h
27+
env:
28+
version: ${{ env.GITHUB_EVENT_PULL_REQUEST_HEAD_SHA || env.GITHUB_REF_SLUG }}
1829

1930
lint:
31+
permissions:
32+
contents: read # for actions/checkout to fetch code
33+
pull-requests: read # for golangci/golangci-lint-action to fetch pull requests
2034
runs-on: ubuntu-latest
2135
steps:
22-
- uses: actions/setup-go@v4
36+
- uses: actions/setup-go@v5
2337
with:
24-
go-version: '1.21'
25-
- uses: actions/checkout@v3
38+
go-version: ${{ env.GO_VERSION }}
39+
- uses: actions/checkout@v4
2640
- uses: golangci/golangci-lint-action@v3
2741
with:
28-
version: v1.54.0
42+
version: ${{ env.GOLANGCI_LINT_VERSION }}
2943
args: --timeout=5m
3044

31-
tests:
45+
test:
46+
permissions:
47+
checks: write # for shogo82148/actions-goveralls to create a new check based on the results
48+
contents: read # for actions/checkout to fetch code
3249
runs-on: ubuntu-latest
3350
steps:
34-
- uses: actions/setup-go@v4
51+
- uses: actions/setup-go@v5
3552
with:
36-
go-version: ^1.21
37-
- uses: actions/checkout@v3
53+
go-version: ${{ env.GO_VERSION }}
54+
- uses: actions/checkout@v4
3855
- run: go test -coverprofile=coverage.out ./...
3956
- uses: shogo82148/actions-goveralls@v1
4057
with:

0 commit comments

Comments
 (0)