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 feedback in a timely fashion. Moreover, it (currently)
doesn't properly test the compiled C extension, which is our usual
source of problems.

This new workflow defines 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. It also includes testing against the latest
version of PyPy (that includes our fixes), thus ensuring our extension
keeps working against this Python distribution.

Signed-off-by: Rodrigo Tobar <rtobar@icrar.org>
  • Loading branch information
rtobar committed Nov 15, 2023
1 parent 6e627eb commit d4ae771
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"]
include:
- 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 d4ae771

Please sign in to comment.