-
Notifications
You must be signed in to change notification settings - Fork 0
118 lines (110 loc) · 2.93 KB
/
cd.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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
name: continuous-deployment
on:
push:
branches:
- main
env:
NODE_VERSION: 22.6.0
GO_VERSION: v1.22.0
GOLANGCI_LINT_VERSION: v1.59
GOPRIVATE: github.com/intercloud
TF_VERSION: 1.9.0
TF_MODULE_PATH: examples/autonomi
jobs:
markdown-lint:
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: set up node
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: install markdownlint-cli
run: npm install -g markdownlint-cli
- name: markdownlint
run: markdownlint '**/*.md'
go-mod-tidy:
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- name: set up gitconfig
uses: ./.github/actions/setup-gitconfig
with:
ORG_GITHUB_TOKEN: ${{ secrets.ORG_GITHUB_TOKEN }}
- name: go mod tidy
run: go mod tidy
golangci-lint:
runs-on: ubuntu-latest
needs:
- go-mod-tidy
steps:
- name: checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: ${{ env.GOLANGCI_LINT_VERSION }}
args: './...'
go-test:
runs-on: ubuntu-latest
needs:
- golangci-lint
steps:
- name: checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- name: go test
run: go test ./... -v
tf-validate:
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@v4
- name: set up terraform
uses: hashicorp/setup-terraform@v3
with:
terraform_version: ${{ env.TF_VERSION }}
- name: terraform init
working-directory: ${{ env.TF_MODULE_PATH }}
run: terraform init
- name: terraform validate
working-directory: ${{ env.TF_MODULE_PATH }}
run: terraform validate
tf-plan:
runs-on: ubuntu-latest
needs:
- tf-validate
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: set up terraform
uses: hashicorp/setup-terraform@v3
with:
terraform_version: ${{ env.TF_VERSION }}
- name: terraform plan
working-directory: ${{ env.TF_MODULE_PATH }}
run: terraform plan -out=tfplan
env:
TF_VAR_pat_token: ${{ secrets.TF_VAR_PAT_TOKEN }}
TF_VAR_aws_account_id: ${{ secrets.TF_VAR_AWS_ACCOUNT_ID }}