Skip to content

Commit 4f50ee4

Browse files
committed
Add a GitHub Action to run the provider with a test domain
- With a test domain and a separate account: `lychee.systems`.
1 parent 91f053e commit 4f50ee4

File tree

2 files changed

+59
-0
lines changed

2 files changed

+59
-0
lines changed

.github/workflows/acceptance.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Real Provider Tests
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
test:
7+
runs-on: ubuntu-latest
8+
env:
9+
IMPROVMX_API_TOKEN: ${{ secrets.IMPROVMX_TF_TEST }}
10+
steps:
11+
- uses: actions/checkout@v3
12+
13+
- uses: actions/setup-go@v2
14+
with:
15+
go-version: 1.18
16+
- run: |
17+
go mod download
18+
go build .
19+
20+
- uses: hashicorp/setup-terraform@v1
21+
- run: |
22+
cat <<~EOF >> ~/.terraformrc
23+
provider_installation {
24+
dev_overrides {
25+
"issyl0/improvmx" = "/home/runner/work/terraform-provider-improvmx/terraform-provider-improvmx"
26+
}
27+
}
28+
~EOF
29+
30+
- name: plan
31+
run: terraform plan
32+
working-directory: tests/acceptance/
33+
34+
- name: apply
35+
run: terraform apply -auto-approve
36+
working-directory: tests/acceptance/
37+
38+
- name: import
39+
run: |
40+
terraform state rm improvmx_domain.lychee
41+
terraform import improvmx_domain.lychee lychee.systems
42+
working-directory: tests/acceptance/
43+
44+
- name: destroy
45+
run: terraform destroy -auto-approve
46+
working-directory: tests/acceptance/

tests/acceptance/main.tf

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
terraform {
2+
required_providers {
3+
improvmx = {
4+
source = "issyl0/improvmx"
5+
}
6+
}
7+
}
8+
9+
provider "improvmx" {}
10+
11+
resource "improvmx_domain" "lychee" {
12+
domain = "lychee.systems"
13+
}

0 commit comments

Comments
 (0)