Skip to content

Commit

Permalink
Add GHA job to run memory leak tests
Browse files Browse the repository at this point in the history
We don't run them on Windows because we know the memory measurement code
currently runs only on Unix. We can tackle that separately though.

Signed-off-by: Rodrigo Tobar <rtobar@icrar.org>
  • Loading branch information
rtobar committed Sep 26, 2024
1 parent 284fa0c commit 8d2922d
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/memleak-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Run memory leak tests

# Build on every branch push, tag push, and pull request change:
on:
push:
pull_request:
schedule:
# 00:00 UTC every Saturday, don't bother anyone
- cron: '0 0 * * 6'

jobs:

memleak_tests:
name: Build memory leak tests (${{ matrix.os }}, ${{ matrix.python_version }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-12]
python_version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13-dev"]

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

- uses: actions/setup-python@v5
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-latest' }}
run: sudo apt install libyajl-dev

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

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

- name: Run memory leak tests
run: pytest --memleaks-only -v

0 comments on commit 8d2922d

Please sign in to comment.