-
Notifications
You must be signed in to change notification settings - Fork 6
69 lines (60 loc) · 1.51 KB
/
go.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
59
60
61
62
63
64
65
66
67
68
69
name: go
on:
pull_request:
push:
branches:
- main
jobs:
changes:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
outputs:
go: ${{ steps.filter.outputs.go }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
go:
- 'contents/kubernetes-operator/**.go'
- .github/workflows/go.yml
- '**go**'
status-check-go:
runs-on: ubuntu-latest
needs:
- test
- golangci-lint
permissions: {}
if: failure()
steps:
- run: exit 1
test:
needs: changes
if: ${{ needs.changes.outputs.go == 'true' }}
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: setup go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: test
run: go test -coverprofile="coverage.txt" -covermode=atomic ./...
working-directory: contents/kubernetes-operator
- name: coverage
uses: codecov/codecov-action@v5
golangci-lint:
needs: changes
if: ${{ needs.changes.outputs.go == 'true' }}
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: golangci-lint
uses: reviewdog/action-golangci-lint@v2
with:
go_version_file: go.mod