Skip to content

Updating testing workflow to cache conda environment installs #2

Updating testing workflow to cache conda environment installs

Updating testing workflow to cache conda environment installs #2

Workflow file for this run

name: test
on: [push]
jobs:
build-linux:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.9", "3.12"]
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--${{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: |
cond env update -n df3d -f environment.yml
- name: Conda info
run: |
conda info
conda list
- name: Run Tests
run: |
python -m unittest