-
Notifications
You must be signed in to change notification settings - Fork 7
88 lines (82 loc) · 2.48 KB
/
ci.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
on:
pull_request: {}
push:
branches:
- master
jobs:
go:
runs-on: ubuntu-latest
strategy:
matrix:
go: ['1.18', '1.19', '1.20', '1.21']
name: Go ${{ matrix.go }} build
steps:
- uses: actions/checkout@master
- name: Setup go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
- run: go vet ./...
- run: |
output=$(go fmt ./...)
if [[ ! "$output" = "" ]]; then
printf "The following files are not go formatted:\n%s\n" "$output"
exit 1
fi
- run: go test -coverprofile=coverage.out ./...
- run: go tool cover -html=coverage.out -o coverage.html
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
args: -E golint
version: v1.51.1
if: matrix.go == '1.21'
- uses: actions/upload-artifact@v3
with:
name: coverage.html
path: coverage.html
if: matrix.go == '1.21'
- run: make hallow.zip
- uses: actions/upload-artifact@v3
with:
name: hallow.zip
path: hallow.zip
if: matrix.go == '1.21'
terraform:
runs-on: ubuntu-latest
strategy:
matrix:
terraform: ['latest']
name: Terraform ${{ matrix.terraform }}
steps:
- uses: actions/checkout@master
- name: terraform fmt
uses: hashicorp/terraform-github-actions@v0.8.0
with:
tf_actions_version: ${{ matrix.terraform }}
tf_actions_subcommand: 'fmt'
tf_actions_working_dir: 'terraform/'
tf_actions_comment: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: terraform init
uses: hashicorp/terraform-github-actions@v0.8.0
with:
tf_actions_version: ${{ matrix.terraform }}
tf_actions_subcommand: 'init'
tf_actions_working_dir: 'terraform/'
tf_actions_comment: true
args: '-backend=false'
env:
AWS_DEFAULT_REGION: "us-east-1"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: terraform validate
uses: hashicorp/terraform-github-actions@v0.8.0
with:
tf_actions_version: ${{ matrix.terraform }}
tf_actions_subcommand: 'validate'
tf_actions_working_dir: 'terraform/'
tf_actions_comment: true
env:
AWS_DEFAULT_REGION: "us-east-1"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}