-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
158 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# SPDX-FileCopyrightText: 2024 Frans van Dorsselaer | ||
# | ||
# SPDX-License-Identifier: MIT | ||
|
||
--- | ||
# yaml-language-server: $schema=https://json.schemastore.org/github-action.json | ||
|
||
name: 'Calculate cache key' | ||
|
||
description: 'Calculate the cache key for the given runtime' | ||
|
||
inputs: | ||
runtime: | ||
description: 'Runtime identifier' | ||
required: true | ||
|
||
outputs: | ||
key: | ||
description: 'The key value for the runtime cache' | ||
value: ${{ steps.calculate-cache-key.outputs.key }} | ||
|
||
runs: | ||
using: composite | ||
|
||
steps: | ||
- id: calculate-cache-key | ||
shell: bash | ||
run: | | ||
echo "key=runtime-${{ inputs.runtime }}-${{ hashFiles('.gitmodules', 'libc/libc.c', format('.github/workflows/runtime-{0}.yml', inputs.runtime)) }}" \ | ||
>> "$GITHUB_OUTPUT" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# SPDX-FileCopyrightText: 2024 Frans van Dorsselaer | ||
# | ||
# SPDX-License-Identifier: MIT | ||
|
||
--- | ||
# yaml-language-server: $schema=https://json.schemastore.org/github-action.json | ||
|
||
name: 'Lookup runtime cache' | ||
|
||
description: 'Checks if a cache exists for the given runtime' | ||
|
||
inputs: | ||
runtime: | ||
description: 'Runtime identifier' | ||
required: true | ||
|
||
outputs: | ||
cache-hit: | ||
description: 'Indicates if the cache exists or not' | ||
value: ${{ steps.cache-lookup.outputs.cache-hit }} | ||
|
||
runs: | ||
using: composite | ||
|
||
steps: | ||
- id: calculate-cache-key | ||
uses: ./.github/actions/calculate-cache-key | ||
with: | ||
runtime: ${{ inputs.runtime }} | ||
|
||
- id: cache-lookup | ||
uses: actions/cache/restore@v4 | ||
with: | ||
key: ${{ steps.calculate-cache-key.outputs.key }} | ||
with: | ||
path: | | ||
Xmss/runtimes/** | ||
enableCrossOsArchive: true | ||
lookup-only: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# SPDX-FileCopyrightText: 2024 Frans van Dorsselaer | ||
# | ||
# SPDX-License-Identifier: MIT | ||
|
||
--- | ||
# yaml-language-server: $schema=https://json.schemastore.org/github-action.json | ||
|
||
name: 'Restore runtime' | ||
|
||
description: 'Retrieve a previously cached runtime (which must exists)' | ||
|
||
inputs: | ||
runtime: | ||
description: 'Runtime identifier' | ||
required: true | ||
|
||
runs: | ||
using: composite | ||
|
||
steps: | ||
- id: calculate-cache-key | ||
uses: ./.github/actions/calculate-cache-key | ||
with: | ||
runtime: ${{ inputs.runtime }} | ||
|
||
- id: restore | ||
uses: actions/cache/restore@v4 | ||
with: | ||
path: | | ||
Xmss/runtimes/** | ||
key: ${{ steps.calculate-cache-key.outputs.key }} | ||
fail-on-cache-miss: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters