-
Notifications
You must be signed in to change notification settings - Fork 39
75 lines (61 loc) · 1.75 KB
/
test.yaml
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
name: Validate Terraform code
on:
push:
branches:
- '*'
pull_request:
branches:
- main
jobs:
test:
env:
TF_VERSION: 1.2.1
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@main
- name: Cache Terraform
id: cache-terraform
uses: actions/cache@v2
with:
path: ~/bin
key: terraform-${{ env.TF_VERSION }}
- name: Download terraform
if: steps.cache-terraform.outputs.cache-hit != 'true'
run: |
mkdir -p "${HOME}/bin"
curl -sSL -o terraform.zip "https://releases.hashicorp.com/terraform/${TF_VERSION}/terraform_${TF_VERSION}_linux_amd64.zip"
unzip terraform.zip
mv -v terraform "${HOME}/bin/terraform"
~/bin/terraform version
- name: Create SSH keys
run: |
ssh-keygen -b 2048 -t rsa -q -N "" -f ~/.ssh/id_rsa
- name: Test AWS
uses: ./.github/actions/test_provider
with:
provider: 'aws'
- name: Test Azure
uses: ./.github/actions/test_provider
with:
provider: 'azure'
- name: Test GCP
uses: ./.github/actions/test_provider
with:
provider: 'gcp'
- name: Test OpenStack
uses: ./.github/actions/test_provider
with:
provider: 'openstack'
- name: Test OVH
uses: ./.github/actions/test_provider
with:
provider: 'ovh'
- name: Test CloudFlare DNS
run: |
terraform -chdir=dns/cloudflare init
terraform -chdir=dns/cloudflare validate
- name: Test Google Cloud DNS
run: |
terraform -chdir=dns/gcloud init
terraform -chdir=dns/gcloud validate