Skip to content

Commit

Permalink
WIP: [CI] Cache Conda environment
Browse files Browse the repository at this point in the history
  • Loading branch information
speth committed Jan 24, 2023
1 parent 40cf72f commit 4e81e9b
Showing 1 changed file with 21 additions and 14 deletions.
35 changes: 21 additions & 14 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -480,26 +480,33 @@ jobs:
name: Checkout the repository
with:
submodules: recursive
- name: Cache conda packages
uses: actions/cache@v3
env:
# Increase this value to reset cache if .github/windows-2022-environment.yml has not changed
CACHE_NUMBER: 0
with:
path: ~/conda_pkgs_dir
key:
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{
hashFiles('.github/windows-2022-environment.yml') }}
- name: Set up conda
uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
miniforge-variant: Mambaforge
miniforge-version: latest
environment-file: .github/windows-2022-environment.yml
activate-environment: windows-2022-mamba
use-only-tar-bz2: true
use-mamba: true
- name: Get Date
id: get-date
run: echo "today=$(/bin/date -u '+%Y%m%d')" >> $GITHUB_OUTPUT
shell: bash
- name: Activate Cache for conda environment
uses: actions/cache@v3
env:
# Increase this value to reset cache if .github/windows-2022-environment.yml has not changed
CACHE_NUMBER: 0
with:
path: ${{ env.CONDA }}/envs
key:
conda-${{ runner.os }}--${{ runner.arch }}--${{
steps.get-date.outputs.today }}-${{
hashFiles('.github/windows-2022-environment.yml') }}-${{ env.CACHE_NUMBER }}
id: cache
- name: Update conda environment
run:
mamba env update -n windows-2022-mamba -f .github/windows-2022-environment.yml
if: steps.cache.outputs.cache-hit != 'true'
- name: Build Cantera
run: scons build system_eigen=y system_yamlcpp=y logging=debug
msvc_toolset_version=${{ matrix.vs-toolset }} f90_interface=n debug=n --debug=time -j2
Expand Down

0 comments on commit 4e81e9b

Please sign in to comment.