Skip to content

Commit

Permalink
CI: specify python version and activate env (#888)
Browse files Browse the repository at this point in the history
* CI: specify python version and activate env

* CI: use source activate instead of conda activate

* CI: specify shell

* CI: specify path for activate

* CI: merge activate and install steps

* CI: use env variable for conda path
  • Loading branch information
mj-will authored Jan 9, 2025
1 parent 5c789eb commit 4808057
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,40 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
CONDA_PATH: /opt/conda/

jobs:
build:

name: ${{ matrix.python.name }} unit tests
runs-on: ubuntu-latest
container: ghcr.io/bilby-dev/bilby-python311:latest
container: ghcr.io/bilby-dev/bilby-python${{ matrix.python.short-version }}:latest
strategy:
fail-fast: false
matrix:
python:
- name: Python 3.10
version: 3.10
short-version: 310
- name: Python 3.11
version: 3.11
short-version: 311
- name: Python 3.12
version: 3.12
short-version: 312

steps:
- uses: actions/checkout@v3
- name: Install package
run: |
# activate env so that conda list shows the correct environment
source $CONDA_PATH/bin/activate python${{ matrix.python.short-version }}
# FIXME: Remove this line when gwpy supports matplotlib 3.10
conda install -c conda-forge "matplotlib<3.10"
python -m pip install .
conda list --show-channel-urls
shell: bash
# - name: Run precommits
# run: |
# pre-commit run --all-files --verbose --show-diff-on-failure
Expand Down

0 comments on commit 4808057

Please sign in to comment.