-
Notifications
You must be signed in to change notification settings - Fork 0
113 lines (96 loc) · 2.67 KB
/
pipeline.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
name: Continous Integration
on: [ push, pull_request ]
env:
CARGO_TERM_COLOR: always
GOOGLE_CREDENTIALS: ${{ secrets.GOOGLE_CREDENTIALS }}
jobs:
check:
name: Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ./.github/workflows/rust-cargo
with:
command: check
test:
name: Run Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ./.github/workflows/rust-cargo
with:
command: test
fmt:
name: Format Code
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ./.github/workflows/rust-cargo
with:
command: fmt
args: --all -- --check
clippy:
name: Lint Code
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ./.github/workflows/rust-cargo
with:
command: clippy
args: -- -D warnings
codecov:
name: Codecov
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ./.github/workflows/rust-codecov
with:
codecov_token: ${{ secrets.CODECOV_TOKEN }}
audit:
name: Audit Codebase
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: sudo apt install libssl-dev
- uses: ./.github/workflows/rust-cargo
with:
command: install
args: cargo-audit
- uses: ./.github/workflows/rust-cargo
with:
command: audit
validate-infra:
name: Validate Infrastructure
runs-on: ubuntu-latest
needs: [ check, test, fmt, clippy, codecov, audit ]
if: success()
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Install Terraform
uses: hashicorp/setup-terraform@v1
with:
terraform_version: 1.1.7
- name: Terraform Init
run: terraform -chdir=infrastructure init
- name: Terraform Format
run: terraform -chdir=infrastructure fmt -check
- name: Terraform Validate
run: terraform -chdir=infrastructure validate
deploy-sit:
name: Deploy SIT
runs-on: ubuntu-latest
needs: validate-infra
if: success() && github.ref == 'refs/heads/master' && github.event_name == 'push'
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Install Terraform
uses: hashicorp/setup-terraform@v1
with:
terraform_version: 1.1.7
- name: Terraform Init
run: terraform -chdir=infrastructure init
- name: Terraform Plan SIT
id: plan
run: terraform -chdir=infrastructure apply -auto-approve -var-file=env/dev.tfvars