Skip to content

chore: add dependabot configuration #10

chore: add dependabot configuration

chore: add dependabot configuration #10

name: Test terraform-new/destroy-workspace
on: [pull_request]
jobs:
create_workspace_12:
runs-on: ubuntu-latest
name: Workspace tests 0.12
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Create first workspace
uses: ./terraform-new-workspace
with:
path: tests/new-workspace/remote_12
workspace: my-first-workspace
- name: Create first workspace again
uses: ./terraform-new-workspace
with:
path: tests/new-workspace/remote_12
workspace: my-first-workspace
- name: Apply in first workspace
uses: ./terraform-apply
with:
path: tests/new-workspace/remote_12
workspace: my-first-workspace
var: my_string=hello
auto_approve: true
- name: Create a second workspace
uses: ./terraform-new-workspace
with:
path: tests/new-workspace/remote_12
workspace: ${{ github.head_ref }}
- name: Apply in second workspace
uses: ./terraform-apply
with:
path: tests/new-workspace/remote_12
workspace: ${{ github.head_ref }}
var: my_string=world
auto_approve: true
- name: Get first workspace outputs
uses: ./terraform-output
id: first_12
with:
path: tests/new-workspace/remote_12
workspace: my-first-workspace
- name: Get second workspace outputs
uses: ./terraform-output
id: second_12
with:
path: tests/new-workspace/remote_12
workspace: ${{ github.head_ref }}
- name: Verify outputs
run: |
if [[ "${{ steps.first_12.outputs.my_string }}" != "hello" ]]; then
echo "::error:: output my_string not set correctly for first workspace"
exit 1
fi
if [[ "${{ steps.second_12.outputs.my_string }}" != "world" ]]; then
echo "::error:: output my_string not set correctly for second workspace"
exit 1
fi
- name: Destroy first workspace
uses: ./terraform-destroy-workspace
with:
path: tests/new-workspace/remote_12
workspace: my-first-workspace
var: my_string=hello
- name: Destroy second workspace
uses: ./terraform-destroy-workspace
with:
path: tests/new-workspace/remote_12
workspace: ${{ github.head_ref }}
var: my_string=world
create_workspace_13:
runs-on: ubuntu-latest
name: Workspace tests 0.13
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Create first workspace
uses: ./terraform-new-workspace
with:
path: tests/new-workspace/remote_13
workspace: my-first-workspace
- name: Create first workspace again
uses: ./terraform-new-workspace
with:
path: tests/new-workspace/remote_13
workspace: my-first-workspace
- name: Apply in first workspace
uses: ./terraform-apply
with:
path: tests/new-workspace/remote_13
workspace: my-first-workspace
var: my_string=hello
auto_approve: true
- name: Create a second workspace
uses: ./terraform-new-workspace
with:
path: tests/new-workspace/remote_13
workspace: ${{ github.head_ref }}
- name: Apply in second workspace
uses: ./terraform-apply
with:
path: tests/new-workspace/remote_13
workspace: ${{ github.head_ref }}
var: my_string=world
auto_approve: true
- name: Get first workspace outputs
uses: ./terraform-output
id: first_13
with:
path: tests/new-workspace/remote_13
workspace: my-first-workspace
- name: Get second workspace outputs
uses: ./terraform-output
id: second_13
with:
path: tests/new-workspace/remote_13
workspace: ${{ github.head_ref }}
- name: Verify outputs
run: |
if [[ "${{ steps.first_13.outputs.my_string }}" != "hello" ]]; then
echo "::error:: output my_string not set correctly for first workspace"
exit 1
fi
if [[ "${{ steps.second_13.outputs.my_string }}" != "world" ]]; then
echo "::error:: output my_string not set correctly for second workspace"
exit 1
fi
- name: Destroy first workspace
uses: ./terraform-destroy-workspace
with:
path: tests/new-workspace/remote_13
workspace: my-first-workspace
var: my_string=hello
- name: Destroy second workspace
uses: ./terraform-destroy-workspace
with:
path: tests/new-workspace/remote_13
workspace: ${{ github.head_ref }}
var: my_string=world