CI #29
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: CI | |
on: | |
pull_request: | |
push: | |
branches: | |
- master | |
schedule: | |
- cron: '0 0 * * *' # Daily “At 00:00” | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
test: | |
name: Python (${{ matrix.python-version }}, ${{ matrix.os }}) | |
runs-on: ${{ matrix.os }} | |
defaults: | |
run: | |
shell: bash -l {0} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ "ubuntu-latest", "macos-latest", "windows-latest" ] | |
python-version: ["3.10", "3.11", "3.12"] | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
- name: set environment variables | |
run: | | |
echo "TODAY=$(date +%Y-%m-%d)" >> $GITHUB_ENV | |
- name: environment setup | |
id: env-setup | |
continue-on-error: true | |
uses: conda-incubator/setup-miniconda@v3 # Use miniconda as conda action has issue with macos-latest | |
with: | |
environment-file: build_envs/environment.yml | |
- name: retry environment set up if failed | |
if: steps.env-setup.outcome == 'failure' | |
uses: mamba-org/setup-micromamba@v2 # If miniconda fails, use mamba as backup option | |
with: | |
download-micromamba: true | |
environment-file: build_envs/environment.yml | |
cache-environment: true | |
cache-environment-key: "CI ${{runner.os}}-${{runner.arch}}-py${{matrix.python-version}}-${{env.TODAY}}" | |
create-args: >- | |
python=${{matrix.python-version}} |