Skip to content

Commit e413284

Browse files
authored
chore: fix for old aws account id (propeller-heads#149)
* chore: fix for old aws account id * chore: fix for old aws account id * chore: test with changed branch * chore: test with changed branch * chore: test with install dependencies * chore: prepare to pr
1 parent 53ae072 commit e413284

File tree

3 files changed

+55
-5
lines changed

3 files changed

+55
-5
lines changed

.github/actions/setup_env/action.yaml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
name: Setup/Cache Env
22
description: 'Sets up and caches a python env. Will only install dependencies if no cache was hit.'
33

4+
inputs:
5+
role-to-assume:
6+
required: true
7+
description: 'The role to assume'
8+
aws-region:
9+
required: true
10+
description: 'The aws region to use'
11+
domain-owner:
12+
required: true
13+
description: 'The domain owner'
14+
415
runs:
516
using: composite
617
steps:
@@ -19,14 +30,14 @@ runs:
1930
- name: Configure AWS Credentials
2031
uses: aws-actions/configure-aws-credentials@v4.0.1
2132
with:
22-
role-to-assume: arn:aws:iam::827659017777:role/github-actions
33+
role-to-assume: ${{ inputs.role-to-assume }}
2334
audience: sts.amazonaws.com
24-
aws-region: eu-central-1
35+
aws-region: ${{ inputs.aws-region }}
2536

2637
- name: Install Dependencies
2738
if: ${{ steps.env-cache.outputs.cache-hit != 'true' }}
2839
run: |
29-
aws codeartifact login --tool pip --domain propeller --domain-owner 827659017777 --repository protosim
40+
aws codeartifact login --tool pip --domain propeller --domain-owner ${{inputs.domain-owner}} --repository protosim
3041
python -m pip install --upgrade pip
3142
pip install -r propeller-swap-encoders/requirements.txt --no-cache
3243
shell: bash

.github/workflows/python-tests.yaml

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@ on:
1111
required: false
1212
type: number
1313
default: 15
14+
secrets:
15+
role-to-assume:
16+
required: true
17+
aws-region:
18+
required: true
19+
domain-owner:
20+
required: true
1421

1522
jobs:
1623
test-python:
@@ -22,8 +29,32 @@ jobs:
2229
with:
2330
fetch-depth: 0
2431

25-
- name: Setup Env
26-
uses: ./.github/actions/setup_env
32+
- name: Set up Python 3.9
33+
uses: actions/setup-python@v4
34+
with:
35+
python-version: "3.9"
36+
37+
- name: Cache Env
38+
uses: actions/cache@v3
39+
id: env-cache
40+
with:
41+
path: ${{ env.pythonLocation }}
42+
key: ${{ env.pythonLocation }}-${{ hashFiles('./propeller-swap-encoders/requirements.txt') }}
43+
44+
- name: Configure AWS Credentials
45+
uses: aws-actions/configure-aws-credentials@v4.0.1
46+
with:
47+
role-to-assume: ${{ secrets.role-to-assume }}
48+
audience: sts.amazonaws.com
49+
aws-region: ${{ secrets.aws-region }}
50+
51+
- name: Install Dependencies
52+
if: ${{ steps.env-cache.outputs.cache-hit != 'true' }}
53+
run: |
54+
aws codeartifact login --tool pip --domain propeller --domain-owner ${{secrets.domain-owner}} --repository protosim
55+
python -m pip install --upgrade pip
56+
pip install -r propeller-swap-encoders/requirements.txt --no-cache
57+
shell: bash
2758

2859
- name: Test with pytest
2960
id: tests

.github/workflows/swap-encoders.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ env:
1313
jobs:
1414
tests:
1515
uses: propeller-heads/tycho-protocol-sdk/.github/workflows/python-tests.yaml@main
16+
secrets:
17+
role-to-assume: ${{ secrets.ROLE_TO_ASSUME }}
18+
aws-region: ${{ secrets.AWS_REGION }}
19+
domain-owner: ${{ secrets.DOMAIN_OWNER }}
1620

1721
formatting:
1822
name: Formatting
@@ -26,6 +30,10 @@ jobs:
2630

2731
- name: Setup Env
2832
uses: ./.github/actions/setup_env
33+
with:
34+
role-to-assume: ${{ secrets.ROLE_TO_ASSUME }}
35+
aws-region: ${{ secrets.AWS_REGION }}
36+
domain-owner: ${{ secrets.DOMAIN_OWNER }}
2937

3038
- name: Black Formatting
3139
run: |

0 commit comments

Comments
 (0)