_base_hash_on_config
should not be an attribute
#1794
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 .[tests] --force-reinstall | |
- name: Start MongoDB | |
uses: supercharge/mongodb-github-action@1.11.0 | |
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 |