Skip to content

Commit

Permalink
update workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
rettigl committed Dec 18, 2024
1 parent dd5e961 commit 0c8f747
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 38 deletions.
33 changes: 20 additions & 13 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,42 +6,49 @@ on:
paths-ignore:
pyproject.toml

env:
UV_SYSTEM_PYTHON: true

jobs:
lint:
runs-on: ubuntu-latest
steps:
# Check out repo and set up Python
- uses: actions/checkout@v3
with:
lfs: true
- uses: actions/checkout@v4

# see https://stackoverflow.com/questions/57612428/cloning-private-github-repository-within-organisation-in-actions and https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent#generating-a-new-ssh-key
- name: checkout test data
- name: Fetch test data
run: |
eval `ssh-agent -s`
ssh-add - <<< '${{ secrets.TEST_DATA_ACCESS_KEY }}'
git submodule sync --recursive
git submodule update --init --recursive
git submodule update --init --recursive --jobs=4
# Use cached python and dependencies, install poetry
- name: "Setup Python, Poetry and Dependencies"
uses: packetcoders/action-setup-cache-python-poetry@main
# Setup python
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: 3.8
poetry-version: 1.8.5
python-version: "3.10"

- name: Install dependencies
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
- name: Install package
run: |
uv pip install ".[dev]"
# Linting steps, execute all linters even if one fails
- name: ruff
run:
poetry run ruff specsanalyzer specsscan tests
ruff check specsanalyzer specsscan tests
- name: ruff formatting
if: ${{ always() }}
run:
poetry run ruff format --check specsanalyzer specsscan tests
ruff format --check specsanalyzer specsscan tests
- name: mypy
if: ${{ always() }}
run:
poetry run mypy specsanalyzer specsscan tests
mypy specsanalyzer specsscan tests
- name: spellcheck
if: ${{ always() }}
uses: streetsidesoftware/cspell-action@v6
Expand Down
31 changes: 19 additions & 12 deletions .github/workflows/testing_coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,35 +9,42 @@ on:
branches:
- main

env:
UV_SYSTEM_PYTHON: true

jobs:
pytest:
runs-on: ubuntu-latest
steps:
# Check out repo and set up Python
- name: Check out the repository
uses: actions/checkout@v4
with:
lfs: true
- uses: actions/checkout@v4

# see https://stackoverflow.com/questions/57612428/cloning-private-github-repository-within-organisation-in-actions and https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent#generating-a-new-ssh-key
- name: checkout test data
- name: Fetch test data
run: |
eval `ssh-agent -s`
ssh-add - <<< '${{ secrets.TEST_DATA_ACCESS_KEY }}'
git submodule sync --recursive
git submodule update --init --recursive
git submodule update --init --recursive --jobs=4
# Use cached python and dependencies, install poetry
- name: "Setup Python, Poetry and Dependencies"
uses: packetcoders/action-setup-cache-python-poetry@main
# Setup python
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: 3.8
poetry-version: 1.8.5
python-version: "3.10"

- name: Install dependencies
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
- name: Install package
run: |
uv pip install ".[dev]"
# Run pytest with coverage report, saving to xml
- name: Run tests on python 3.8
run: |
poetry run pytest --cov --cov-report xml:cobertura.xml --full-trace --show-capture=no -sv -n auto tests/
pytest --cov --cov-report xml:cobertura.xml --full-trace --show-capture=no -sv -n auto tests/
# Take report and upload to coveralls
- name: Coveralls
Expand Down
32 changes: 19 additions & 13 deletions .github/workflows/testing_multiversion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,33 +9,39 @@ on:

jobs:
pytest:
runs-on: ubuntu-latest
# Using matrix strategy
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
runs-on: ubuntu-latest
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]

steps:
# Check out repo and set up Python
- name: Check out the repository
uses: actions/checkout@v4
with:
lfs: true
- uses: actions/checkout@v4

# see https://stackoverflow.com/questions/57612428/cloning-private-github-repository-within-organisation-in-actions and https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent#generating-a-new-ssh-key
- name: checkout test data
- name: Fetch test data
run: |
eval `ssh-agent -s`
ssh-add - <<< '${{ secrets.TEST_DATA_ACCESS_KEY }}'
git submodule sync --recursive
git submodule update --init --recursive
git submodule update --init --recursive --jobs=4
- name: "Setup Python, Poetry and Dependencies"
uses: packetcoders/action-setup-cache-python-poetry@main
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{matrix.python-version}}
poetry-version: 1.8.5
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
- name: Install package
run: |
uv pip install ".[dev]"
# Use cached python and dependencies, install poetry
- name: Run tests on python ${{matrix.python-version}}
run: |
poetry run pytest --full-trace --show-capture=no -sv -n auto tests/
pytest --full-trace --show-capture=no -sv -n auto tests/

0 comments on commit 0c8f747

Please sign in to comment.