chore: adds terraform to devcontainer environment #154
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: 'build-test' | |
on: # rebuild any PRs and main branch changes | |
pull_request: | |
push: | |
branches: | |
- main | |
- 'releases/*' | |
jobs: | |
build: # make sure build/ci work properly | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- run: | | |
npm install | |
- run: | | |
npm run all | |
test-existing-sg: | |
runs-on: ubuntu-latest | |
if: github.repository_owner == 'sonikro' | |
permissions: | |
contents: read | |
id-token: write | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: ./ | |
with: | |
role_arn: "${{secrets.TEST_ROLE_ARN}}" | |
image: hashicorp/terraform:latest | |
region: us-east-1 | |
vpc_id: "${{secrets.TEST_VPC_ID}}" | |
subnet_ids: | | |
${{secrets.TEST_SUBNET_ID}} | |
security_group_id: sg-04d5dfcb3fcd1285b | |
shell: sh | |
run: | | |
ls -la | |
terraform -v | |
echo "Hello World. I am ${{github.repository}}" | |
echo "Testing $GITHUB_REPOSITORY variable" | |
test-new-sg: | |
runs-on: ubuntu-latest | |
if: github.repository_owner == 'sonikro' | |
permissions: | |
contents: read | |
id-token: write | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: ./ | |
with: | |
role_arn: "${{secrets.TEST_ROLE_ARN}}" | |
image: hashicorp/terraform:latest | |
region: us-east-1 | |
vpc_id: "${{secrets.TEST_VPC_ID}}" | |
subnet_ids: | | |
${{secrets.TEST_SUBNET_ID}} | |
shell: sh | |
run: | | |
ls -la | |
terraform -v | |
echo "Hello World. I am ${{github.repository}}" | |
echo "Testing $GITHUB_REPOSITORY variable" | |
test-auto-subnet-ids: | |
runs-on: ubuntu-latest | |
if: github.repository_owner == 'sonikro' | |
permissions: | |
contents: read | |
id-token: write | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: ./ | |
with: | |
role_arn: "${{secrets.TEST_ROLE_ARN}}" | |
image: hashicorp/terraform:latest | |
region: us-east-1 | |
vpc_id: "${{secrets.TEST_VPC_ID}}" | |
shell: sh | |
run: | | |
ls -la | |
terraform -v | |
echo "Hello World. I am ${{github.repository}}" | |
echo "Testing $GITHUB_REPOSITORY variable" | |
test-workspace-sync: | |
runs-on: ubuntu-latest | |
if: github.repository_owner == 'sonikro' | |
permissions: | |
contents: read | |
id-token: write | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: ./ | |
with: | |
role_arn: "${{secrets.TEST_ROLE_ARN}}" | |
image: alpine | |
region: us-east-1 | |
vpc_id: "${{secrets.TEST_VPC_ID}}" | |
shell: sh | |
run: | | |
ls -la | |
echo "ecs generated contend" > testfile.txt | |
- shell: bash | |
run: | | |
if [ -f "testfile.txt" ]; | |
then | |
cat testfile.txt | |
else | |
echo "testfile is missing" | |
exit 1 | |
fi |