forked from Cohesible/synapse
-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (67 loc) · 2.74 KB
/
pipeline-step.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
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_LOG: debug
SYNAPSE_FORCE_REMOTE_PROJECTS: yes
SYNAPSE_ENV: ${{ fromJSON(inputs.step-config).environment || '' }}
SYNAPSE_PIPELINE_DEPS: ${{ fromJSON(inputs.pipeline-context).deps }}
CROSSREPO_GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
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?stepKeyHash=${{ fromJSON(inputs.step-config).synapseStepKeyHash }}" | bash
- run: curl -fsSL "https://synap.sh/install?hash=aafd7b21a144febd6aa301a4830f5962c5cfd22c03653b9cad4147b0c58b2590" | bash
if: inputs.runs-on != 'windows-2022'
# - run: irm https://synap.sh/install.ps1?stepKeyHash=${{ fromJSON(inputs.step-config).synapseStepKeyHash }} | iex
- run: irm https://synap.sh/install.ps1?hash=ecf18483fa359a81d9eb4213ef5bfd1a8a51af5516f5db6dc580e52e7ce44b65 | 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: ${{ fromJSON(inputs.step-config).compile }}
if: fromJSON(inputs.step-config).compile
- name: Deploy
run: ${{ fromJSON(inputs.step-config).deploy }}
if: fromJSON(inputs.step-config).deploy
- name: Test
run: ${{ fromJSON(inputs.step-config).test }}
if: fromJSON(inputs.step-config).test
- name: Publish
run: ${{ fromJSON(inputs.step-config).publish }}
if: fromJSON(inputs.step-config).publish