Skip to content

Commit

Permalink
feat: add logging to pulumi and output directory artifact for all tes…
Browse files Browse the repository at this point in the history
…t steps
  • Loading branch information
acrois committed Feb 4, 2024
1 parent a8c27f8 commit 6b8038b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,9 @@ jobs:
run: pip install awscli pulumi-local terraform-local awscli-local
- name: Execute Script
run: ./${{ matrix.script }}
- name: Upload Output
if: always()
uses: actions/upload-artifact@v4
with:
name: output
path: ./output
2 changes: 2 additions & 0 deletions output/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*
!.gitignore
11 changes: 9 additions & 2 deletions tests/pulumi_bucket.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,16 @@ if (!pulumiVersion) throw 'Invalid Pulumi version.'

await $`ls`
await $`pulumi login --local`
await $`pulumi stack select dev`
const pulumiStackResult = await $`pulumi stack select dev`
if (pulumiStackResult.exitCode !== 0) throw pulumiStackResult.stderr.toString()

const pulumiResults = await $`pulumi up --tracing=file:../output/pulumi-up.trace -v 11 -s dev --yes --non-interactive --logtostderr --logflow`

const resultsOut = pulumiResults.stdout.toString()
await Bun.write('../output/pulumi-up_stdout.log', resultsOut);
const resultsErr = pulumiResults.stderr.toString()
await Bun.write('../output/pulumi-up_stderr.log', resultsErr);

const pulumiResults = await $`pulumi up -v 11 -s dev --yes --non-interactive`
if (pulumiResults.exitCode !== 0) throw pulumiResults.stderr.toString()

const bucketName = (await $`pulumi stack output bucket_name`.text()).trim()
Expand Down

0 comments on commit 6b8038b

Please sign in to comment.