-
Notifications
You must be signed in to change notification settings - Fork 4
93 lines (79 loc) · 2.13 KB
/
quality.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
name: Code quality
on:
push:
branches:
- main
pull_request:
branches:
- main
types:
- opened
- synchronize
- reopened
- ready_for_review
workflow_dispatch: {}
env:
GO_VERSION: 1.21
jobs:
docs-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{env.GO_VERSION}}
- name: Check for spelling errors
run: make misspell
- name: Check HCL format
run: make terrafmt
code-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{env.GO_VERSION}}
- name: Check code format
run: make fmtcheck
- name: Lint code
run: make go-lint
dependencies:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{env.GO_VERSION}}
- name: run depscheck
run: make depscheck
unit-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{env.GO_VERSION}}
- name: run unit tests
run: make test
integration-tests:
if: ${{ ! github.event.pull_request.draft && github.actor != 'dependabot[bot]' }}
runs-on: ubuntu-latest
needs: unit-tests
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{env.GO_VERSION}}
- name: run integration tests and post coverage to codeclimate
uses: paambaati/[email protected]
env:
ANEXIA_LOCATION_ID: 52b5f6b2fd3a4a7eaaedf1a7c019e9ea
ANEXIA_VLAN_ID: 00a239d617504e4ab49122efe0d27657
ANEXIA_TOKEN: ${{ secrets.ANEXIA_TOKEN }}
CC_TEST_REPORTER_ID: ${{ secrets.CODECLIMATE_COVERAGE_ID }}
# poor girls ternary operator
TESTARGS: ${{ (github.ref_type != 'tag' && github.ref_name != 'main') && '-short' || '' }}
with:
prefix: github.com/anexia-it/terraform-provider-anxcloud
coverageCommand: make testacc
coverageLocations: coverage.out:gocov