Add a CadetDockerRunner and tests #153
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: pipeline | |
on: | |
push: | |
branches: | |
- master | |
- dev | |
pull_request: | |
jobs: | |
test-job: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash -l {0} | |
strategy: | |
matrix: | |
python-version: ["3.10", "3.11", "3.12"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Get Date | |
id: get-date | |
run: echo "today=$(/bin/date -u '+%Y%m%d')" >> $GITHUB_OUTPUT | |
shell: bash | |
- name: Setup Conda Environment | |
uses: conda-incubator/setup-miniconda@v3 | |
with: | |
miniforge-variant: Mambaforge | |
use-mamba: true | |
activate-environment: cadet-python | |
channels: conda-forge, | |
- name: Cache conda | |
uses: actions/cache@v3 | |
env: | |
# Increase this value to reset cache if environment.yml has not changed | |
CACHE_NUMBER: 0 | |
with: | |
path: ${{ env.CONDA }}/envs | |
key: python_${{ matrix.python-version }}-${{ steps.get-date.outputs.today }}-${{ env.CACHE_NUMBER }} | |
- name: Set up python env | |
run: | | |
mamba install python==${{ matrix.python-version }} | |
pip install . | |
- name: Install pypa/build | |
run: | | |
python -m pip install build --user | |
- name: Build binary wheel and source tarball | |
run: | | |
python -m build --sdist --wheel --outdir dist/ . | |
- name: Test Wheel install and import | |
run: | | |
python -c "import cadet; print(cadet.__version__)" | |
cd .. | |
- name: Test with pytest | |
run: | | |
pip install .[testing] | |
mamba install cadet -c conda-forge | |
pytest tests --rootdir=tests -m "not slow and not local" |