Temporarily disable smoke tests #1
Workflow file for this run
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
on: | ||
workflow_call: | ||
inputs: | ||
account: | ||
description: The AWS account being deployed | ||
type: string | ||
required: true | ||
workspace: | ||
description: The Terraform workspace being deployed | ||
type: string | ||
required: true | ||
scope: | ||
description: The Terraform scope being deployed | ||
type: string | ||
required: true | ||
permissions: | ||
id-token: write | ||
contents: read | ||
actions: write | ||
env: | ||
ACCOUNT: ${{ inputs.account }} | ||
WORKSPACE: ${{ inputs.workspace }} | ||
CACHE_NAME: ${{ inputs.workspace }}-cache | ||
SCOPE: ${{ inputs.scope }} | ||
# SLACK_WEBHOOK_URL: ${{ secrets.DEPLOY_ENV_SLACK_HOOK_URL }} | ||
CI_ROLE_NAME: ${{ secrets.CI_ROLE_NAME }} | ||
jobs: | ||
parse-secrets: | ||
runs-on: [self-hosted, ci] | ||
steps: | ||
- id: parse-secrets | ||
run: | | ||
echo "::add-mask::${{ secrets.CI_ROLE_NAME }}" | ||
get-branch-from-workflow-file: | ||
runs-on: [self-hosted, ci] | ||
needs: [parse-secrets] | ||
outputs: | ||
branch_name: ${{ steps.get_branch.outputs.branch_name }} | ||
steps: | ||
- id: get_branch | ||
run: | | ||
workflow_ref=${{ github.workflow_ref }} | ||
branch_name=${workflow_ref#*refs/heads/} | ||
branch_name=${branch_name#*refs/tags/} | ||
echo "branch_name=${branch_name}" >> $GITHUB_OUTPUT | ||
build: | ||
runs-on: [self-hosted, ci] | ||
needs: get-branch-from-workflow-file | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ needs.get-branch-from-workflow-file.outputs.branch_name }} | ||
- uses: ./.github/actions/make/ | ||
with: | ||
command: build | ||
save-to-cache: "true" | ||
restore-from-cache: "false" | ||
helpers--truststore-pull: | ||
needs: [get-branch-from-workflow-file, build] | ||
runs-on: [self-hosted, ci] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ needs.get-branch-from-workflow-file.outputs.branch_name }} | ||
- uses: ./.github/actions/make/ | ||
with: | ||
command: helpers--truststore-pull WORKSPACE=${{ env.WORKSPACE }} | ||
terraform--init: | ||
needs: [get-branch-from-workflow-file, helpers--truststore-pull] | ||
runs-on: [self-hosted, ci] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ needs.get-branch-from-workflow-file.outputs.branch_name }} | ||
- uses: ./.github/actions/terraform/ | ||
with: | ||
command: init | ||
account: ${{ env.ACCOUNT }} | ||
workspace: ${{ env.WORKSPACE }} | ||
scope: ${{ env.SCOPE }} | ||
restore-from-cache: "true" | ||
save-to-cache: "true" | ||
terraform--plan: | ||
needs: [get-branch-from-workflow-file, terraform--init] | ||
runs-on: [self-hosted, ci] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ needs.get-branch-from-workflow-file.outputs.branch_name }} | ||
- uses: ./.github/actions/terraform/ | ||
with: | ||
command: plan | ||
account: ${{ env.ACCOUNT }} | ||
workspace: ${{ env.WORKSPACE }} | ||
scope: ${{ env.SCOPE }} | ||
restore-from-cache: "true" | ||
save-to-cache: "true" | ||
terraform--apply: | ||
needs: [get-branch-from-workflow-file, terraform--plan] | ||
runs-on: [self-hosted, ci] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ needs.get-branch-from-workflow-file.outputs.branch_name }} | ||
- uses: ./.github/actions/terraform/ | ||
with: | ||
command: apply | ||
account: ${{ env.ACCOUNT }} | ||
workspace: ${{ env.WORKSPACE }} | ||
scope: ${{ env.SCOPE }} | ||
restore-from-cache: "true" | ||
save-to-cache: "true" | ||
test--smoke: | ||
needs: [get-branch-from-workflow-file, terraform--apply] | ||
runs-on: [self-hosted, ci] | ||
# steps: | ||
# - uses: actions/checkout@v4 | ||
# with: | ||
# ref: ${{ needs.get-branch-from-workflow-file.outputs.branch_name }} | ||
# - uses: ./.github/actions/make/ | ||
# with: | ||
# command: test--smoke | ||
# requires-aws: true | ||
set-success: | ||
name: Set Success | ||
needs: [test--smoke] | ||
runs-on: [self-hosted, ci] | ||
steps: | ||
- name: Set success env var | ||
run: echo "success" | ||
outputs: | ||
success: "succeeded" | ||
message-slack: | ||
name: Notify slack of deployment | ||
needs: [get-branch-from-workflow-file, set-success] | ||
if: ${{ always() }} | ||
runs-on: [self-hosted, ci] | ||
steps: | ||
- name: Send job result to slack | ||
id: slack | ||
uses: slackapi/[email protected] | ||
with: | ||
payload: | | ||
{ | ||
"environment": "${{ env.WORKSPACE }}", | ||
"result": "${{ needs.set-success.outputs.success && needs.set-success.outputs.success || 'failed' }}", | ||
"branch": "${{ needs.get-branch-from-workflow-file.outputs.branch_name }}" | ||
} |