Skip to content

Commit 31f2bdb

Browse files
committed
fix(ci): use poetry to resolve layer deps; pip for CDK
1 parent 742a3a9 commit 31f2bdb

File tree

2 files changed

+15
-13
lines changed

2 files changed

+15
-13
lines changed

.github/workflows/publish_layer.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,7 @@ jobs:
2929
with:
3030
fetch-depth: 0
3131
- name: Install poetry
32-
# CDK spawns system python when compiling stack
33-
# therefore it ignores activated virtual env, thus missing deps
34-
run: |
35-
pipx install poetry
36-
poetry config virtualenvs.create false
32+
run: pipx install poetry
3733
- name: Setup Node.js
3834
uses: actions/setup-node@v3
3935
with:
@@ -42,7 +38,13 @@ jobs:
4238
uses: actions/setup-python@v4
4339
with:
4440
python-version: "3.9"
45-
cache: "poetry"
41+
cache: "pip"
42+
- name: Install project dependencies
43+
# CDK spawns system python when compiling stack
44+
# therefore it ignores both activated virtual env and cached interpreter by GH
45+
run: |
46+
poetry export --format requirements.txt --output requirements.txt
47+
pip install requirements.txt
4648
- name: Set release notes tag
4749
run: |
4850
RELEASE_INPUT=${{ inputs.latest_published_version }}
@@ -53,8 +55,6 @@ jobs:
5355
run: |
5456
npm install -g aws-cdk@2.29.0
5557
cdk --version
56-
- name: install deps
57-
run: poetry install
5858
- name: CDK build
5959
run: cdk synth --context version=$RELEASE_TAG_VERSION -o cdk.out
6060
- name: zip output

.github/workflows/reusable_deploy_layer_stack.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,7 @@ jobs:
5656
- name: checkout
5757
uses: actions/checkout@v3
5858
- name: Install poetry
59-
# CDK spawns system python when compiling stack
60-
# therefore it ignores activated virtual env, thus missing deps
61-
run: |
62-
pipx install poetry
63-
poetry config virtualenvs.create false
59+
run: pipx install poetry
6460
- name: aws credentials
6561
uses: aws-actions/configure-aws-credentials@v1
6662
with:
@@ -75,6 +71,12 @@ jobs:
7571
with:
7672
python-version: "3.9"
7773
cache: "pip"
74+
- name: Install project dependencies
75+
# CDK spawns system python when compiling stack
76+
# therefore it ignores both activated virtual env and cached interpreter by GH
77+
run: |
78+
poetry export --format requirements.txt --output requirements.txt
79+
pip install requirements.txt
7880
- name: install cdk and deps
7981
run: |
8082
npm install -g aws-cdk@2.29.0

0 commit comments

Comments
 (0)