Skip to content

Commit baf974b

Browse files
committed
fix: ci python matrix
1 parent 9876083 commit baf974b

1 file changed

Lines changed: 19 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
pull_request:
77
branches: [ main, master, develop ]
88

9+
permissions:
10+
contents: read
11+
912
jobs:
1013
test:
1114
runs-on: ubuntu-latest
@@ -19,23 +22,37 @@ jobs:
1922
uses: actions/checkout@v4
2023

2124
- name: Setup Micromamba
22-
uses: mamba-org/setup-micromamba@v2
25+
uses: mamba-org/setup-micromamba@v3
2326
with:
2427
environment-file: environment.yml
28+
create-args: >-
29+
python=${{ matrix.python-version }}
2530
init-shell: bash
2631
condarc: |
2732
channels:
2833
- conda-forge
2934
channel_priority: strict
3035
cache-environment: true
3136

37+
- name: Verify Python version
38+
shell: bash -l {0}
39+
env:
40+
EXPECTED_PYTHON: ${{ matrix.python-version }}
41+
run: |
42+
micromamba run -n seasenselib python -c 'import os, sys; expected = tuple(map(int, os.environ["EXPECTED_PYTHON"].split("."))); assert sys.version_info[:2] == expected, f"expected {expected}, got {sys.version_info[:2]}"'
43+
3244
- name: Install package (editable)
3345
shell: bash -l {0}
3446
run: |
3547
micromamba run -n seasenselib python -m pip install --upgrade pip
3648
micromamba run -n seasenselib python -m pip install -e . --no-deps --force-reinstall
3749
50+
- name: Check dependency consistency
51+
shell: bash -l {0}
52+
run: |
53+
micromamba run -n seasenselib python -m pip check
54+
3855
- name: Run unit tests from tests folder
3956
shell: bash -l {0}
4057
run: |
41-
micromamba run -n seasenselib pytest tests/ -v -x
58+
micromamba run -n seasenselib python -m pytest tests/ -v -x

0 commit comments

Comments
 (0)