From c6fc7a23fefe6d4b0cbc81b911181eddad2ed5f7 Mon Sep 17 00:00:00 2001 From: AntoinePrv Date: Tue, 31 Oct 2023 08:49:19 +0100 Subject: [PATCH] Reset --- .github/actions/workspace/action.yml | 27 +++++++++++++++++++-------- .github/workflows/unix.yml | 25 ++++++++++++++++++------- 2 files changed, 37 insertions(+), 15 deletions(-) diff --git a/.github/actions/workspace/action.yml b/.github/actions/workspace/action.yml index 28a5e115d6..4040ff4a8d 100644 --- a/.github/actions/workspace/action.yml +++ b/.github/actions/workspace/action.yml @@ -9,26 +9,37 @@ inputs: options: - save - restore + - delete path: required: true - name: + key: required: true - default: ${{ github.workflow }}-${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }}-${{ github.sha }} + # default: ${{ github.workflow }}-${{ runner.os }}-${{ github.sha }} + default: ${{ runner.os }}-${{ github.sha }} + token: + required: false + default: ${{ github.token }} runs: using: "composite" steps: - name: Create workspace if: ${{ inputs.action == 'save' }} - uses: actions/upload-artifact@v3 + uses: actions/cache/save@v3 with: - name: ${{ inputs.name }} path: ${{ inputs.path }} - retention-days: 1 - if-no-files-found: error + key: ${{ inputs.key }} - name: Restore workspace if: ${{ inputs.action == 'restore' }} - uses: actions/download-artifact@v3 + uses: actions/cache/restore@v3 with: - name: ${{ inputs.name }} path: ${{ inputs.path }} + key: ${{ inputs.key }} + fail-on-cache-miss: true + - name: Delete workspace + if: ${{ inputs.action == 'delete' }} + shell: bash + env: + GH_TOKEN: ${{ inputs.token }} + run: | + gh cache delete ${{ inputs.key }} diff --git a/.github/workflows/unix.yml b/.github/workflows/unix.yml index 66e11b6c2b..9feb57daf0 100644 --- a/.github/workflows/unix.yml +++ b/.github/workflows/unix.yml @@ -52,9 +52,7 @@ jobs: uses: ./.github/actions/workspace with: action: save - path: | - build/ - !build/**/CMakeFiles + path: build/ libmamba_tests_unix: name: libmamba tests @@ -72,7 +70,7 @@ jobs: with: environment-file: ./dev/environment-dev.yml environment-name: build_env - - name: Download builds + - name: Restore workspace uses: ./.github/actions/workspace with: action: restore @@ -81,9 +79,22 @@ jobs: shell: bash -l {0} run: | unset CONDARC # Interferes with tests - cd build/libmamba/tests/ - chmod +x test_libmamba - ./test_libmamba + 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