better cache paths

ref https://github.com/actions/cache/blob/main/examples.md#deno
This commit is contained in:
Jacob Heider 2023-02-14 18:55:30 -05:00
parent f2710b933b
commit 55ec7e2d30
No known key found for this signature in database
GPG key ID: A98011B5713535BF
5 changed files with 21 additions and 11 deletions

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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 }}

View file

@ -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<<EOF\n${output.cacheSet}\nEOF\n`
Deno.stdout.write(new TextEncoder().encode(rv))