-
Notifications
You must be signed in to change notification settings - Fork 4
58 lines (52 loc) · 1.59 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: CI
on:
push:
branches: [ master ]
tags: [ v* ]
pull_request:
branches: [ master ]
env:
GO_VERSION: ^1.23
GOLANGCI_LINT_VERSION: v1.61.0
permissions:
contents: read
jobs:
go_install:
if: ${{ !github.event.pull_request.head.repo.fork }}
runs-on: ubuntu-latest
steps:
- uses: rlespinasse/github-slug-action@v4.4.1
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- run: cd /tmp && go install github.com/Antonboom/nilnil@${{ env.version }} && nilnil -h
env:
version: ${{ env.GITHUB_EVENT_PULL_REQUEST_HEAD_SHA || env.GITHUB_REF_SLUG }}
lint:
permissions:
contents: read # for actions/checkout to fetch code
pull-requests: read # for golangci/golangci-lint-action to fetch pull requests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- uses: golangci/golangci-lint-action@v6
with:
version: ${{ env.GOLANGCI_LINT_VERSION }}
args: --timeout=5m
test:
permissions:
checks: write # for shogo82148/actions-goveralls to create a new check based on the results
contents: read # for actions/checkout to fetch code
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- run: go test -coverprofile=coverage.out ./...
- uses: shogo82148/actions-goveralls@v1
with:
path-to-profile: coverage.out