Skip to content

run unit tests

run unit tests #226

Workflow file for this run

name: run-unit-tests
run-name: run unit tests
on:
pull_request:
branches-ignore: ["release-please*"]
paths:
- ".github/actions/**"
- ".github/workflows/**"
- "conda-recipe/**"
- "genome_kit/**"
- "setup.py"
- "setup/**"
- "src/**"
- "tests/**"
jobs:
build:
strategy:
matrix:
platform: [["linux-64", "ubuntu-latest"], ["osx-64", "macos-latest"]]
runs-on: ${{ matrix.platform[1] }}
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/build-gk
with:
platform: ${{ matrix.platform[0] }}
test:
needs: build
strategy:
matrix:
python-version: [["39", "3.9"], ["310", "3.10"]]
platform: [["linux-64", "ubuntu-latest"], ["osx-64", "macos-latest"]]
runs-on: ${{ matrix.platform[1] }}
steps:
- uses: actions/checkout@v4
- name: get meta.yaml from conda-forge for cache key calculation
uses: ./.github/actions/curl-meta-yaml
- name: restore mamba env
id: restore_mamba_cache
uses: actions/cache/restore@v4
with:
key: mamba-env-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('.github/workflows/run-tests.yaml', '.github/actions/**') }}
path: |
~/micromamba
~/.condarc
~/bin/micromamba
fail-on-cache-miss: true
- name: restore the gk package tarballs
id: restore_gk_pkg
uses: actions/cache/restore@v4
with:
key: mamba-env-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('.github/workflows/run-tests.yaml', '.github/actions/**', 'conda-recipe/meta.yaml', 'src/**', 'genome_kit/**', 'tests/**') }}
path: |
~/conda-bld
fail-on-cache-miss: true
- name: install mamba
uses: ./.github/actions/install-mamba
with:
installer-url: https://micro.mamba.pm/api/micromamba/${{ matrix.platform[0] }}/1.5.7
- name: create test env
shell: bash -l -e {0}
run: |
set -x
if [ ! -d "${HOME}/micromamba/envs/test" ]; then
micromamba create -yqn test -c conda-forge \
boa==0.16.0 mamba==1.5.7 conda==24.1.2 coverage
fi
set +x
- name: run unittests
id: run_unittests
shell: bash -l -e {0}
run: |
set -x
micromamba activate test
conda index ~/conda-bld
conda mambabuild --croot /tmp/conda-bld -t ~/conda-bld/*/*py${{ matrix.python-version[0] }}*.tar.bz2 --extra-deps python=${{ matrix.python-version[1] }}
conda clean -it
set +x