From 55ec7e2d30b7bd11974f139cc5db3900d004feb3 Mon Sep 17 00:00:00 2001 From: Jacob Heider Date: Tue, 14 Feb 2023 18:55:30 -0500 Subject: [PATCH] better cache paths ref https://github.com/actions/cache/blob/main/examples.md#deno --- .github/workflows/bottle.yml | 8 ++++++-- .github/workflows/build.yml | 8 ++++++-- .github/workflows/cd.yml | 4 +++- .github/workflows/index-data.yml | 4 +++- scripts/get-platform.ts | 8 +++----- 5 files changed, 21 insertions(+), 11 deletions(-) diff --git a/.github/workflows/bottle.yml b/.github/workflows/bottle.yml index 4c31ad09..b468e2c2 100644 --- a/.github/workflows/bottle.yml +++ b/.github/workflows/bottle.yml @@ -27,7 +27,9 @@ jobs: repository: teaxyz/pantry.core - uses: actions/cache@v3 with: - path: $HOME/.cache/deno + path: | + ~/.deno + ~/.cache/deno key: ${{ runner.os }}-deno-get-platform-${{ hashFiles('deno.jsonc')}} - uses: teaxyz/setup@v0 - run: scripts/get-platform.ts @@ -147,7 +149,9 @@ jobs: - uses: actions/cache@v3 with: - path: $HOME/.cache/deno + path: | + ~/.deno + ~/.cache/deno key: ${{ runner.os }}-deno-bottle-${{ hashFiles('tea.xyz/var/pantry/deno.jsonc')}} - uses: actions/download-artifact@v3 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4ea6c30a..90c624f3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,7 +29,9 @@ jobs: repository: teaxyz/pantry.core - uses: actions/cache@v3 with: - path: $HOME/.cache/deno + path: | + ~/.deno + ~/.cache/deno key: ${{ runner.os }}-deno-get-platform-${{ hashFiles('deno.jsonc')}} - uses: teaxyz/setup@v0 - run: scripts/get-platform.ts ${{ inputs.projects }} @@ -160,7 +162,9 @@ jobs: - uses: actions/checkout@v3 - uses: actions/cache@v3 with: - path: $HOME/.cache/deno + path: | + ~/.deno + ~/.cache/deno key: ${{ runner.os }}-deno-stage-${{ hashFiles('deno.jsonc')}} - uses: teaxyz/setup@v0 diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 080688cf..c2ae5490 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -13,7 +13,9 @@ jobs: - uses: actions/checkout@v3 - uses: actions/cache@v3 with: - path: $HOME/.cache/deno + path: | + ~/.deno + ~/.cache/deno key: ${{ runner.os }}-deno-cd-${{ hashFiles('deno.jsonc')}} - uses: teaxyz/setup@v0 - run: scripts/map-projects-to-githubs.ts diff --git a/.github/workflows/index-data.yml b/.github/workflows/index-data.yml index 1340724a..27306507 100644 --- a/.github/workflows/index-data.yml +++ b/.github/workflows/index-data.yml @@ -14,7 +14,9 @@ jobs: - uses: actions/checkout@v3 - uses: actions/cache@v3 with: - path: $HOME/.cache/deno + path: | + ~/.deno + ~/.cache/deno key: ${{ runner.os }}-deno-queue-detail-ingestion-${{ hashFiles('deno.jsonc')}} - uses: teaxyz/setup@v0 - run: ./scripts/index-packages.ts ${{ inputs.projects }} diff --git a/scripts/get-platform.ts b/scripts/get-platform.ts index e2de7dd4..25d08c9b 100755 --- a/scripts/get-platform.ts +++ b/scripts/get-platform.ts @@ -32,11 +32,9 @@ type OS = string | string[] const platform = Deno.env.get("PLATFORM") ?? panic("$PLATFORM not set") -const home = Deno.env.get("HOME") - const cacheSets = { - "darwin": `${home}/Library/Caches/deno/deps/https/`, - "linux": `${home}/.cache/deno/deps/https/` + "darwin": `~/.deno\n~/Library/Caches/deno/deps/https/`, + "linux": `~/.deno\n~/.cache/deno/deps/https/` } const output: Output = (() => { @@ -95,7 +93,7 @@ const rv = `os=${JSON.stringify(output.os)}\n` + `build-os=${JSON.stringify(output.buildOs)}\n` + `container=${JSON.stringify(output.container)}\n` + `test-matrix=${JSON.stringify(output.testMatrix)}\n` + - `cache-set=${JSON.stringify(output.cacheSet)}\n` + `cache-set<