From 42c99e799fbebd48b5f853a17ea7de60f6402083 Mon Sep 17 00:00:00 2001 From: AntoinePrv Date: Tue, 31 Oct 2023 10:23:43 +0100 Subject: [PATCH] No cache deletion --- .github/actions/workspace/action.yml | 3 +-- .github/workflows/unix.yml | 35 +++++++++++----------------- 2 files changed, 15 insertions(+), 23 deletions(-) diff --git a/.github/actions/workspace/action.yml b/.github/actions/workspace/action.yml index 4040ff4a8d..da80935fa8 100644 --- a/.github/actions/workspace/action.yml +++ b/.github/actions/workspace/action.yml @@ -14,8 +14,7 @@ inputs: required: true key: required: true - # default: ${{ github.workflow }}-${{ runner.os }}-${{ github.sha }} - default: ${{ runner.os }}-${{ github.sha }} + default: workspace-${{ github.workflow }}-${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }}-${{ github.sha }} token: required: false default: ${{ github.token }} diff --git a/.github/workflows/unix.yml b/.github/workflows/unix.yml index 9feb57daf0..ae81b75f32 100644 --- a/.github/workflows/unix.yml +++ b/.github/workflows/unix.yml @@ -15,6 +15,10 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true +defaults: + run: + shell: bash -l {0} + jobs: build_shared_unix: name: Build binaries @@ -48,11 +52,15 @@ jobs: cmake --build build/ --parallel --target test_libmamba testing_libmamba_lock - name: Show build cache statistics run: sccache --show-stats + - name: Lock environment + run: micromamba env export --explicit > build/environment.lock - name: Save workspace uses: ./.github/actions/workspace with: action: save - path: build/ + path: | + build/ + !build/**/CMakeFiles libmamba_tests_unix: name: libmamba tests @@ -65,37 +73,22 @@ jobs: steps: - name: Checkout mamba repository uses: actions/checkout@v3 - - name: Create build environment - uses: mamba-org/setup-micromamba@v1 - with: - environment-file: ./dev/environment-dev.yml - environment-name: build_env - name: Restore workspace uses: ./.github/actions/workspace with: action: restore path: build/ + - name: Create build environment + uses: mamba-org/setup-micromamba@v1 + with: + environment-file: ./build/environment.lock + environment-name: build_env - name: Run libmamba tests shell: bash -l {0} run: | unset CONDARC # Interferes with tests cd build/libmamba/tests/ && ./test_libmamba - delete_workspace: - name: Delete workspace caches - needs: ["libmamba_tests_unix"] - runs-on: ubuntu-latest - if: always() - steps: - - name: Checkout mamba repository - uses: actions/checkout@v3 - - name: Delete workspace - uses: ./.github/actions/workspace - with: - action: delete - path: build/ - token: "notatoken" - umamba_integration_tests_unix: name: Micromamba integration tests runs-on: ${{ matrix.os }}