tests #5
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
name: tests | |
on: | |
workflow_dispatch: null | |
schedule: | |
# Runs "every Monday & Thursday at 3:05am Central" | |
- cron: '5 8 * * 1,4' | |
push: | |
branches: | |
- main | |
pull_request: null | |
jobs: | |
tests: | |
name: tests | |
runs-on: "ubuntu-latest" | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- uses: conda-incubator/setup-miniconda@v2 | |
with: | |
python-version: 3.11 | |
channels: conda-forge,defaults | |
channel-priority: strict | |
show-channel-urls: true | |
miniforge-version: latest | |
use-mamba: true | |
- name: configure conda and install code | |
# Test against latest releases of each code in the dependency chain | |
shell: bash -l {0} | |
run: | | |
conda config --set always_yes yes | |
mamba install --quiet \ | |
--file=requirements.txt | |
python -m pip install --no-deps -e . | |
mamba install -y -q \ | |
flake8 \ | |
pytest \ | |
pytest-xdist \ | |
pytest-cov \ | |
pip \ | |
setuptools \ | |
"setuptools_scm>=7,<8" \ | |
python-build \ | |
flake8-pyproject | |
python -m pip install --no-build-isolation --no-deps -e . | |
- name: test | |
shell: bash -l {0} | |
run: | | |
pytest -v dsps --cov --cov-report=xml | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v3 | |
- name: test versions | |
shell: bash -el {0} | |
run: | | |
pip uninstall dsps --yes | |
[[ $(python setup.py --version) != "0.0.0" ]] || exit 1 | |
rm -rf dist/* | |
python setup.py sdist | |
pip install --no-deps --no-build-isolation dist/*.tar.gz | |
pushd .. | |
python -c "import dsps; assert dsps.__version__ != '0.0.0'" | |
popd | |
pip uninstall dsps --yes | |
rm -rf dist/* | |
python -m build --sdist . --outdir dist | |
pip install --no-deps --no-build-isolation dist/*.tar.gz | |
pushd .. | |
python -c "import dsps; assert dsps.__version__ != '0.0.0'" | |
popd | |
pip uninstall dsps --yes | |
python -m pip install -v --no-deps --no-build-isolation -e . |