Skip to content

Commit 9ba01d9

Browse files
committed
Merge pull request #3 from cloudshiftstrategies/fix/deps
fix(build): workflow
2 parents 652a5f4 + 2a8b5a5 commit 9ba01d9

File tree

4 files changed

+83
-70
lines changed

4 files changed

+83
-70
lines changed

.github/workflows/main-workflow.yaml

Lines changed: 49 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -20,28 +20,30 @@ jobs:
2020
shell: bash
2121
steps:
2222
- uses: actions/checkout@v4
23+
with:
24+
fetch-depth: 0 # Required for semantic-release
2325

2426
- name: Set up python
2527
uses: actions/setup-python@v4
2628
with:
2729
python-version: 3.11
30+
31+
- name: Configure Poetry
32+
uses: snok/install-poetry@v1
33+
with:
34+
version: 1.7.1
35+
virtualenvs-create: true
36+
virtualenvs-in-project: true
2837

29-
- name: Install & configure poetry
30-
run: |
31-
python -m pip install poetry==1.7.1
32-
python -m poetry config virtualenvs.in-project true
33-
34-
- name: Cache poetry virtualenv
38+
- name: Cache virtualenv
3539
uses: actions/cache@v4
3640
with:
3741
path: ./.venv
3842
key: ${{ runner.os }}-venv-${{ hashFiles('**/poetry.lock') }}
39-
restore-keys: |
40-
${{ runner.os }}-venv-
4143

42-
- name: Install poetry dependencies
44+
- name: Install dependencies
4345
run: |
44-
python -m poetry install
46+
poetry install
4547
4648
- name: Upload workspace
4749
uses: actions/upload-artifact@v4
@@ -52,8 +54,9 @@ jobs:
5254
.
5355
!.git
5456
!.github
55-
!.venv
5657
!node_modules
58+
!.venv
59+
5760
verify:
5861
needs: setup
5962
runs-on: ubuntu-latest
@@ -69,30 +72,28 @@ jobs:
6972
uses: actions/download-artifact@v4
7073
with:
7174
name: workspace
72-
75+
7376
- name: Set up python
74-
uses: actions/setup-python@v2
77+
uses: actions/setup-python@v4
7578
with:
7679
python-version: 3.11
77-
78-
- name: Install & configure poetry
79-
run: |
80-
python -m pip install poetry==1.7.1
81-
python -m poetry config virtualenvs.in-project true
82-
83-
- name: Cache poetry virtualenv
80+
81+
- name: Configure Poetry
82+
uses: snok/install-poetry@v1
83+
with:
84+
version: 1.7.1
85+
virtualenvs-create: true
86+
virtualenvs-in-project: true
87+
88+
- name: Cache virtualenv
8489
uses: actions/cache@v4
8590
with:
8691
path: ./.venv
8792
key: ${{ runner.os }}-venv-${{ hashFiles('**/poetry.lock') }}
88-
restore-keys: |
89-
${{ runner.os }}-venv-
90-
91-
- name: Install dependencies
92-
run: python -m poetry install
93-
93+
9494
- name: Run ${{ matrix.task }}
95-
run: python -m poetry run ${{ matrix.command }}
95+
run: |
96+
poetry run ${{ matrix.command }}
9697
9798
test:
9899
needs: setup
@@ -112,16 +113,21 @@ jobs:
112113
with:
113114
python-version: ${{ matrix.python-version }}
114115

115-
- name: Install & configure poetry
116-
run: |
117-
python -m pip install poetry==1.7.1
118-
python -m poetry config virtualenvs.in-project true
116+
- name: Configure Poetry
117+
uses: snok/install-poetry@v1
118+
with:
119+
version: 1.7.1
120+
virtualenvs-create: true
121+
virtualenvs-in-project: true
119122

120-
- name: Install dependencies
121-
run: python -m poetry install
123+
- name: Cache virtualenv
124+
uses: actions/cache@v4
125+
with:
126+
path: ./.venv
127+
key: ${{ runner.os }}-venv-${{ hashFiles('**/poetry.lock') }}
122128

123129
- name: Run tests
124-
run: python -m poetry run make test
130+
run: poetry run make test
125131
timeout-minutes: 5
126132

127133
release:
@@ -159,22 +165,24 @@ jobs:
159165
with:
160166
python-version: 3.11
161167

162-
- name: Install poetry
168+
- name: Configure Poetry
163169
if: steps.release.outputs.released == 'true'
164-
run: |
165-
python -m pip install poetry==1.7.1
166-
python -m poetry config virtualenvs.in-project true
170+
uses: snok/install-poetry@v1
171+
with:
172+
version: 1.7.1
173+
virtualenvs-create: true
174+
virtualenvs-in-project: true
167175

