MAINT: Update CI configurations and handle sanity checks #1365
Workflow file for this run
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: Linux and MacOS CI | |
on: [push, pull_request] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
test: | |
name: test | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
# macos-latest doesn't have 3.8 anymore or pypy-3.9 .. | |
os: ["ubuntu-latest", "macos-13"] | |
python-version: ["3.8", "3.12", "pypy-3.9"] | |
r-version: ['release'] | |
timeout-minutes: 60 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
# We need Python 3.8 to always be installed, so tests with | |
# multiple environments can run. | |
- name: Set up Python 3.8 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.8 | |
- name: Install mercurial and conda | |
if: runner.os == 'macOS' | |
run: | | |
brew update | |
brew install mercurial | |
brew install --cask anaconda | |
- name: Set up Python version ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: pip | |
cache-dependency-path: pyproject.toml | |
- name: Setup a browser for more tests | |
uses: browser-actions/setup-chrome@latest | |
- name: Set up R version ${{ matrix.r-version }} | |
uses: r-lib/actions/[email protected] | |
with: | |
r-version: ${{ matrix.r-version }} | |
- name: Install dependencies (standard) | |
if: matrix.python-version != '3.12.0-rc.2' | |
run: python -m pip install ".[test,hg,testR]" | |
- name: Install dependencies (with --pre) | |
if: matrix.python-version == '3.12.0-rc.2' | |
run: python -m pip install ".[test,hg,testR]" --pre | |
- name: Install asv | |
run: pip install . | |
- name: Run tests | |
run: python -m pytest -v --timeout=300 --webdriver=ChromeHeadless --durations=100 test | |
test_env: | |
name: test_environments | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: ["ubuntu-latest", "macos-latest"] | |
r-version: ['release'] | |
fail-fast: false | |
timeout-minutes: 10 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: mamba-org/[email protected] | |
with: | |
init-shell: >- | |
bash | |
environment-name: test-env | |
cache-environment: true | |
create-args: >- | |
python | |
pip | |
libmambapy<2.0 | |
conda-build | |
- name: Install dependencies | |
run: python -m pip install ".[test,hg]" --pre | |
shell: micromamba-shell {0} | |
- name: Install asv | |
run: pip install . | |
shell: micromamba-shell {0} | |
- name: Run tests | |
run: pytest -k environment_bench -vvvvv | |
shell: micromamba-shell {0} | |
docs: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.x' | |
cache: pip | |
cache-dependency-path: pyproject.toml | |
- name: Install asv | |
run: pip install ".[doc]" | |
- name: Build docs | |
run: sphinx-build -W docs/source html |