macos & windows #440
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: macos & windows | |
# Only build PRs, the main branch, and releases. | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
release: | |
types: | |
- published | |
schedule: | |
- cron: "14 14 20 * *" | |
# Use bash by default in all jobs | |
defaults: | |
run: | |
# Using "-l {0}" is necessary for conda environments to be activated | |
# But this breaks on MacOS if using actions/setup-python: | |
# https://github.com/actions/setup-python/issues/132 | |
shell: bash | |
jobs: | |
test: | |
name: ${{ matrix.os }} py${{ matrix.python }} | |
runs-on: ${{ matrix.os }}-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [macos, windows] | |
python: [3.9, ] | |
steps: | |
# Cancel any previous run of the test job; [pin v0.10.0 (2022-06-27)] | |
- name: Cancel Previous Runs | |
uses: styfle/cancel-workflow-action@bb6001c4ea612bf59c3abfc4756fbceee4f870c7 | |
with: | |
access_token: ${{ github.token }} | |
# Checks-out your repository under $GITHUB_WORKSPACE | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
# Need to fetch more than the last commit so that setuptools-scm can | |
# create the correct version string. If the number of commits since | |
# the last release is greater than this, the version still be wrong. | |
# Increase if necessary. | |
fetch-depth: 100 | |
# The GitHub token is preserved by default but this job doesn't need | |
# to be able to push to GitHub. | |
persist-credentials: false | |
# Need the tags so that setuptools-scm can form a valid version number | |
- name: Fetch git tags | |
run: git fetch origin 'refs/tags/*:refs/tags/*' | |
- name: Setup miniconda | |
# [pin v2.1.1 (2021-04-01)] | |
uses: conda-incubator/setup-miniconda@35d1405e78aa3f784fe3ce9a2eb378d5eeb62169 | |
with: | |
auto-update-conda: true | |
python-version: ${{ matrix.python }} | |
miniforge-version: "latest" | |
miniforge-variant: Mambaforge | |
use-mamba: true | |
- name: Install dependencies | |
shell: bash -l {0} | |
run: | | |
conda config --set always_yes yes --set changeps1 no | |
conda config --show-sources | |
conda config --show | |
conda info -a | |
conda install numba scipy pytest pytest-console-scripts scooby setuptools-scm | |
- name: Conda list | |
shell: bash -l {0} | |
run: conda list | |
- name: Test with pytest | |
shell: bash -l {0} | |
run: | | |
pip install --no-build-isolation --no-deps . | |
pytest |