168176
- name: Configure poetry credentials
169177
if: steps.release.outputs.released == 'true'
170178
run: |
171-
python -m poetry config pypi-token.pypi ${{ secrets.PYPI_API_TOKEN }}
179+
poetry config pypi-token.pypi ${{ secrets.PYPI_API_TOKEN }}
172180
173181
- name: Build and publish
174182
if: steps.release.outputs.released == 'true'
175183
run: |
176-
python -m poetry build
177-
python -m poetry publish
184+
poetry build
185+
poetry publish
178186
179187
# Add the download workspace as a separate step before build and publish
180188
- name: Download workspace

.github/workflows/pull-request-workflow.yaml

Lines changed: 32 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,22 @@ jobs:
1919
with:
2020
python-version: 3.11
2121

22-
- name: Install & configure poetry
23-
run: |
24-
python -m pip install poetry==1.7.1
25-
python -m poetry config virtualenvs.in-project true
22+
- name: Configure Poetry
23+
uses: snok/install-poetry@v1
24+
with:
25+
version: 1.7.1
26+
virtualenvs-create: true
27+
virtualenvs-in-project: true
2628

27-
- name: Cache poetry virtualenv
29+
- name: Cache virtualenv
2830
uses: actions/cache@v4
2931
with:
3032
path: ./.venv
3133
key: ${{ runner.os }}-venv-${{ hashFiles('**/poetry.lock') }}
3234

33-
- name: Install poetry dependencies
35+
- name: Install dependencies
3436
run: |
35-
python -m poetry install
37+
poetry install
3638
3739
- name: Upload workspace
3840
uses: actions/upload-artifact@v4
@@ -43,8 +45,8 @@ jobs:
4345
.
4446
!.git
4547
!.github
46-
!.venv
4748
!node_modules
49+
!.venv
4850
4951
verify:
5052
needs: setup
@@ -67,23 +69,22 @@ jobs:
6769
with:
6870
python-version: 3.11
6971

70-
- name: Install & configure poetry
71-
run: |
72-
python -m pip install poetry==1.7.1
73-
python -m poetry config virtualenvs.in-project true
72+
- name: Configure Poetry
73+
uses: snok/install-poetry@v1
74+
with:
75+
version: 1.7.1
76+
virtualenvs-create: true
77+
virtualenvs-in-project: true
7478

75-
- name: Cache poetry virtualenv
79+
- name: Cache virtualenv
7680
uses: actions/cache@v4
7781
with:
7882
path: ./.venv
7983
key: ${{ runner.os }}-venv-${{ hashFiles('**/poetry.lock') }}
8084

81-
- name: Install dependencies
82-
run: python -m poetry install
83-
8485
- name: Run ${{ matrix.task }}
85-
run: python -m poetry run ${{ matrix.command }}
86-
timeout-minutes: 5
86+
run: |
87+
poetry run ${{ matrix.command }}
8788
8889
test:
8990
needs: setup
@@ -102,17 +103,22 @@ jobs:
102103
uses: actions/setup-python@v4
103104
with:
104105
python-version: ${{ matrix.python-version }}
106+
107+
- name: Configure Poetry
108+
uses: snok/install-poetry@v1
109+
with:
110+
version: 1.7.1
111+
virtualenvs-create: true
112+
virtualenvs-in-project: true
105113

106-
- name: Install & configure poetry
107-
run: |
108-
python -m pip install poetry==1.7.1
109-
python -m poetry config virtualenvs.in-project true
110-
111-
- name: Install dependencies
112-
run: python -m poetry install
114+
- name: Cache virtualenv
115+
uses: actions/cache@v4
116+
with:
117+
path: ./.venv
118+
key: ${{ runner.os }}-venv-${{ hashFiles('**/poetry.lock') }}
113119

114120
- name: Run tests
115-
run: python -m poetry run make test
121+
run: poetry run make test
116122
timeout-minutes: 5
117123

118124
semantic-release-dry-run:

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ generate: clean
88
python scripts/generate_schemas.py
99

1010
test:
11-
pytest
11+
python -m pytest
1212

1313
lint:
14-
flake8 --statistics
14+
python -m flake8 --statistics
1515

1616
fix:
1717
black --line-length 120 .

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ pydantic = "^2.10"
1313
python-dateutil = "^2.9"
1414
requests = "^2.32"
1515

16-
1716
[tool.poetry.group.dev.dependencies]
1817
openapi-generator-cli = "^7.10.0.post0"
1918
pytest = "^8.3.4"

0 commit comments

Comments
 (0)