Skip to content

Commit

Permalink
Merge pull request #3 from cloudshiftstrategies/fix/deps
Browse files Browse the repository at this point in the history
fix(build): workflow
  • Loading branch information
peterb154 committed Jan 9, 2025
2 parents 652a5f4 + 2a8b5a5 commit 5cdac81
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 67 deletions.
84 changes: 46 additions & 38 deletions .github/workflows/main-workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,28 +20,30 @@ jobs:
shell: bash
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Required for semantic-release

- name: Set up python
uses: actions/setup-python@v4
with:
python-version: 3.11

- name: Configure Poetry
uses: snok/install-poetry@v1
with:
version: 1.7.1
virtualenvs-create: true
virtualenvs-in-project: true

- name: Install & configure poetry
run: |
python -m pip install poetry==1.7.1
python -m poetry config virtualenvs.in-project true
- name: Cache poetry virtualenv
- name: Cache virtualenv
uses: actions/cache@v4
with:
path: ./.venv
key: ${{ runner.os }}-venv-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
${{ runner.os }}-venv-

- name: Install poetry dependencies
- name: Install dependencies
run: |
python -m poetry install
poetry install
- name: Upload workspace
uses: actions/upload-artifact@v4
Expand All @@ -52,8 +54,9 @@ jobs:
.
!.git
!.github
!.venv
!node_modules
!.venv
verify:
needs: setup
runs-on: ubuntu-latest
Expand All @@ -69,30 +72,28 @@ jobs:
uses: actions/download-artifact@v4
with:
name: workspace

- name: Set up python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: 3.11

- name: Install & configure poetry
run: |
python -m pip install poetry==1.7.1
python -m poetry config virtualenvs.in-project true
- name: Cache poetry virtualenv

- name: Configure Poetry
uses: snok/install-poetry@v1
with:
version: 1.7.1
virtualenvs-create: true
virtualenvs-in-project: true

- name: Cache virtualenv
uses: actions/cache@v4
with:
path: ./.venv
key: ${{ runner.os }}-venv-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
${{ runner.os }}-venv-
- name: Install dependencies
run: python -m poetry install


- name: Run ${{ matrix.task }}
run: python -m poetry run ${{ matrix.command }}
run: |
poetry run ${{ matrix.command }}
test:
needs: setup
Expand All @@ -112,16 +113,21 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Install & configure poetry
run: |
python -m pip install poetry==1.7.1
python -m poetry config virtualenvs.in-project true
- name: Configure Poetry
uses: snok/install-poetry@v1
with:
version: 1.7.1
virtualenvs-create: true
virtualenvs-in-project: true

- name: Install dependencies
run: python -m poetry install
- name: Cache virtualenv
uses: actions/cache@v4
with:
path: ./.venv
key: ${{ runner.os }}-venv-${{ hashFiles('**/poetry.lock') }}

- name: Run tests
run: python -m poetry run make test
run: poetry run make test
timeout-minutes: 5

release:
Expand Down Expand Up @@ -159,11 +165,13 @@ jobs:
with:
python-version: 3.11

- name: Install poetry
- name: Configure Poetry
if: steps.release.outputs.released == 'true'
run: |
python -m pip install poetry==1.7.1
python -m poetry config virtualenvs.in-project true
uses: snok/install-poetry@v1
with:
version: 1.7.1
virtualenvs-create: true
virtualenvs-in-project: true

- name: Configure poetry credentials
if: steps.release.outputs.released == 'true'
Expand Down
58 changes: 32 additions & 26 deletions .github/workflows/pull-request-workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,22 @@ jobs:
with:
python-version: 3.11

- name: Install & configure poetry
run: |
python -m pip install poetry==1.7.1
python -m poetry config virtualenvs.in-project true
- name: Configure Poetry
uses: snok/install-poetry@v1
with:
version: 1.7.1
virtualenvs-create: true
virtualenvs-in-project: true

- name: Cache poetry virtualenv
- name: Cache virtualenv
uses: actions/cache@v4
with:
path: ./.venv
key: ${{ runner.os }}-venv-${{ hashFiles('**/poetry.lock') }}

- name: Install poetry dependencies
- name: Install dependencies
run: |
python -m poetry install
poetry install
- name: Upload workspace
uses: actions/upload-artifact@v4
Expand All @@ -43,8 +45,8 @@ jobs:
.
!.git
!.github
!.venv
!node_modules
!.venv
verify:
needs: setup
Expand All @@ -67,23 +69,22 @@ jobs:
with:
python-version: 3.11

- name: Install & configure poetry
run: |
python -m pip install poetry==1.7.1
python -m poetry config virtualenvs.in-project true
- name: Configure Poetry
uses: snok/install-poetry@v1
with:
version: 1.7.1
virtualenvs-create: true
virtualenvs-in-project: true

- name: Cache poetry virtualenv
- name: Cache virtualenv
uses: actions/cache@v4
with:
path: ./.venv
key: ${{ runner.os }}-venv-${{ hashFiles('**/poetry.lock') }}

- name: Install dependencies
run: python -m poetry install

- name: Run ${{ matrix.task }}
run: python -m poetry run ${{ matrix.command }}
timeout-minutes: 5
run: |
poetry run ${{ matrix.command }}
test:
needs: setup
Expand All @@ -102,17 +103,22 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Configure Poetry
uses: snok/install-poetry@v1
with:
version: 1.7.1
virtualenvs-create: true
virtualenvs-in-project: true

- name: Install & configure poetry
run: |
python -m pip install poetry==1.7.1
python -m poetry config virtualenvs.in-project true
- name: Install dependencies
run: python -m poetry install
- name: Cache virtualenv
uses: actions/cache@v4
with:
path: ./.venv
key: ${{ runner.os }}-venv-${{ hashFiles('**/poetry.lock') }}

- name: Run tests
run: python -m poetry run make test
run: poetry run make test
timeout-minutes: 5

semantic-release-dry-run:
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ generate: clean
python scripts/generate_schemas.py

test:
pytest
python -m pytest

lint:
flake8 --statistics
python -m flake8 --statistics

fix:
black --line-length 120 .
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ pydantic = "^2.10"
python-dateutil = "^2.9"
requests = "^2.32"


[tool.poetry.group.dev.dependencies]
openapi-generator-cli = "^7.10.0.post0"
pytest = "^8.3.4"
Expand Down

0 comments on commit 5cdac81

Please sign in to comment.