Skip to content

Commit e955472

Browse files
committed
[NRL-1375] Update all workflows to use new codebuild setup-env step
1 parent d822683 commit e955472

File tree

6 files changed

+58
-47
lines changed

6 files changed

+58
-47
lines changed

.github/workflows/daily-build.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,7 @@ jobs:
3939
run: make test
4040

4141
- name: Build Project
42-
run: |
43-
echo "PATH: ${PATH}"
44-
echo "HOME: ${HOME}"
45-
echo "python: $(which python)"
46-
echo "asdf: $(which asdf)"
47-
echo "/usr/local/bin: $(ls -la /usr/local/bin)"
48-
make build
42+
run: make build
4943

5044
- name: Configure Management Credentials
5145
uses: aws-actions/configure-aws-credentials@v4

.github/workflows/persistent-environment.yml

Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ jobs:
3030
with:
3131
ref: ${{ inputs.branch_name }}
3232

33-
- name: Setup Python environment
33+
- name: Setup environment
3434
run: |
35+
echo "${HOME}/.asdf/bin" >> $GITHUB_PATH
3536
poetry install --no-root
36-
source $(poetry env info --path)/bin/activate
3737
3838
- name: Run Linting
3939
run: make lint
@@ -83,6 +83,11 @@ jobs:
8383
with:
8484
ref: ${{ inputs.branch_name }}
8585

86+
- name: Setup environment
87+
run: |
88+
echo "${HOME}/.asdf/bin" >> $GITHUB_PATH
89+
poetry install --no-root
90+
8691
- name: Configure Management Credentials
8792
uses: aws-actions/configure-aws-credentials@v4
8893
with:
@@ -101,11 +106,6 @@ jobs:
101106
name: build-artifacts
102107
path: dist
103108

104-
- name: Setup Python environment
105-
run: |
106-
poetry install --no-root
107-
source $(poetry env info --path)/bin/activate
108-
109109
- name: Restore NRLF permissions cache
110110
uses: actions/cache/restore@v4
111111
with:
@@ -147,6 +147,11 @@ jobs:
147147
with:
148148
ref: ${{ inputs.branch_name }}
149149

150+
- name: Setup environment
151+
run: |
152+
echo "${HOME}/.asdf/bin" >> $GITHUB_PATH
153+
poetry install --no-root
154+
150155
- name: Download build artifacts
151156
uses: actions/download-artifact@v4
152157
with:
@@ -175,11 +180,6 @@ jobs:
175180
account=$(echo '${{ inputs.environment }}' | cut -d '-' -f1)
176181
make truststore-pull-server ENV=${account}
177182
178-
- name: Setup Python environment
179-
run: |
180-
poetry install --no-root
181-
source $(poetry env info --path)/bin/activate
182-
183183
- name: Terraform Init
184184
run: |
185185
inactive_stack=$(poetry run python ./scripts/get_env_config.py inactive-stack ${{ inputs.environment }})
@@ -213,18 +213,18 @@ jobs:
213213
with:
214214
ref: ${{ inputs.branch_name }}
215215

216+
- name: Setup environment
217+
run: |
218+
echo "${HOME}/.asdf/bin" >> $GITHUB_PATH
219+
poetry install --no-root
220+
216221
- name: Configure Management Credentials
217222
uses: aws-actions/configure-aws-credentials@v4
218223
with:
219224
aws-region: eu-west-2
220225
role-to-assume: ${{ secrets.MGMT_ROLE_ARN }}
221226
role-session-name: github-actions-ci-${{ inputs.environment }}-${{ github.run_id}}
222227

223-
- name: Setup Python environment
224-
run: |
225-
poetry install --no-root
226-
source $(poetry env info --path)/bin/activate
227-
228228
- name: Activate Stack
229229
run: |
230230
inactive_stack=$(poetry run python ./scripts/get_env_config.py inactive-stack ${{ inputs.environment }})
@@ -242,18 +242,18 @@ jobs:
242242
with:
243243
ref: ${{ inputs.branch_name }}
244244

245+
- name: Setup environment
246+
run: |
247+
echo "${HOME}/.asdf/bin" >> $GITHUB_PATH
248+
poetry install --no-root
249+
245250
- name: Configure Management Credentials
246251
uses: aws-actions/configure-aws-credentials@v4
247252
with:
248253
aws-region: eu-west-2
249254
role-to-assume: ${{ secrets.MGMT_ROLE_ARN }}
250255
role-session-name: github-actions-ci-${{ inputs.environment }}-${{ github.run_id}}
251256

252-
- name: Setup Python environment
253-
run: |
254-
poetry install --no-root
255-
source $(poetry env info --path)/bin/activate
256-
257257
- name: "Smoke Test"
258258
run: |
259259
make ENV=${{ inputs.environment }} test-smoke-public
@@ -271,6 +271,11 @@ jobs:
271271
with:
272272
ref: ${{ inputs.branch_name }}
273273

