-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathaction.yml
More file actions
92 lines (85 loc) · 3.6 KB
/
action.yml
File metadata and controls
92 lines (85 loc) · 3.6 KB
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
82
83
84
85
86
87
88
89
90
91
92
name: Install requirements
description: Setup Python and/or Node, and install dependencies based on the devcontainer specification
inputs:
python-version:
type: string
description: Python version to install
required: false # if this is set, then assume you want python dependencies installed
default: 'notUsing'
node-version:
type: string
description: Node version to install
required: false # if this is set, then assume you want node dependencies installed
default: 'notUsing'
install-deps:
required: false
default: true
type: boolean
description: Whether to run the setup-deps script, or just to setup basic CI tooling
skip-installing-ssm-plugin-manager:
required: false
default: false
type: boolean
description: Whether to explicitly skip installing the SSM Plugin manager when setting up basic CI tooling
project-dir:
type: string
description: What's the relative path to the project?
required: false
default: ./
code-artifact-auth-role-name:
type: string
description: What's the role name to use for CodeArtifact authentication?
required: false
default: no-code-artifact
code-artifact-auth-role-account-id:
type: string
description: What's the AWS Account ID that the role is in?
required: false
code-artifact-auth-region:
type: string
description: What region should the role use?
required: false
skip-updating-devcontainer-hash:
type: boolean
description: Whether to skip updating the hash when running manual-setup-deps.py
default: true
required: false
skip-installing-pulumi-cli:
type: boolean
description: Whether to skip installing the Pulumi CLI even if the lock file references it
default: false
required: false
runs:
using: composite
steps:
- name: Get version of python
# TODO: be able to pull the default version from the devcontainer.json file
run: |
PYTHON_VERSION="${{ inputs.python-version }}"
echo "PYTHON_VERSION=$PYTHON_VERSION" >> "$GITHUB_ENV"
shell: bash
- name: Setup python
if: ${{ inputs.python-version != 'notUsing' }}
uses: actions/setup-python@v6.2.0
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Setup node
if: ${{ inputs.node-version != 'notUsing' }}
uses: actions/setup-node@v6.3.0
with:
node-version: ${{ inputs.node-version }}
- name: Install tooling
# the funky syntax is github action ternary
run: python .devcontainer/install-ci-tooling.py ${{ inputs.python-version == 'notUsing' && '--no-python' || '' }} ${{ inputs.node-version == 'notUsing' && '--no-node' || '' }} ${{ inputs.skip-installing-ssm-plugin-manager && '--skip-installing-ssm-plugin' || '' }}
shell: pwsh
- name: OIDC Auth for CodeArtifact
if: ${{ inputs.code-artifact-auth-role-name != 'no-code-artifact' }}
uses: aws-actions/configure-aws-credentials@v6.0.0
with:
role-to-assume: arn:aws:iam::${{ inputs.code-artifact-auth-role-account-id }}:role/${{ inputs.code-artifact-auth-role-name }}
aws-region: ${{ inputs.code-artifact-auth-region }}
- name: Install dependencies
# the funky syntax is github action ternary
if: ${{ inputs.install-deps }}
run: python .devcontainer/manual-setup-deps.py ${{ inputs.python-version == 'notUsing' && '--no-python' || '' }} ${{ inputs.node-version == 'notUsing' && '--no-node' || '' }} ${{ inputs.skip-updating-devcontainer-hash && '--skip-updating-devcontainer-hash' || '' }} ${{ inputs.skip-installing-pulumi-cli && '--skip-installing-pulumi-cli' || '' }}
shell: pwsh