Skip to content

Implement merge shuffle algorithm for Numba #378

Implement merge shuffle algorithm for Numba

Implement merge shuffle algorithm for Numba #378

name: tests+artifacts+pypi
defaults:
run:
shell: bash
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
schedule:
- cron: '0 13 * * 4'
release:
types: [published]
jobs:
precommit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v1
with:
python-version: 3.8
- name: Linting
run: |
pip install pre-commit
pre-commit clean
pre-commit autoupdate
pre-commit run --all-files
nojit_and_codecov:
runs-on: ubuntu-latest
env:
NUMBA_DISABLE_JIT: 1
steps:
- uses: actions/checkout@master
- uses: actions/setup-python@master
with:
python-version: 3.9
- name: Generate coverage report
run: |
pip install -e .
pip install -r test-time-requirements.txt
pip install pytest-cov
pytest --durations=10 -We tests/unit_tests --cov-report=xml --cov=PySDM
- if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: codecov/codecov-action@v2
with:
fail_ci_if_error: true
verbose: true
pdoc:
strategy:
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v2
with:
persist-credentials: false
- uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Build
run: |
pip install pdoc3
pip install -e .
python -We -m pdoc --html PySDM
- name: Deploy
if: ${{ github.ref == 'refs/heads/main' && matrix.platform == 'ubuntu-latest' }}
uses: JamesIves/[email protected]
with:
BRANCH: pdoc
FOLDER: html/PySDM
CLEAN: true
pylint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pylint
python setup.py egg_info
pip install -r *.egg-info/requires.txt
pip install -r test-time-requirements.txt
- name: Analysing the code with pylint
run: |
# TODO #682
pylint --unsafe-load-any-extension=y --disable=fixme,invalid-name,missing-function-docstring,missing-class-docstring,protected-access,duplicate-code $(git ls-files '*.py')
zenodo_json:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: notiz-dev/github-action-json-property@release
with:
path: '.zenodo.json'
prop_path: 'creators'
tests:
needs: [pylint, pdoc, nojit_and_codecov, precommit, zenodo_json]
strategy:
matrix:
platform: [ubuntu-latest, macos-12, windows-latest]
python-version: ["3.7", "3.10"]
test-suite: ["unit_tests", "smoke_tests/box", "smoke_tests/parcel", "smoke_tests/kinematic_1d", "smoke_tests/kinematic_2d"]
fail-fast: false
runs-on: ${{ matrix.platform }}
timeout-minutes: 45
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- run: |
pip install -e .
# sanity check if we do not depend on something from test-time-requirements.txt
- run: |
python -We -c "import PySDM"
- run: |
SYSTEM_VERSION_COMPAT=0 pip install -r test-time-requirements.txt
# ensure previous pip did not overwrite the package
- run: |
pip install -e .
# https://github.com/numba/numba/issues/6350#issuecomment-728174860
- if: startsWith(matrix.platform, 'ubuntu-')
run: echo NUMBA_THREADING_LAYER=omp >> $GITHUB_ENV
- env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: pytest --durations=10 --timeout=900 --timeout_method=thread -p no:unraisableexception -We tests/${{ matrix.test-suite }}
# - if: ${{ failure() }}
# uses: mxschmitt/action-tmate@v3
# with:
# limit-access-to-actor: true
dist:
runs-on: ubuntu-latest
timeout-minutes: 90
needs: [tests]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # https://github.com/pypa/setuptools_scm/issues/480
- uses: actions/setup-python@v2
with:
python-version: "3.10"
- run: pip install twine build
- run: |
unset CI
python -m build 2>&1 | tee build.log
exit `fgrep -i warning build.log | grep -v impl_numba/warnings.py | wc -l`
- run: twine check --strict dist/*
- if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: pypa/gh-action-pypi-publish@unstable/v1
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
- if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@unstable/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}