From 47e5be2bf91efc887f626839e0f90ae7d54108d9 Mon Sep 17 00:00:00 2001 From: Bill Little Date: Fri, 17 Jun 2022 11:16:09 +0100 Subject: [PATCH 1/2] fix composite gha --- .github/workflows/composite/cartopy-cache/action.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/composite/cartopy-cache/action.yml b/.github/workflows/composite/cartopy-cache/action.yml index 35a90736bc..618b93cab5 100644 --- a/.github/workflows/composite/cartopy-cache/action.yml +++ b/.github/workflows/composite/cartopy-cache/action.yml @@ -1,6 +1,10 @@ name: "cartopy-cache" description: "create and cache cartopy assets" +# +# Assumes the environment contains the following variables: +# - CONDA +# inputs: cache_build: description: "conda environment cache build number" @@ -28,6 +32,8 @@ runs: CARTOPY_FEATURE: https://raw.githubusercontent.com/SciTools/cartopy/v0.20.0/tools/cartopy_feature_download.py shell: bash run: | + source ${{ env.CONDA }}/etc/profile.d/conda.sh >/dev/null 2>&1 + conda activate ${{ inputs.env_name }} wget --quiet ${CARTOPY_FEATURE} mkdir -p ${CARTOPY_SHARE_DIR} # Requires a pre-installed version of cartopy within the environment. From 76914422b755947d3cfc86471a9226f1d1d5c4d5 Mon Sep 17 00:00:00 2001 From: Bill Little Date: Fri, 17 Jun 2022 12:05:48 +0100 Subject: [PATCH 2/2] bump gha cache_build to force purge --- .github/workflows/ci-docs-linkcheck.yml | 6 +++--- .github/workflows/ci-docs-tests.yml | 10 +++++----- .github/workflows/ci-tests.yml | 10 +++++----- .github/workflows/composite/cartopy-cache/action.yml | 1 + 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci-docs-linkcheck.yml b/.github/workflows/ci-docs-linkcheck.yml index cf67e99129..2fc5722d7f 100644 --- a/.github/workflows/ci-docs-linkcheck.yml +++ b/.github/workflows/ci-docs-linkcheck.yml @@ -54,7 +54,7 @@ jobs: - name: "conda package cache" uses: ./.github/workflows/composite/conda-pkg-cache with: - cache_build: 0 + cache_build: 1 cache_period: ${{ env.CACHE_PERIOD }} env_name: ${{ env.ENV_NAME }} @@ -70,7 +70,7 @@ jobs: - name: "conda environment cache" uses: ./.github/workflows/composite/conda-env-cache with: - cache_build: 0 + cache_build: 1 cache_period: ${{ env.CACHE_PERIOD }} env_name: ${{ env.ENV_NAME }} install_packages: "nox pip" @@ -83,7 +83,7 @@ jobs: - name: "nox cache" uses: ./.github/workflows/composite/nox-cache with: - cache_build: 0 + cache_build: 1 env_name: ${{ env.ENV_NAME }} lock_file: ${{ env.LOCK_FILE }} diff --git a/.github/workflows/ci-docs-tests.yml b/.github/workflows/ci-docs-tests.yml index faadf56204..91366f4a06 100644 --- a/.github/workflows/ci-docs-tests.yml +++ b/.github/workflows/ci-docs-tests.yml @@ -55,14 +55,14 @@ jobs: - name: "data cache" uses: ./.github/workflows/composite/iris-data-cache with: - cache_build: 0 + cache_build: 1 env_name: ${{ env.ENV_NAME }} version: ${{ env.IRIS_TEST_DATA_VERSION }} - name: "conda package cache" uses: ./.github/workflows/composite/conda-pkg-cache with: - cache_build: 0 + cache_build: 1 cache_period: ${{ env.CACHE_PERIOD }} env_name: ${{ env.ENV_NAME }} @@ -78,7 +78,7 @@ jobs: - name: "conda environment cache" uses: ./.github/workflows/composite/conda-env-cache with: - cache_build: 0 + cache_build: 1 cache_period: ${{ env.CACHE_PERIOD }} env_name: ${{ env.ENV_NAME }} install_packages: "cartopy nox pip" @@ -91,14 +91,14 @@ jobs: - name: "cartopy cache" uses: ./.github/workflows/composite/cartopy-cache with: - cache_build: 0 + cache_build: 1 cache_period: ${{ env.CACHE_PERIOD }} env_name: ${{ env.ENV_NAME }} - name: "nox cache" uses: ./.github/workflows/composite/nox-cache with: - cache_build: 0 + cache_build: 1 env_name: ${{ env.ENV_NAME }} lock_file: ${{ env.LOCK_FILE }} diff --git a/.github/workflows/ci-tests.yml b/.github/workflows/ci-tests.yml index fbe738067c..5598ce1084 100644 --- a/.github/workflows/ci-tests.yml +++ b/.github/workflows/ci-tests.yml @@ -56,14 +56,14 @@ jobs: - name: "data cache" uses: ./.github/workflows/composite/iris-data-cache with: - cache_build: 0 + cache_build: 1 env_name: ${{ env.ENV_NAME }} version: ${{ env.IRIS_TEST_DATA_VERSION }} - name: "conda package cache" uses: ./.github/workflows/composite/conda-pkg-cache with: - cache_build: 0 + cache_build: 1 cache_period: ${{ env.CACHE_PERIOD }} env_name: ${{ env.ENV_NAME }} @@ -79,7 +79,7 @@ jobs: - name: "conda environment cache" uses: ./.github/workflows/composite/conda-env-cache with: - cache_build: 0 + cache_build: 1 cache_period: ${{ env.CACHE_PERIOD }} env_name: ${{ env.ENV_NAME }} install_packages: "cartopy nox pip" @@ -92,14 +92,14 @@ jobs: - name: "cartopy cache" uses: ./.github/workflows/composite/cartopy-cache with: - cache_build: 0 + cache_build: 1 cache_period: ${{ env.CACHE_PERIOD }} env_name: ${{ env.ENV_NAME }} - name: "nox cache" uses: ./.github/workflows/composite/nox-cache with: - cache_build: 0 + cache_build: 1 env_name: ${{ env.ENV_NAME }} lock_file: ${{ env.LOCK_FILE }} diff --git a/.github/workflows/composite/cartopy-cache/action.yml b/.github/workflows/composite/cartopy-cache/action.yml index 618b93cab5..e805cbacc1 100644 --- a/.github/workflows/composite/cartopy-cache/action.yml +++ b/.github/workflows/composite/cartopy-cache/action.yml @@ -32,6 +32,7 @@ runs: CARTOPY_FEATURE: https://raw.githubusercontent.com/SciTools/cartopy/v0.20.0/tools/cartopy_feature_download.py shell: bash run: | + # Require to explicitly activate the environment within the composite action. source ${{ env.CONDA }}/etc/profile.d/conda.sh >/dev/null 2>&1 conda activate ${{ inputs.env_name }} wget --quiet ${CARTOPY_FEATURE}