stat verification gc smck #2002
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: | |
pull_request: | |
push: | |
branches: [main] | |
jobs: | |
pre-commit: | |
name: Lint | |
runs-on: ubuntu-latest | |
steps: | |
- name: Cancel Previous Runs | |
uses: styfle/[email protected] | |
with: | |
access_token: ${{ github.token }} | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
- name: install clang-format | |
run: | | |
pip install clang-format==6.0.1 | |
- uses: pre-commit/[email protected] | |
test: | |
name: Python | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: False | |
matrix: | |
python: [ 3.8, 3.11 ] | |
os: [ macos-13, ubuntu-latest, windows-latest ] #Fix to macos-13 as 14 uses M1 silicon | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- name: Cancel Previous Runs | |
uses: styfle/[email protected] | |
with: | |
access_token: ${{ github.token }} | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
submodules: true | |
- name: Cache conda and dependencies | |
id: cache | |
uses: actions/cache@v3 | |
with: | |
path: ${{ env.CONDA }}/envs | |
key: ${{ runner.os }}-${{ runner.arch }}-${{ matrix.python}}-conda-v1-${{ hashFiles('requirements/CI-tests-conda/requirements.txt') }}-${{ hashFiles('requirements/CI-tests-pip/requirements.txt') }} | |
- name: Install Conda | |
uses: conda-incubator/setup-miniconda@v3 | |
if: steps.cache.outputs.cache-hit != 'true' | |
with: | |
activate-environment: anaconda-client-env | |
python-version: ${{ matrix.python }} | |
channels: conda-forge, anaconda | |
channel-priority: strict | |
auto-update-conda: true | |
- name: Fix windows symlinks | |
# This is horrible, but the "git config core.symlinks true" didn't work. | |
if: matrix.os == 'windows-latest' | |
run: | | |
rm lwt_interface | |
cp -r --dereference git-submodules/tskit/python/lwt_interface ./lwt_interface | |
- name: Fix windows .profile | |
if: steps.cache.outputs.cache-hit != 'true' && matrix.os == 'windows-latest' | |
run: | | |
cp ~/.bash_profile ~/.profile | |
- name: Install conda deps | |
if: steps.cache.outputs.cache-hit != 'true' | |
shell: bash -l {0} #We need a login shell to get conda | |
run: conda install --yes --file=requirements/CI-tests-conda/requirements.txt | |
- name: Install pip deps | |
if: steps.cache.outputs.cache-hit != 'true' | |
shell: bash -l {0} | |
run: pip install -r requirements/CI-tests-pip/requirements.txt | |
- name: Build module | |
env: | |
MSP_CONDA_PREFIX: c:\Miniconda\envs\anaconda-client-env | |
run: | | |
source ~/.profile | |
conda activate anaconda-client-env | |
python setup.py build_ext --inplace | |
- name: Run tests | |
run: | | |
source ~/.profile | |
conda activate anaconda-client-env | |
pytest -xvs -n0 |