-
Notifications
You must be signed in to change notification settings - Fork 16
74 lines (61 loc) · 2.06 KB
/
checks.yaml
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
70
71
72
73
74
name: Checks
on:
push:
branches:
- main
pull_request:
branches:
- main
permissions:
contents: read
jobs:
Checks:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit
disable-telemetry: true
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup Go environment
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
with:
cache: true
go-version-file: go.mod
cache-dependency-path: '**/go.sum'
- name: Check go versions
uses: enterprise-contract/github-workflows/golang-version-check@main
- name: Test
run: make test
- name: Upload unit test coverage report
uses: codecov/codecov-action@7f8b4b4bde536c465e797be725718b88c5d95e0e # v5.1.1
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
files: ./cover.out
flags: controller
- name: Upload api test coverage report
uses: codecov/codecov-action@7f8b4b4bde536c465e797be725718b88c5d95e0e # v5.1.1
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
files: ./api_cover.out
flags: api
- name: Upload schema test coverage report
uses: codecov/codecov-action@7f8b4b4bde536c465e797be725718b88c5d95e0e # v5.1.1
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
files: ./schema_cover.out
flags: schema
# If enterprisecontractpolicy_types.go is updated without a corresponding change to the crd
# an uncommitted change can show.
- name: Check for uncommitted changes
run: |
if ! git diff --exit-code -s; then
for f in $(git diff --exit-code --name-only); do
echo "::error file=$f,line=1,col=1,endColumn=1::File was modified in build"
done
exit 1
fi