Skip to content

Commit

Permalink
Initial GH workflow for running cpython tests
Browse files Browse the repository at this point in the history
Add coverage output

Reduce dependencies

add numpy
  • Loading branch information
jeromekelleher committed Jul 15, 2024
1 parent 5afff95 commit 4193038
Showing 1 changed file with 46 additions and 18 deletions.
64 changes: 46 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ on:
- main

jobs:
test:
name: Test
python_test:
name: Python tests
runs-on: ${{ matrix.os }}
strategy:
matrix:
Expand Down Expand Up @@ -42,30 +42,32 @@ jobs:
run: |
pytest
packaging:
name: Packaging
c_python_test:
name: CPython interface tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
- name: Install system dependencies
run: |
sudo apt install -y gcovr
- name: Install python dependencies
run: |
python -m pip install --upgrade pip
python -m pip install build twine validate-pyproject[all]
- name: Check and install package
python -m pip install numpy pytest
- name: Build module with coverage
run: |
validate-pyproject pyproject.toml
python -m build
python -m twine check --strict dist/*
python -m pip install dist/*.whl
- name: Check vcztools CLI
# Build the extension module in-place so pytest can find it
CFLAGS="--coverage" python3 setup.py build_ext --inplace
- name: Run tests
run: |
vcztools --help
# Make sure we don't have ``vcztools`` in the CWD
cd tests
python -m vcztools --help
pytest -vs tests/test_cpython_interface.py
- name: Show coverage
run: |
gcovr --filter vcztools
c_test:
name: C tests
Expand All @@ -88,7 +90,33 @@ jobs:
run: |
ninja -C build coverage-text
cat build/meson-logs/coverage.txt
- name: Valgrind
- name: Valgrind
working-directory: ./lib
run: |
valgrind --leak-check=full --error-exitcode=1 ./build/tests
packaging:
name: Packaging
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install build twine validate-pyproject[all]
- name: Check and install package
run: |
validate-pyproject pyproject.toml
python -m build
python -m twine check --strict dist/*
python -m pip install dist/*.whl
- name: Check vcztools CLI
run: |
vcztools --help
# Make sure we don't have ``vcztools`` in the CWD
cd tests
python -m vcztools --help

0 comments on commit 4193038

Please sign in to comment.