Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions .github/workflows/matrix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Matrix test

on:
push:
branches:
- main
workflow_dispatch:

defaults:
run:
shell: bash -l {0}

jobs:
test:
name: Python ${{ matrix.python-version }}, OS ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ['3.10', '3.11', '3.12']
os: ["macos-latest", "ubuntu-latest", "windows-latest"]
steps:
- name: check out test_workflow
uses: actions/checkout@v4

- name: Initialize miniconda
uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: test
auto-update-conda: true
environment-file: environment.yml
python-version: ${{ matrix.python-version }}
auto-activate-base: false

- name: Conda config
run: >-
conda config --set always_yes yes
--set changeps1 no

- name: Install test_workflow and requirements
run: |
conda install --file requirements/run.txt
conda install --file requirements/test.txt
python -m pip install -r requirements/pip.txt
python -m pip install . --no-deps

- name: Install Xvfb
if: runner.os == 'Linux'
run: sudo apt-get install -y xvfb

- name: Start Xvfb
if: runner.os == 'Linux'
run: |
export DISPLAY=:99
Xvfb :99 -screen 0 1024x768x16 &

- name: Validate test_workflow
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
export DISPLAY=:99
fi
python -m pytest

- name: Display Python and Conda info
run: |
python --version
conda info