chore: add dependabot configuration #6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test remote backend | |
on: [pull_request] | |
jobs: | |
workspaces: | |
runs-on: ubuntu-latest | |
name: Workspace management | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Create a new workspace with no existing workspaces | |
uses: ./terraform-new-workspace | |
with: | |
path: tests/terraform-cloud | |
workspace: ${{ github.head_ref }}-1 | |
backend_config: "token=${{ secrets.TF_API_TOKEN }}" | |
- name: Create a new workspace when it doesn't exist | |
uses: ./terraform-new-workspace | |
with: | |
path: tests/terraform-cloud | |
workspace: ${{ github.head_ref }}-2 | |
backend_config: "token=${{ secrets.TF_API_TOKEN }}" | |
- name: Create a new workspace when it already exists | |
uses: ./terraform-new-workspace | |
with: | |
path: tests/terraform-cloud | |
workspace: ${{ github.head_ref }}-2 | |
backend_config: "token=${{ secrets.TF_API_TOKEN }}" | |
- name: Auto apply workspace | |
uses: ./terraform-apply | |
with: | |
path: tests/terraform-cloud | |
workspace: ${{ github.head_ref }}-1 | |
backend_config: "token=${{ secrets.TF_API_TOKEN }}" | |
auto_approve: true | |
- name: Destroy workspace | |
uses: ./terraform-destroy-workspace | |
with: | |
path: tests/terraform-cloud | |
workspace: ${{ github.head_ref }}-1 | |
backend_config: "token=${{ secrets.TF_API_TOKEN }}" | |
- name: Plan workspace | |
uses: ./terraform-plan | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
path: tests/terraform-cloud | |
workspace: ${{ github.head_ref }}-2 | |
backend_config: "token=${{ secrets.TF_API_TOKEN }}" | |
- name: Apply workspace | |
uses: ./terraform-apply | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
path: tests/terraform-cloud | |
workspace: ${{ github.head_ref }}-2 | |
backend_config: "token=${{ secrets.TF_API_TOKEN }}" | |
- name: Destroy the last workspace | |
uses: ./terraform-destroy-workspace | |
with: | |
path: tests/terraform-cloud | |
workspace: ${{ github.head_ref }}-2 | |
backend_config: "token=${{ secrets.TF_API_TOKEN }}" | |
- name: Destroy non-existant workspace | |
uses: ./terraform-destroy-workspace | |
continue-on-error: true | |
id: destroy-non-existant-workspace | |
with: | |
path: tests/terraform-cloud | |
workspace: ${{ github.head_ref }}-1 | |
backend_config: "token=${{ secrets.TF_API_TOKEN }}" | |
- name: Check failed to destroy | |
run: | | |
if [[ "${{ steps.destroy-non-existant-workspace.outcome }}" != "failure" ]]; then | |
echo "Destroy non-existant workspace" | |
exit 1 | |
fi |