diff --git a/.github/actions/download-cantera-test/action.yml b/.github/actions/download-cantera-test/action.yml index 38a77d1..d938705 100644 --- a/.github/actions/download-cantera-test/action.yml +++ b/.github/actions/download-cantera-test/action.yml @@ -7,29 +7,41 @@ 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' + shell: pwsh + - name: Sanitize the destination path + id: sanitize + run: echo "DESTINATION_PATH=${{ steps.sanitize.outputs.DESTINATION_PATH }}" >> $GITHUB_OUTPUT + shell: bash + if: runner.os != 'Windows' - 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 }}