From 16eef37b00683048b9fc641b8716381d764cb910 Mon Sep 17 00:00:00 2001 From: Gerard Casey Date: Fri, 19 Sep 2025 19:48:07 +0100 Subject: [PATCH 1/2] clean cache before build --- .github/workflows/conda-build.yml | 73 +++++++++++++++---------------- 1 file changed, 36 insertions(+), 37 deletions(-) diff --git a/.github/workflows/conda-build.yml b/.github/workflows/conda-build.yml index 963430e..5bbcb35 100644 --- a/.github/workflows/conda-build.yml +++ b/.github/workflows/conda-build.yml @@ -72,40 +72,39 @@ jobs: strategy: matrix: ${{ fromJson(needs.n-builds.outputs.matrix) }} steps: - - uses: actions/checkout@v4 - - uses: mamba-org/setup-micromamba@v2 - with: - micromamba-version: '1.5.10-0' - environment-name: condabuild - create-args: >- - python=3.11 - boa - conda-verify - post-cleanup: all - cache-environment: true - - - name: Add conda channel - run: conda config --add channels city-modelling-lab - - - name: Build conda package - run: conda mambabuild ${{ inputs.recipe_dir }} - - - name: Get version without the v - run: | - TAG=${{ inputs.version }} - echo "VERSION=${TAG#v}" >> $GITHUB_ENV - - - name: Test installing built conda package - run: | - micromamba install -c local ${{ inputs.package_name }} - INSTALLED=$(micromamba list ${{ inputs.package_name }}) - echo $INSTALLED - echo "$INSTALLED" | grep "${{ env.VERSION }}" -Fq - - - name: Upload built conda package ready for upload on release - uses: actions/upload-artifact@v4 - with: - name: conda-build-${{ matrix.os }}-${{ inputs.package_name }}-${{ inputs.version }} - path: ${{ env.MAMBA_ROOT_PREFIX }}/envs/condabuild/conda-bld/ - retention-days: 3 - if-no-files-found: error + - uses: actions/checkout@v4 + - name: Clean conda cache + run: | + conda clean --all --yes + - uses: mamba-org/setup-micromamba@v2 + with: + micromamba-version: '1.5.10-0' + environment-name: condabuild + create-args: >- + python=3.11 + boa + conda-verify + conda=25.5.1 + post-cleanup: all + cache-environment: true + - name: Add conda channel + run: conda config --add channels city-modelling-lab + - name: Build conda package + run: conda mambabuild ${{ inputs.recipe_dir }} + - name: Get version without the v + run: | + TAG=${{ inputs.version }} + echo "VERSION=${TAG#v}" >> $GITHUB_ENV + - name: Test installing built conda package + run: | + micromamba install -c local ${{ inputs.package_name }} + INSTALLED=$(micromamba list ${{ inputs.package_name }}) + echo $INSTALLED + echo "$INSTALLED" | grep "${{ env.VERSION }}" -Fq + - name: Upload built conda package ready for upload on release + uses: actions/upload-artifact@v4 + with: + name: conda-build-${{ matrix.os }}-${{ inputs.package_name }}-${{ inputs.version }} + path: ${{ env.MAMBA_ROOT_PREFIX }}/envs/condabuild/conda-bld/ + retention-days: 3 + if-no-files-found: error From e3d2f9ee25cb01647c9930a1326075bbf057944c Mon Sep 17 00:00:00 2001 From: Gerard Casey Date: Sat, 20 Sep 2025 20:03:45 +0100 Subject: [PATCH 2/2] Toggle off cache for conda env --- .github/actions/create-conda-env/action.yml | 2 +- .github/workflows/conda-build.yml | 74 +++++++++++---------- 2 files changed, 39 insertions(+), 37 deletions(-) diff --git a/.github/actions/create-conda-env/action.yml b/.github/actions/create-conda-env/action.yml index b268dbb..74cc308 100644 --- a/.github/actions/create-conda-env/action.yml +++ b/.github/actions/create-conda-env/action.yml @@ -14,7 +14,7 @@ inputs: cache_env: description: "If true, cache the conda environment for speedier CI" required: false - default: "true" + default: "false" cache_refresh_time_format: description: >- The time format to extract from the current date with which a cache refresh will be forced even if nothing has changed in the environment name. diff --git a/.github/workflows/conda-build.yml b/.github/workflows/conda-build.yml index 5bbcb35..2b0ad21 100644 --- a/.github/workflows/conda-build.yml +++ b/.github/workflows/conda-build.yml @@ -72,39 +72,41 @@ jobs: strategy: matrix: ${{ fromJson(needs.n-builds.outputs.matrix) }} steps: - - uses: actions/checkout@v4 - - name: Clean conda cache - run: | - conda clean --all --yes - - uses: mamba-org/setup-micromamba@v2 - with: - micromamba-version: '1.5.10-0' - environment-name: condabuild - create-args: >- - python=3.11 - boa - conda-verify - conda=25.5.1 - post-cleanup: all - cache-environment: true - - name: Add conda channel - run: conda config --add channels city-modelling-lab - - name: Build conda package - run: conda mambabuild ${{ inputs.recipe_dir }} - - name: Get version without the v - run: | - TAG=${{ inputs.version }} - echo "VERSION=${TAG#v}" >> $GITHUB_ENV - - name: Test installing built conda package - run: | - micromamba install -c local ${{ inputs.package_name }} - INSTALLED=$(micromamba list ${{ inputs.package_name }}) - echo $INSTALLED - echo "$INSTALLED" | grep "${{ env.VERSION }}" -Fq - - name: Upload built conda package ready for upload on release - uses: actions/upload-artifact@v4 - with: - name: conda-build-${{ matrix.os }}-${{ inputs.package_name }}-${{ inputs.version }} - path: ${{ env.MAMBA_ROOT_PREFIX }}/envs/condabuild/conda-bld/ - retention-days: 3 - if-no-files-found: error + - uses: actions/checkout@v4 + - uses: mamba-org/setup-micromamba@v2 + with: + micromamba-version: '1.5.10-0' + environment-name: condabuild + create-args: >- + python=3.11 + boa + conda-verify + conda=25.5.1 + post-cleanup: all + cache-environment: true + + - name: Add conda channel + run: conda config --add channels city-modelling-lab + + - name: Build conda package + run: conda mambabuild ${{ inputs.recipe_dir }} + + - name: Get version without the v + run: | + TAG=${{ inputs.version }} + echo "VERSION=${TAG#v}" >> $GITHUB_ENV + + - name: Test installing built conda package + run: | + micromamba install -c local ${{ inputs.package_name }} + INSTALLED=$(micromamba list ${{ inputs.package_name }}) + echo $INSTALLED + echo "$INSTALLED" | grep "${{ env.VERSION }}" -Fq + + - name: Upload built conda package ready for upload on release + uses: actions/upload-artifact@v4 + with: + name: conda-build-${{ matrix.os }}-${{ inputs.package_name }}-${{ inputs.version }} + path: ${{ env.MAMBA_ROOT_PREFIX }}/envs/condabuild/conda-bld/ + retention-days: 3 + if-no-files-found: error