Skip to content

Update actions infra, pin zarr #120

Update actions infra, pin zarr

Update actions infra, pin zarr #120

Workflow file for this run

name: Tests
on:
pull_request:
push:
branches: [main, test]
jobs:
pre-commit:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.12.1
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: pre-commit/action@v3.0.0
test:
name: Python
runs-on: ${{ matrix.os }}
strategy:
matrix:
python: [ 3.9, 3.12 ]
os: [ macos-latest, ubuntu-latest, windows-latest ]
defaults:
run:
shell: bash
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.12.1
with:
access_token: ${{ github.token }}
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
- name: Cache conda and dependancies
id: cache
uses: actions/cache@v4
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-${{ matrix.python}}-conda-v11-${{ hashFiles('requirements/CI-tests-conda.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
channel-priority: strict
auto-update-conda: true
- 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 mamba
mamba install --yes --file=requirements/CI-tests-conda.txt
# - name: Fix OSX Cache Write #OSX Won't let the cache restore due to file perms
# if: steps.cache.outputs.cache-hit != 'true' && matrix.os == 'macos-latest'
# run: |
# cp -r /usr/local/miniconda/envs/anaconda-client-env ~/osx-conda
#
# - name: Fix OSX Cache Restore
# if: steps.cache.outputs.cache-hit == 'true' && matrix.os == 'macos-latest'
# run: |
# mkdir -p /usr/local/miniconda/envs
# sudo cp -r ~/osx-conda /usr/local/miniconda/envs/anaconda-client-env
- name: Run tests
run: |
source ~/.profile
conda activate anaconda-client-env
python -m pytest -xv -n2