Skip to content

Commit

Permalink
run test in github actions (and with pytest)
Browse files Browse the repository at this point in the history
  • Loading branch information
mathiasertl committed Dec 9, 2024
1 parent f77616e commit 3747fe5
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 7 deletions.
7 changes: 0 additions & 7 deletions .github/workflows/quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ jobs:
runs-on: ubuntu-latest

steps:

- name: Acquire sources
uses: actions/checkout@v4.1.1

Expand All @@ -25,12 +24,6 @@ jobs:
python-version: "3.12"
architecture: x64

- name: Apply caching of dependencies
uses: actions/cache@v4.0.0
with:
path: ~/.cache/pip
key: pip-${{ hashFiles('**/requirements-*.txt') }}

- name: Install dev dependencies
run: uv pip install -r dev-requirements.txt

Expand Down
48 changes: 48 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Code quality
on:
push:
env:
UV_SYSTEM_PYTHON: 1

jobs:

run:
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- "3.9"
- "3.10"
- "3.11"
- "3.12"
- "3.12"

steps:
- name: Install APT dependencies
run: sudo apt-get install -y softhsm2

- name: Create SoftHSM token
run: softhsm2-util --init-token --free --label TEST --pin 1234 --so-pin 5678

- name: Acquire sources
uses: actions/checkout@v4.1.1

- name: Install uv
uses: astral-sh/setup-uv@v4
with:
enable-cache: true

- name: Setup Python
uses: actions/setup-python@v5.0.0
with:
python-version: ${{ matrix.python-version }}
architecture: x64

- name: Install the project
run: uv sync --all-extras --dev

- name: Install dev dependencies
run: uv pip install -r dev-requirements.txt

- name: Run tests
run: uv run pytest -v
1 change: 1 addition & 0 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ setuptools_scm
oscrypto
cryptography
parameterized
pytest==8.3.4
ruff==0.8.2
sphinx
sphinx-rtd-theme

0 comments on commit 3747fe5

Please sign in to comment.