From 74864d2bee85bdf274d9e420abdd185f83dadc4e Mon Sep 17 00:00:00 2001 From: Bryan Weber Date: Thu, 18 Jul 2024 17:24:55 -0400 Subject: [PATCH] Fix download action --- .../actions/download-cantera-test/action.yml | 23 +++++++++++++------ 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/.github/actions/download-cantera-test/action.yml b/.github/actions/download-cantera-test/action.yml index 38a77d1..4d760dd 100644 --- a/.github/actions/download-cantera-test/action.yml +++ b/.github/actions/download-cantera-test/action.yml @@ -7,29 +7,38 @@ inputs: outputs: test-root: description: The root folder where the tests are located - value: ${{ runner.temp }} + value: ${{ steps.sanitize.outputs.DESTINATION_PATH }} runs: using: "composite" steps: + - name: Sanitize the destination path + id: sanitize + run: | + $DESTINATION_PATH = "${{ steps.sanitize.outputs.DESTINATION_PATH }}" -replace "\\", "/" + echo "DESTINATION_PATH=$DESTINATION_PATH" | Out-File -FilePath $Env:GITHUB_OUTPUT -Encoding utf8 -Append + if: runner.os == 'Windows' + - name: Sanitize the destination path + id: sanitize + run: echo "DESTINATION_PATH=${{ steps.sanitize.outputs.DESTINATION_PATH }}" >> $GITHUB_OUTPUT - name: Restore cached the test files uses: actions/cache/restore@v4 id: restore-cache with: - path: ${{ runner.temp }}/test + path: ${{ steps.sanitize.outputs.DESTINATION_PATH }}/test # Bump the integer to bust the cache - key: ${{ inputs.incoming-sha }}-0 + key: ${{ inputs.incoming-sha }}-${{ runner.os }}-0 - name: Download and unpack the tarball if: steps.restore-cache.outputs.cache-hit != 'true' run: | - curl -fsSL "https://github.com/cantera/cantera/archive/${{ inputs.incoming-sha }}.tar.gz" -o ${{ runner.temp }}/cantera.tar.gz - tar -xzf ${{ runner.temp }}/cantera.tar.gz --strip-components=1 -C ${{ runner.temp }} "cantera-${{ inputs.incoming-sha }}/test" - rm ${{ runner.temp }}/cantera.tar.gz + curl -fsSL "https://github.com/cantera/cantera/archive/${{ inputs.incoming-sha }}.tar.gz" -o ${{ steps.sanitize.outputs.DESTINATION_PATH }}/cantera.tar.gz + tar -xzf ${{ steps.sanitize.outputs.DESTINATION_PATH }}/cantera.tar.gz --strip-components=1 -C ${{ steps.sanitize.outputs.DESTINATION_PATH }} "cantera-${{ inputs.incoming-sha }}/test" + rm ${{ steps.sanitize.outputs.DESTINATION_PATH }}/cantera.tar.gz shell: bash - name: Save the test file cache uses: actions/cache/save@v4 if: always() && steps.restore-cache.outputs.cache-hit != true id: save-cache with: - path: ${{ runner.temp }}/test + path: ${{ steps.sanitize.outputs.DESTINATION_PATH }}/test key: ${{ steps.restore-cache.outputs.cache-primary-key }}