From 4e81e9b89255775d4d36a28341f35dccadb69f90 Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Tue, 24 Jan 2023 16:40:00 -0500 Subject: [PATCH] WIP: [CI] Cache Conda environment --- .github/workflows/main.yml | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d33a0f16ab0..d66b4af9634 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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