diff --git a/.github/workflows/check_url.yml b/.github/workflows/check_url.yml index e3fbae2..2744189 100644 --- a/.github/workflows/check_url.yml +++ b/.github/workflows/check_url.yml @@ -80,3 +80,14 @@ jobs: - name: Check if bb runs fine from cache run: bb --version + + - name: Test Cache + run: | + if [ -z "${{ steps.setup-babashka-1.outputs.cache-hit }}" ]; then + echo "Cache-hit output not set in first run. Failing the job." + exit 1 + elif [ "${{ steps.setup-babashka-2.outputs.cache-hit }}" != "true" ]; then + echo "Cache not used in the second run. Failing the job." + exit 1 + fi + shell: bash diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2e4c761..1988dfa 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,3 +14,14 @@ jobs: - name: Check bb runs run: bb --version + + - name: Test Cache + run: | + if [ -z "${{ steps.setup-babashka-1.outputs.cache-hit }}" ]; then + echo "Cache-hit output not set in first run. Failing the job." + exit 1 + elif [ "${{ steps.setup-babashka-2.outputs.cache-hit }}" != "true" ]; then + echo "Cache not used in the second run. Failing the job." + exit 1 + fi + shell: bash diff --git a/.github/workflows/self_check.yml b/.github/workflows/self_check.yml index 9e37191..6a1cade 100644 --- a/.github/workflows/self_check.yml +++ b/.github/workflows/self_check.yml @@ -25,13 +25,16 @@ jobs: with: babashka-version: ${{ matrix.babashka-version }} + - name: Check if bb runs fine from cache + run: bb --version + - name: Test Cache run: | - if [ "${{ steps.setup-babashka-1.outputs.cache-hit }}" != "true" ] && [ "${{ steps.setup-babashka-2.outputs.cache-hit }}" != "true" ]; then - echo "Cache not used. Failing the job." + if [ -z "${{ steps.setup-babashka-1.outputs.cache-hit }}" ]; then + echo "Cache-hit output not set in first run. Failing the job." + exit 1 + elif [ "${{ steps.setup-babashka-2.outputs.cache-hit }}" != "true" ]; then + echo "Cache not used in the second run. Failing the job." exit 1 fi shell: bash - - - name: Check if bb runs fine from cache - run: bb --version diff --git a/src/installer.ts b/src/installer.ts index 933e484..70b08ff 100644 --- a/src/installer.ts +++ b/src/installer.ts @@ -72,17 +72,13 @@ export async function installFromUrl( if (!folder) { core.error(`Unsupported babashka-url ${url}`) - core.setFailed( - 'babashka-url format is unknown. Must me .tar.gz, .zip or .7z' - ) + core.setFailed('babashka-url format is unknown. Must me .tar.gz, .zip or .7z') return } else { const stats = fs.statSync(folder) const fileSizeInBytes = stats.size const fileSizeInMegabytes = fileSizeInBytes / (1024 * 1024) - core.debug( - `Extracted folder ${folder} is ${fileSizeInMegabytes}MB, isDir:${stats.isDirectory()}, isFile:${stats.isFile()}` - ) + core.debug(`Extracted folder ${folder} is ${fileSizeInMegabytes}MB, isDir:${stats.isDirectory()}, isFile:${stats.isFile()}`) const extractedFiles = fs.readdirSync(folder) core.debug(`Extracted files are ${extractedFiles}`) }