274+
- name: Setup environment
275+
run: |
276+
echo "${HOME}/.asdf/bin" >> $GITHUB_PATH
277+
poetry install --no-root
278+
274279
- name: Configure Management Credentials
275280
uses: aws-actions/configure-aws-credentials@v4
276281
with:

.github/workflows/pr-env-deploy.yml

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@ jobs:
5252
with:
5353
ref: ${{ github.event.pull_request.head.ref }}
5454

55-
- name: Setup Python environment
55+
- name: Setup environment
5656
run: |
57+
echo "${HOME}/.asdf/bin" >> $GITHUB_PATH
5758
poetry install --no-root
58-
source $(poetry env info --path)/bin/activate
5959
6060
- name: Run Linting
6161
run: make lint
@@ -115,6 +115,11 @@ jobs:
115115
with:
116116
ref: ${{ github.event.pull_request.head.ref }}
117117

118+
- name: Setup environment
119+
run: |
120+
echo "${HOME}/.asdf/bin" >> $GITHUB_PATH
121+
poetry install --no-root
122+
118123
- name: Configure Management Credentials
119124
uses: aws-actions/configure-aws-credentials@v4
120125
with:
@@ -138,11 +143,6 @@ jobs:
138143
- name: Retrieve Server Certificates
139144
run: make truststore-pull-server ENV=dev
140145

141-
- name: Setup Python environment
142-
run: |
143-
poetry install --no-root
144-
source $(poetry env info --path)/bin/activate
145-
146146
- name: Terraform Init
147147
run: |
148148
terraform -chdir=terraform/infrastructure init
@@ -197,8 +197,10 @@ jobs:
197197
with:
198198
ref: ${{ github.event.pull_request.head.ref }}
199199

200-
- name: Python Dependency Install
201-
run: poetry install --no-root
200+
- name: Setup environment
201+
run: |
202+
echo "${HOME}/.asdf/bin" >> $GITHUB_PATH
203+
poetry install --no-root
202204
203205
- name: Configure Management Credentials
204206
uses: aws-actions/configure-aws-credentials@v4
@@ -232,10 +234,10 @@ jobs:
232234
with:
233235
ref: ${{ github.event.pull_request.head.ref }}
234236

235-
- name: Setup Python environment
237+
- name: Setup environment
236238
run: |
239+
echo "${HOME}/.asdf/bin" >> $GITHUB_PATH
237240
poetry install --no-root
238-
source $(poetry env info --path)/bin/activate
239241
240242
- name: Configure Management Credentials
241243
uses: aws-actions/configure-aws-credentials@v4
@@ -267,10 +269,10 @@ jobs:
267269
with:
268270
ref: ${{ github.event.pull_request.head.ref }}
269271

270-
- name: Setup Python environment
272+
- name: Setup environment
271273
run: |
274+
echo "${HOME}/.asdf/bin" >> $GITHUB_PATH
272275
poetry install --no-root
273-
source $(poetry env info --path)/bin/activate
274276
275277
- name: Configure AWS Credentials
276278
uses: aws-actions/configure-aws-credentials@v4

.github/workflows/pr-env-destroy.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ jobs:
5454
with:
5555
ref: ${{ github.event.pull_request.merged && github.event.pull_request.base.ref || github.event.pull_request.head.ref }}
5656

57+
- name: Setup environment
58+
run: |
59+
echo "${HOME}/.asdf/bin" >> $GITHUB_PATH
60+
poetry install --no-root
61+
5762
- name: Configure AWS Credentials
5863
uses: aws-actions/configure-aws-credentials@v4
5964
with:

.github/workflows/rollback-stack.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,18 @@ jobs:
2727
with:
2828
ref: ${{ github.ref }}
2929

30+
- name: Setup environment
31+
run: |
32+
echo "${HOME}/.asdf/bin" >> $GITHUB_PATH
33+
poetry install --no-root
34+
3035
- name: Configure Management Credentials
3136
uses: aws-actions/configure-aws-credentials@v4
3237
with:
3338
aws-region: eu-west-2
3439
role-to-assume: ${{ secrets.MGMT_ROLE_ARN }}
3540
role-session-name: github-actions-ci-${{ inputs.environment }}-${{ github.run_id}}
3641

37-
- name: Setup Python environment
38-
run: |
39-
poetry install --no-root
40-
source $(poetry env info --path)/bin/activate
41-
4242
- name: Get current environment config
4343
run: |
4444
poetry run python ./scripts/get_env_config.py all ${{ inputs.environment }}

.github/workflows/update-lambda-permissions.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,11 @@ jobs:
219219
with:
220220
ref: ${{ github.ref }}
221221

222+
- name: Setup environment
223+
run: |
224+
echo "${HOME}/.asdf/bin" >> $GITHUB_PATH
225+
poetry install --no-root
226+
222227
- name: Restore pulled lambda artifacts
223228
uses: actions/cache/restore@v4
224229
with:

0 commit comments

Comments
 (0)