-
Notifications
You must be signed in to change notification settings - Fork 41
61 lines (59 loc) · 1.84 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
on:
pull_request:
paths-ignore:
- '*.md'
- 'docs/**'
push:
paths-ignore:
- '*.md'
- 'docs/**'
branches:
- main
- release-*
schedule:
- cron: "0 11 * * 1-5"
jobs:
lint:
name: Linting
if: "!contains(github.event.head_commit.message, '[skip ci]')"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: hashicorp/setup-terraform@v3
with:
terraform_version: 1.8.1
- name: 'Terraform Format'
run: terraform fmt -check -recursive
- name: 'Terraform Init cluster'
run: terraform init
working-directory: 'examples/cluster'
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
role-skip-session-tagging: true
- name: 'Terraform Validate cluster'
run: terraform validate
working-directory: 'examples/cluster'
cluster-test:
name: Test cluster module
if: "!contains(github.event.head_commit.message, '[skip ci]')"
runs-on: ubuntu-latest
steps:
- name: 'Checkout'
uses: actions/checkout@main
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
role-skip-session-tagging: true
- name: 'Terratest'
uses: ./.github/actions/terratest
with:
args: "-run TestTerraformAwsEksCluster"