-
Notifications
You must be signed in to change notification settings - Fork 2
78 lines (68 loc) · 2.2 KB
/
checks.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
70
71
72
73
74
75
76
77
78
name: Main
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
check:
name: Checks
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
go-version: ${{ fromJson(inputs.go-version || '["1.22.x"]') }}
may-fail: [ false ]
env:
GO_VERSION: ${{ matrix.go-version }}
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up Go release
if: env.GO_VERSION != 'tip'
uses: actions/setup-go@v3
with:
go-version: '1.22'
check-latest: true
- name: Install development tools
run: make init
- name: Check build
run: make build
- name: Check files are formatted and no source code changes
run: |
make format
pushd tools && go mod tidy -v
popd && go mod tidy -v
git status
git diff --exit-code
- name: Run check-license
run: |
# run license checker on configured files
bin/license-eye -c .licenserc.yaml header check
- name: Run go-sumtype
run: bin/go-sumtype ./...
- name: Run linters
run: |
# use GITHUB_TOKEN because only it has access to GitHub Checks API
bin/golangci-lint run --out-format=line-number | env REVIEWDOG_GITHUB_API_TOKEN=${{ secrets.GITHUB_TOKEN }} bin/reviewdog -f=golangci-lint -reporter=github-pr-review -filter-mode=nofilter -fail-on-error=true
- name: Check default main state - dev version
run: |
if ! grep -q "VERSION ?= 0.0.0" Makefile; then
echo "default VERSION in Makefile should be 0.0.0"
exit 1
fi
- name: Check default main state - generated files
run: |
make release
echo "Checking there is no source code changes except of the file with the generated date after a release attempt"
git diff --exit-code $(git ls-files | grep -v "bundle/manifests/everest-operator.clusterserviceversion.yaml")
- name: Run debug commands on failure
if: ${{ failure() }}
run: |
env
go version
go env
pwd
git status