Does specifying the shell activate the conda environment for us? #7
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: test | |
on: [push] | |
jobs: | |
build-linux: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.7", "3.9", "3.12"] | |
fail-fast: false | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Cache conda | |
id: cache | |
uses: actions/cache@v3 | |
with: | |
path: ~/conda_pkgs_dir | |
key: | |
${{ runner.os }}-conda-python${{ matrix.python-version }}-${{hashFiles('environment.yml') }} | |
- name: Set up Conda (Python ${{ matrix.python-version }}) | |
uses: conda-incubator/setup-miniconda@v3 | |
with: | |
activate-environment: df3d | |
auto-update-conda: true | |
python-version: ${{ matrix.python-version }} | |
environment-file: environment.yml | |
channel-priority: strict | |
use-only-tar-bz2: true | |
- name: Update environment | |
if: steps.cache.outputs.cache-hit != 'true' | |
run: | | |
conda env update -n df3d -f environment.yml | |
- name: Conda info | |
shell: bash -el {0} | |
run: | | |
conda info | |
conda list | |
- name: Run Tests | |
shell: bash -el {0} | |
run: | | |
conda activate df3d | |
python -m unittest |