-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
85 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
name: Test Generated Project | ||
|
||
on: | ||
pull_request: | ||
types: [opened, synchronize] | ||
|
||
env: | ||
TERRAFORM_VERSION: "1.5.5" | ||
TFSEC_VERSION: "v1.28.1" | ||
|
||
jobs: | ||
test: | ||
name: Run Tests Generated Project | ||
strategy: | ||
matrix: | ||
node-version: [16.x, 18.x] | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout the repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: 'npm' | ||
|
||
- name: Cache Node npm | ||
uses: actions/cache@v3 | ||
with: | ||
path: node_modules | ||
key: ${{ runner.os }}-infrastructure-templates-node-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-infrastructure-templates | ||
- name: Install modules | ||
run: npm ci | ||
|
||
- name: Generate project | ||
run: . ./scripts/generateAdvancedAWS.sh | ||
|
||
- name: Checkout the repository | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.head_ref }} | ||
|
||
- name: Install Terraform | ||
uses: hashicorp/setup-terraform@v2 | ||
with: | ||
terraform_version: ${{ env.TERRAFORM_VERSION }} | ||
|
||
- name: Run Terraform format | ||
run: terraform fmt -recursive -check | ||
|
||
- name: Run tfsec linter | ||
id: tfsec | ||
uses: aquasecurity/[email protected] | ||
with: | ||
version: ${{ env.TFSEC_VERSION }} | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
nodejs 18.12.1 | ||
terraform 1.5.5 | ||
trivy 0.47.0 |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
const { | ||
applyTerraformAwsProvider, | ||
applyAwsIamUserAndGroup, | ||
applyAwsRegion, | ||
applyAwsSecurityGroup, | ||
applyAwsVpc, | ||
} = require('../dist/generators/addons/aws/modules/index.js'); | ||
const { applyAdvancedTemplate } = require('../dist/generators/addons/aws/advanced.js'); | ||
|
||
(async () => { | ||
const options = { projectName: 'aws-advanced-test'} | ||
|
||
await applyTerraformAwsProvider(options); | ||
await applyAwsRegion(options); | ||
await applyAwsVpc(options); | ||
await applyAwsSecurityGroup(options); | ||
await applyAwsIamUserAndGroup(options); | ||
await applyAdvancedTemplate(options); | ||
})(); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
yarn build | ||
node ./scripts/generateAdvancedAWS.js | ||
cd aws-advanced-test |