Skip to content

Add small selection functions #1303

Add small selection functions

Add small selection functions #1303

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:
update:
name: "${{ matrix.test }}_py${{ matrix.python-version }}"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [3.8, 3.9, "3.10"]
test: ['coveralls', 'pytest']
# Installation on py3.10 is rather slow at the moment
exclude:
- python-version: "3.10"
test: coveralls
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
cache-dependency-path: 'extra_requirements/requirements-tests.txt'
- name: Install requirements
run: pip install -r extra_requirements/requirements-tests.txt
- 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 setup.py test -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