-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (52 loc) · 1.52 KB
/
lint-test-code.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
name: Lint & Test Code
on:
push:
branches:
- "**"
- "!main"
- "!master"
env:
go_version: 1.22
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
lint-test-code:
name: Lint & Test Code
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: "${{ env.go_version }}"
- name: Setup Just
uses: extractions/setup-just@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install Dependencies
run: just setup-dev
- name: Run Code Linting Test
run: just lint >> "$GITHUB_STEP_SUMMARY"
- name: Check package files up to date
run: |
just tidy
git diff --exit-code -- pkg/config-api-client/go.* pkg/config-api-provider/go.*
- name: Run Tests
run: |
just test
just coverage
- name: Check Provider docs up to date
run: |
just generate-provider-docs
git diff --exit-code -- pkg/config-api-provider/docs
- name: Check Provider docs valid
run: just validate-provider-docs
- name: Upload Code Coverage Report
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./pkg/config-api-client/.coverage,./pkg/config-api-provider/.coverage
flage: client,provider
fail_ci_if_error: true