Skip to content

Commit

Permalink
adding minimal dependency environment for CI
Browse files Browse the repository at this point in the history
  • Loading branch information
bmcfee committed Mar 15, 2024
1 parent a22fd5e commit 83daf50
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 6 deletions.
12 changes: 12 additions & 0 deletions .github/environment-minimal.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: test
channels:
- conda-forge
- defaults
dependencies:
- pip
- numpy ==1.7.0
- scipy ==1.0.0
- matplotlib==2.1.0
- pytest
- pytest-cov
- pytest-mpl
19 changes: 13 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,23 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.8", "3.9", "3.10"]
python-version: ["3.7", "3.11", "3.12"]
channel-priority: [strict]
envfile: ".github/environment.yml"
include:
- python-version: "3.10"
- python-version: "3.12"
os: macos-latest
- python-version: "3.10"
- python-version: "3.12"
os: windows-latest
- python-version: "3.10"
- python-version: "3.12"
os: ubuntu-latest
channel-priority: flexible
- os: ubuntu-latest
python-version: "3.7"
envfile: ".github/environment-minimal.yml"
channel-priority: "flexible"
name: "Minimal dependencies"

runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
Expand All @@ -35,15 +42,15 @@ jobs:
uses: actions/cache@v3
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('.github/environment.yml') }}
key: ${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles(matrix.envfile) }}

- name: Create conda environment
uses: conda-incubator/setup-miniconda@v2
with:
python-version: ${{ matrix.python-version }}
auto-activate-base: false
channel-priority: ${{ matrix.channel-priority }}
environment-file: .github/environment.yml
environment-file: ${{ matrix.envfile }}
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!

- name: Install package in development mode
Expand Down

0 comments on commit 83daf50

Please sign in to comment.