Skip to content

Commit

Permalink
ci: PLT-525: simplify poetry install action
Browse files Browse the repository at this point in the history
  • Loading branch information
farioas committed Oct 24, 2024
1 parent 3398575 commit 1eff3ec
Show file tree
Hide file tree
Showing 6 changed files with 77 additions and 49 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/build_pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,15 @@ jobs:
working-directory: "${{ env.FRONTEND_MONOREPO_DIR }}"
run: yarn version:libs

- name: Set up Python
- name: "Install poetry"
run: pipx install poetry

- name: "Set up Python"
id: setup_python
uses: actions/setup-python@v5
with:
python-version: '3.10'

- name: Set up Poetry
uses: snok/install-poetry@v1
python-version: '3.11'
cache: 'poetry'

- name: Install Python dependencies
run: poetry install --with build
Expand Down
12 changes: 10 additions & 2 deletions .github/workflows/follow-merge-upstream-repo-sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,17 @@ jobs:

# POETRY

- name: "Poetry: Set up"
- name: "Install poetry"
if: steps.details.outputs.poetry
uses: snok/install-poetry@v1
run: pipx install poetry

- name: "Set up Python"
id: setup_python
if: steps.details.outputs.poetry
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'poetry'

- name: "Poetry: Commit and Push"
if: steps.details.outputs.poetry
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/test_conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,15 @@ jobs:
python-version: ${{ matrix.python-version }}
activate-environment: test-environment

- name: Set up Poetry
uses: snok/install-poetry@v1
- name: "Install poetry"
run: pipx install poetry

- name: "Set up Python"
id: setup_python
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'poetry'

- name: Install Python dependencies
run: |
Expand Down
43 changes: 22 additions & 21 deletions .github/workflows/test_migrations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,30 +29,30 @@ jobs:
steps:
- uses: hmarr/[email protected]

- name: Checkout
- name: "Checkout"
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}

- name: Set up Python
- name: "Install poetry"
run: pipx install poetry

- name: "Set up Python"
id: setup_python
uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: '3.11'
cache: 'poetry'

- name: Install OS dependencies
- name: "Install OS dependencies"
run: |
sudo apt-get update
sudo apt-get install libsasl2-dev python3-dev libldap2-dev libssl-dev libxml2-dev libxslt-dev
- name: Set up Poetry
uses: snok/install-poetry@v1

- name: Install Python dependencies
run: |
poetry install
- name: "Install dependencies"
run: poetry install

- name: Test migrations
- name: "Test migrations"
run: |
output=$(poetry run python label_studio/manage.py makemigrations)
if ! grep 'No changes detected' <<< "${output}"; then
Expand Down Expand Up @@ -91,34 +91,35 @@ jobs:
steps:
- uses: hmarr/[email protected]

- name: Checkout
- name: "Checkout"
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
fetch-depth: 0

- name: Set up Python
- name: "Install poetry"
run: pipx install poetry

- name: "Set up Python"
id: setup_python
uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: '3.11'
cache: 'poetry'

- name: Install OS dependencies
- name: "Install OS dependencies"
run: |
sudo apt-get update
sudo apt-get install libsasl2-dev python3-dev libldap2-dev libssl-dev libxml2-dev libxslt-dev
- name: Set up Poetry
uses: snok/install-poetry@v1

- name: Install Python dependencies
- name: "Install dependencies"
run: |
poetry install
- name: Test migrations
- name: "Test migrations"
run: |
poetry run python label_studio/manage.py makemigrations
- name: Lint migrations
- name: "Lint migrations"
run: |
poetry run python label_studio/manage.py lintmigrations --warnings-as-errors --project-root-path '.' --git-commit-id ${{ github.event.pull_request.base.sha || github.event.before }}
37 changes: 20 additions & 17 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ env:
jobs:
run_pytest_sqlite:
name: LS SQLite Ubuntu
runs-on: ubuntu-24.04
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -46,20 +46,21 @@ jobs:
with:
ref: ${{ inputs.head_sha }}

- name: Set up Python ${{ matrix.python-version }}
- name: "Install poetry"
run: pipx install poetry

- name: "Set up Python ${{ matrix.python-version }}"
id: setup_python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
python-version: '${{ matrix.python-version }}'
cache: 'poetry'

- name: Install OS dependencies
run: |
sudo apt-get update
sudo apt-get install libffi8 libldap2-dev libsasl2-dev libssl-dev libxml2-dev libxslt-dev python3-dev
- name: Set up Poetry
uses: snok/install-poetry@v1

- name: Install Python dependencies
run: poetry install --with test

Expand All @@ -77,7 +78,7 @@ jobs:

run_pytest_postgresql:
name: LS PostgreSQL Ubuntu
runs-on: ubuntu-24.04
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -130,20 +131,21 @@ jobs:
with:
ref: ${{ inputs.head_sha }}

- name: Set up Python ${{ matrix.python-version }}
- name: "Install poetry"
run: pipx install poetry

- name: "Set up Python ${{ matrix.python-version }}"
id: setup_python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
python-version: '${{ matrix.python-version }}'
cache: 'poetry'

- name: Install OS dependencies
run: |
sudo apt-get update
sudo apt-get install libffi8 libldap2-dev libsasl2-dev libssl-dev libxml2-dev libxslt-dev python3-dev
- name: Set up Poetry
uses: snok/install-poetry@v1

- name: Install Python dependencies
run: poetry install --with test

Expand Down Expand Up @@ -206,14 +208,15 @@ jobs:
with:
ref: ${{ inputs.head_sha }}

- name: Set up Python ${{ matrix.python-version }}
- name: "Install poetry"
run: pipx install poetry

- name: "Set up Python ${{ matrix.python-version }}"
id: setup_python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Set up Poetry
uses: snok/install-poetry@v1
python-version: '${{ matrix.python-version }}'
cache: 'poetry'

- name: Install Python dependencies
run: poetry install --with test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,15 @@ jobs:
git config --global user.name 'robot-ci-heartex'
git config --global user.email '[email protected]'
- name: Set up Poetry
uses: snok/install-poetry@v1
- name: "Install poetry"
run: pipx install poetry

- name: "Set up Python"
id: setup_python
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'poetry'

- name: Commit version files to 'develop'
id: make-develop-commit
Expand Down

0 comments on commit 1eff3ec

Please sign in to comment.