Skip to content

Add enforcement for np.sort and np.argsort #1968

Add enforcement for np.sort and np.argsort

Add enforcement for np.sort and np.argsort #1968

Workflow file for this run

# Test strax on each PR
name: tests
# Trigger this code when a new release is published
on:
workflow_dispatch:
release:
types: [ created ]
pull_request:
branches:
- master
- stable
push:
branches:
- master
jobs:
test:
name: "${{ matrix.test }}_py${{ matrix.python-version }}"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [3.9, "3.10"]
test: ['coveralls', 'pytest']
# Installation on py3.10 is rather slow at the moment
exclude:
- python-version: "3.11"
test: coveralls
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: sudo apt-get install -y graphviz
- name: Install requirements
run: pip install git+https://github.com/XENONnT/base_environment.git --force-reinstall
- name: Start MongoDB
uses: supercharge/[email protected]
with:
mongodb-version: 4.2
# Perform coveralls (if coverage is set to True) or pytest
- name: Test package
if: matrix.test == 'pytest'
env:
TEST_MONGO_URI: 'mongodb://localhost:27017/'
run: |
pytest -v --durations 0
- name: Coverage run
if: matrix.test == 'coveralls'
env:
NUMBA_DISABLE_JIT: 1
TEST_MONGO_URI: 'mongodb://localhost:27017/'
run: |
coverage run --source=strax -m pytest --durations 0 -v
- name: Coverage run - backward compatibility check with straxen
if: matrix.test == 'coveralls'
env:
NUMBA_DISABLE_JIT: 1
TEST_MONGO_URI: 'mongodb://localhost:27017/'
run: |
echo "clone straxen"
straxen_dir="../straxen/"
git clone --single-branch --branch master https://github.com/XENONnT/straxen.git $straxen_dir
bash $straxen_dir/.github/scripts/create_pre_apply_function.sh $HOME
pip install -e $straxen_dir # Reinstall since tests might reflect new code.
echo "Run straxen tests"
coverage run --append --source=strax -m pytest $straxen_dir
coverage report
- name: Coveralls upload
if: matrix.test == 'coveralls'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
coverage report
coveralls --service=github
- name: goodbye
run: echo goodbye