Skip to content

Commit

Permalink
Add new job to quickly build and run tests
Browse files Browse the repository at this point in the history
The wheel-building job is too time consuming and therefore doesn't work
optimally to give good feedback. Moreover, it (currently) doesn't
properly test the compiled extension.

This new workflow define jobs for common platforms and python versions
to build and test our package. These jobs run all in parallel, with
each one being fairly small, and therefore should give us quick feedback
after a commit is pushed.

Signed-off-by: Rodrigo Tobar <rtobar@icrar.org>
  • Loading branch information
rtobar committed Nov 15, 2023
1 parent 6e627eb commit df96a65
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/deploy-to-pypi.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build, test, and upload to PyPI
name: Build distributions and upload to PyPI

# Build on every branch push, tag push, and pull request change:
on: [push, pull_request]
Expand Down
47 changes: 47 additions & 0 deletions .github/workflows/fast-built-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Build and test ijson

# Build on every branch push, tag push, and pull request change:
on: [push, pull_request]

jobs:

fast_tests:
name: Build ijson and run unit tests (${{ matrix.os }}, ${{ matrix.python_version }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, windows-2019, macos-12]
python_version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
includes:
- os: ubuntu-20.04
python_version: "pypy3.9"
- os: ubuntu-20.04
python_version: "pypy3.10"

steps:
- uses: actions/checkout@v4
with:
submodules: true

- uses: actions/setup-python@v4
name: Install Python
with:
python-version: ${{ matrix.python_version }}

- name: Install build test dependencies
run: pip install setuptools

- name: Install Yajl
if: ${{ matrix.os == 'ubuntu-20.04' }}
run: sudo apt install libyajl-dev

- name: Build ijson
env:
IJSON_EMBED_YAJL: ${{ matrix.os != 'ubuntu-20.04' && '1' || '0' }}
run: python setup.py develop

- name: Install test dependencies
run: pip install pytest cffi

- name: Run tests
run: pytest -vv

0 comments on commit df96a65

Please sign in to comment.