Skip to content

Test example positive #63

Test example positive

Test example positive #63

Workflow file for this run

name: Test example positive
on:
# # Uncomment when test added first time to register workflow and comment it back after workflow would be registered
# #
# # Added pull_request to register workflow from the PR.
# # Read more https://stackoverflow.com/questions/63362126/github-actions-how-to-run-a-workflow-created-on-a-non-master-branch-from-the-wo
# pull_request: {}
workflow_dispatch:
inputs:
ref:
description: "The fully-formed ref of the branch or tag that triggered the workflow run"
required: false
type: "string"
sha:
description: "The sha of the commit that triggered the workflow run"
required: false
type: "string"
permissions:
contents: write
id-token: write
jobs:
setup:
runs-on: ubuntu-latest
steps:
- name: Setup
run: echo "Do setup"
- id: random
uses: aammirmirza/RandomPasswordGenerator@1.2
with:
length: 15
outputs:
random: ${{ steps.random.outputs.password }}
test:
runs-on: ubuntu-latest
continue-on-error: true
needs: [setup]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v6.2.0
with:
aws-region: ${{ secrets.TEST_AWS_REGION }}
role-to-assume: ${{ secrets.TEST_IAM_ROLE }}
role-skip-session-tagging: true
- uses: ./
id: current
with:
stack: plat-ue2-sandbox-test-github-action
region: us-east-2
ssm-path: /test-github-action/image
image: nginx
image-tag: ${{ needs.setup.outputs.random }}
webapp-output-name: full_host
organization: ${{ secrets.SPACELIFT_ORGANZATION }}
github_token: ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }}
api_key_id: ${{ secrets.SPACELIFT_API_KEY_ID }}
api_key_secret: ${{ secrets.SPACELIFT_API_KEY_SECRET }}
outputs:
result: ${{ steps.current.outputs.webapp-url }}
assert:
runs-on: ubuntu-latest
needs: [setup, test]
steps:
- uses: nick-fields/assert-action@v1
with:
expected: "https://nginx:${{ needs.setup.outputs.random }}"
actual: "${{ needs.test.outputs.result }}"
teardown:
runs-on: ubuntu-latest
needs: [assert]
if: ${{ always() }}
steps:
- name: Tear down
run: echo "Do Tear down"