Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 10 additions & 15 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@ jobs:

- uses: ./.github/actions/cue
with:
data-file: dev/config-empty.yml
data-file: terraform/tests/config-empty.yml
schema-file: config.cue

- uses: ./.github/actions/cue
with:
data-file: dev/config-aws.yml
data-file: terraform/tests/config-aws.yml
schema-file: config.cue

- uses: ./.github/actions/cue
with:
data-file: dev/config-gc.yml
data-file: terraform/tests/config-gc.yml
schema-file: config.cue

empty:
Expand All @@ -37,10 +37,9 @@ jobs:
run:
working-directory: terraform
env:
TARGET: ${{ github.job }}
CONFIG: ../dev/config-${{ github.job }}.yml
PLAN_RESOURCES_JSON_PATH: /tmp/${{ github.job }}_plan_resources.json
APPLY_OUTPUT_JSON_PATH: /tmp/${{ github.job }}_apply_output.json
CONFIG: tests/config-empty.yml
PLAN_RESOURCES_JSON_PATH: /tmp/empty_plan_resources.json
APPLY_OUTPUT_JSON_PATH: /tmp/empty_apply_output.json

steps:
- uses: actions/checkout@v6
Expand Down Expand Up @@ -74,18 +73,14 @@ jobs:
env:
HCP_TERRAFORM_TEAM_TOKEN: ${{ secrets.HCP_TERRAFORM_TEAM_TOKEN }}

- uses: ./.github/actions/cue
with:
data-file: ${{ env.PLAN_RESOURCES_JSON_PATH }}
schema-file: dev/${{ env.TARGET }}-plan.cue
- run: |
[ "$(cat ${{ env.PLAN_RESOURCES_JSON_PATH }})" = '[]' ]

- run: >
make -f commands.mk
CONFIG="${CONFIG}"
APPLY_OUTPUT_JSON_PATH=${APPLY_OUTPUT_JSON_PATH}
apply-output

- uses: ./.github/actions/cue
with:
data-file: ${{ env.APPLY_OUTPUT_JSON_PATH }}
schema-file: dev/${{ env.TARGET }}-apply.cue
- run: |
[ "$(cat ${{ env.APPLY_OUTPUT_JSON_PATH }})" = '{}' ]
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
name: check unsuitable commit of files
name: prevent config commit
on:
pull_request:
paths:
- config.yml
- '**/dev/**'
push:
paths:
- config.yml
- '**/dev/**'

jobs:
fail:
Expand Down
18 changes: 18 additions & 0 deletions terraform/tests/config-aws.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
terraform_cloud:
organization:
name: organization_84380
workspace: integration_tests
servers:
blue:
provider: aws
aws:
region: ap-northeast-1
compute: lightsail
lightsail:
availability_zone: a
blueprint_id: ubuntu_24_04
bundle_id: nano_3_0
applications:
- openvpn
clients:
- client0
5 changes: 5 additions & 0 deletions terraform/tests/config-empty.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
terraform_cloud:
organization:
name: organization_84380
workspace: integration_tests
servers:
24 changes: 24 additions & 0 deletions terraform/tests/config-gc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
terraform_cloud:
organization:
name: organization_84380
workspace: integration_tests
google_cloud:
project_id: tidy-interface-339810
servers:
green:
provider: gc
gc:
compute: gce
gce:
region: us-west1
zone: b
machine_type: e2-micro
image:
project: ubuntu-os-cloud
family: ubuntu-2204-lts
enable_ipv6: true
applications:
- openvpn
clients:
- client1
- client2