-
Notifications
You must be signed in to change notification settings - Fork 139
53 lines (52 loc) · 1.35 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
on:
pull_request:
paths-ignore:
- 'README.md'
- 'CHANGELOG.md'
- 'LICENSE'
push:
paths-ignore:
- 'README.md'
- 'CHANGELOG.md'
- 'LICENSE'
name: Test
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # needed for `only-new-issues` to compare diffs
- name: install go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: go1.20-${{ hashFiles('**/go.sum') }}
- name: Vet
run: go vet ./...
- name: setup Terraform
uses: hashicorp/setup-terraform@v3
- name: write Terraform configuration
run: |
cat > main.tf <<EOF
terraform {
required_providers {
cloudflare = {
source = "cloudflare/cloudflare"
version = "~> 4"
}
}
}
EOF
- name: terraform init
run: terraform init
- name: go test
env:
CLOUDFLARE_EMAIL: [email protected]
CLOUDFLARE_API_KEY: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
CLOUDFLARE_TERRAFORM_INSTALL_PATH: ${{ github.workspace }}
run: make test