pipeline-step_8254227754 #34
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: pipeline-step | |
run-name: pipeline-step_${{ inputs.dispatch-id }} | |
on: | |
workflow_dispatch: | |
inputs: | |
dispatch-id: | |
type: string | |
required: true | |
pipeline-context: | |
type: string | |
default: "{}" | |
step-config: | |
type: string | |
default: "{}" | |
runs-on: | |
type: string | |
default: ubuntu-latest | |
jobs: | |
execute: | |
runs-on: ${{ inputs.runs-on }} | |
permissions: | |
id-token: write | |
contents: read | |
defaults: | |
run: | |
working-directory: ${{ fromJSON(inputs.step-config).workingDir || '.' }} | |
env: | |
SYNAPSE_FORCE_REMOTE_PROJECTS: yes | |
SYNAPSE_ENV: ${{ fromJSON(inputs.step-config).environment || 'local' }} | |
SYNAPSE_PIPELINE_DEPS: ${{ fromJSON(inputs.pipeline-context).deps }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ fromJSON(inputs.pipeline-context).targetCommit }} | |
- name: Configure AWS credentials | |
if: fromJSON(inputs.step-config).inputs.useAws | |
uses: aws-actions/configure-aws-credentials@v2 | |
with: | |
aws-region: us-west-2 | |
role-to-assume: ${{ secrets.TEST_IAM_ROLE }} | |
- uses: Cohesible/get-credentials-action@09824e319b5811b924cfbdd208129f2681127ee4 | |
- run: curl -fsSL "https://synap.sh/install?hash=0a7fbd504f539e53027bbe59f53f7b6c820fd2ec370dabd14b38aec8fdbc06d5" | bash | |
if: inputs.runs-on != 'windows-2022' | |
- run: irm https://synap.sh/install.ps1 | iex | |
if: inputs.runs-on == 'windows-2022' | |
- run: synapse --version | |
- name: System Dependencies | |
run: sudo apt-get update -y && sudo apt-get install ${{ fromJSON(inputs.step-config).systemDeps }} -y | |
if: fromJSON(inputs.step-config).systemDeps && startsWith(inputs.runs-on, 'ubuntu') | |
- run: ${{ fromJSON(inputs.step-config).commands }} | |
if: fromJSON(inputs.step-config).commands | |
- name: Compile | |
run: synapse compile | |
if: fromJSON(inputs.step-config).publish || fromJSON(inputs.step-config).test | |
- name: Deploy | |
run: synapse deploy | |
if: fromJSON(inputs.step-config).deploy | |
- name: Test | |
run: ${{ fromJSON(inputs.step-config).test }} | |
if: fromJSON(inputs.step-config).test | |
- name: Publish | |
run: synapse publish --remote --ref ${{ fromJSON(inputs.pipeline-context).stepKeyHash }} | |
if: fromJSON(inputs.step-config).publish | |
- name: Clean-up | |
run: synapse destroy || true | |
if: always() && fromJSON(inputs.step-config).inputs.destroyAfter | |
- name: Test inputs | |
run: echo "${{ fromJSON(inputs.step-config).inputs.foo }}" | |
if: fromJSON(inputs.step-config).inputs.foo |