Clean packaging and migrate to hatch #841
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
name: unit test | |
on: [push, pull_request] | |
env: | |
CONDA_ENV: ooi | |
jobs: | |
unit_test: | |
name: ${{ matrix.python-version }}-unit-test | |
runs-on: ubuntu-20.04 | |
continue-on-error: ${{ matrix.experimental }} | |
strategy: | |
matrix: | |
python-version: ['3.10', '3.11', '3.12'] | |
experimental: [false] | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Fetch all history for all branches and tags. | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Setup micromamba | |
uses: mamba-org/provision-with-micromamba@v16 | |
with: | |
environment-file: conda_envs/py${{ matrix.python-version }}.yml | |
environment-name: ${{ env.CONDA_ENV }} | |
cache-env: true | |
cache-env-key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles(format('conda_envs/py{0}.yml', matrix.python-version)) }} | |
- name: Print conda env | |
shell: bash -l {0} | |
run: | | |
conda info | |
conda list | |
- name: Install pytest | |
shell: bash -l {0} | |
run: | | |
python -m pip install pytest | |
- name: Install ooipy | |
shell: bash -l {0} | |
run: | | |
python -m pip install -e . | |
- name: Run unit tests | |
shell: bash -l {0} | |
env: | |
FORCE_COLOR: 3 | |
run: pytest -vv tests |& tee unit_test_log${{ matrix.python-version }}.log | |
- name: Upload unit test log | |
if: ${{ success() || failure() }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: unit_test_log${{ matrix.python-version }} | |
path: unit_test_log${{ matrix.python-version }}.log |