Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions .github/workflows/bump.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,15 @@ jobs:
with:
ref: ${{ inputs.branch }}

- name: Install poetry
shell: bash
run: pipx install poetry==2.1.4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Set up Poetry
uses: abatilo/actions-poetry@v3
with:
poetry-version: "2.1.4"

- name: Bump package Version using Poetry
id: bumping
env:
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/docstring_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,13 @@ jobs:
steps:
- uses: actions/checkout@v5

- name: Install poetry
shell: bash
run: pipx install poetry==2.1.4

- name: Set up Python
uses: actions/setup-python@v5

- name: Set up Poetry
uses: abatilo/actions-poetry@v3
with:
poetry-version: "2.1.4"

- name: Install dependencies
shell: bash
run: |
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/replaceholder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,15 @@ jobs:
with:
ref: ${{ inputs.branch }}

- name: Install poetry
shell: bash
run: pipx install poetry==2.1.4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Set up Poetry
uses: abatilo/actions-poetry@v3
with:
poetry-version: "2.1.4"

- name: Replace placeholders
id: bobr
env:
Expand Down
42 changes: 1 addition & 41 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,15 @@ on:

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
inputs:
poetry:
type: boolean
description: "Use Poetry-based workflow."
required: false
default: true

# Allow this workflow to be called from other repositories.
workflow_call:
inputs:
poetry:
type: boolean
description: "Use Poetry-based workflow."
description: "Deprecated, will now always use Poetry."
required: false
default: true
trigger:
type: string
description: "Fake input parameter to tell if triggered from outside. Do not set manually."
required: false
default: "external"

jobs:
run-tests:
Expand All @@ -43,14 +32,7 @@ jobs:
steps:
- uses: actions/checkout@v5

- name: Decide if poetry
id: decide
env:
USE_POETRY: "${{ (((github.event_name == 'pull_request') || (github.event_name == 'push')) && (inputs.trigger != 'external')) || ((inputs.poetry == true) && ((github.event_name == 'workflow_dispatch') || (inputs.trigger == 'external'))) }}"
run: echo "USE_POETRY=$USE_POETRY" >> "$GITHUB_OUTPUT"

- name: Install poetry
if: ${{ steps.decide.outputs.USE_POETRY == 'true' }}
shell: bash
run: pipx install poetry==2.1.4

Expand All @@ -60,38 +42,16 @@ jobs:
python-version: ${{ matrix.python-version }}

- name: Install dependencies with Poetry
if: ${{ steps.decide.outputs.USE_POETRY == 'true' }}
run: |
poetry install --with test --all-extras
poetry add git+https://github.com/AstarVienna/ScopeSim_Data.git

- name: Check Python version
if: ${{ steps.decide.outputs.USE_POETRY == 'true' }}
run: poetry run python -V >> "$GITHUB_STEP_SUMMARY"

- name: Run Pytest with Poetry
if: ${{ steps.decide.outputs.USE_POETRY == 'true' }}
run: poetry run pytest -m "not webtest" --cov --cov-report=xml

- name: Install dependencies without Poetry
if: ${{ steps.decide.outputs.USE_POETRY == 'false' }}
run: |
python -m pip install --upgrade pip
pip install git+https://github.com/AstarVienna/ScopeSim_Data.git
# Install this clone of the project. This is relevant because for
# example ScopeSim has ScopeSim_Templates as a test-dependency
# and that package has ScopeSim as a dependency. So the PyPI version
# of ScopeSim would be installed without the "pip install ." line.
pip install .
# TODO: It should not be necessary to install the dev dependencies.
# Perhaps create a separate test for that?
pip install .[test,dev]
pip install pytest pytest-cov

- name: Run Pytest without Poetry
if: ${{ steps.decide.outputs.USE_POETRY == 'false' }}
run: pytest -m "not webtest" --cov --cov-report=xml

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
env:
Expand Down
41 changes: 1 addition & 40 deletions .github/workflows/webtests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,14 @@ name: Webtests
on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
inputs:
poetry:
type: boolean
description: "Use Poetry-based workflow."
required: false

# Allow this workflow to be called from other repositories.
workflow_call:
inputs:
poetry:
type: boolean
description: "Use Poetry-based workflow."
required: false
trigger:
type: string
description: "Fake input parameter to tell if triggered from outside. Do not set manually."
description: "Deprecated, will now always use Poetry."
required: false
default: "external"

jobs:
run-tests:
Expand All @@ -35,14 +25,7 @@ jobs:
steps:
- uses: actions/checkout@v5

- name: Decide if poetry
id: decide
env:
USE_POETRY: "${{ (((github.event_name == 'pull_request') || (github.event_name == 'push')) && (inputs.trigger != 'external')) || ((inputs.poetry == true) && ((github.event_name == 'workflow_dispatch') || (inputs.trigger == 'external'))) }}"
run: echo "USE_POETRY=$USE_POETRY" >> "$GITHUB_OUTPUT"

- name: Install poetry
if: ${{ steps.decide.outputs.USE_POETRY == 'true' }}
shell: bash
run: pipx install poetry==2.1.4

Expand All @@ -52,38 +35,16 @@ jobs:
python-version: ${{ matrix.python-version }}

- name: Install dependencies with Poetry
if: ${{ steps.decide.outputs.USE_POETRY == 'true' }}
run: |
poetry install --with test --all-extras
poetry add git+https://github.com/AstarVienna/ScopeSim_Data.git

- name: Check Python version
if: ${{ steps.decide.outputs.USE_POETRY == 'true' }}
run: poetry run python -V >> "$GITHUB_STEP_SUMMARY"

- name: Run Pytest with Poetry
if: ${{ steps.decide.outputs.USE_POETRY == 'true' }}
run: poetry run pytest -m "webtest" --cov --cov-report=xml

- name: Install dependencies without Poetry
if: ${{ steps.decide.outputs.USE_POETRY == 'false' }}
run: |
python -m pip install --upgrade pip
pip install git+https://github.com/AstarVienna/ScopeSim_Data.git
# Install this clone of the project. This is relevant because for
# example ScopeSim has ScopeSim_Templates as a test-dependency
# and that package has ScopeSim as a dependency. So the PyPI version
# of ScopeSim would be installed without the "pip install ." line.
pip install .
# TODO: It should not be necessary to install the dev dependencies.
# Perhaps create a separate test for that?
pip install .[test,dev]
pip install pytest pytest-cov

- name: Run Pytest without Poetry
if: ${{ steps.decide.outputs.USE_POETRY == 'false' }}
run: pytest -m "webtest" --cov --cov-report=xml

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
Expand Down
Loading