mirror of
https://github.com/Swatinem/rust-cache
synced 2025-04-10 22:57:07 +00:00
*: add support for blacksmith cache to rust cache
This commit is contained in:
parent
378c8285a4
commit
d2fc93d000
32
.github/workflows/blacksmith.yml
vendored
Normal file
32
.github/workflows/blacksmith.yml
vendored
Normal file
|
@ -0,0 +1,32 @@
|
|||
name: blacksmith
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
blacksmith:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest, windows-latest]
|
||||
|
||||
name: Test blacksmith provider on ${{ matrix.os }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
env:
|
||||
CARGO_TERM_COLOR: always
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- run: rustup toolchain install stable --profile minimal --no-self-update
|
||||
|
||||
- uses: ./
|
||||
with:
|
||||
workspaces: tests
|
||||
cache-provider: blacksmith
|
||||
|
||||
- run: |
|
||||
cargo check
|
||||
cargo test
|
||||
cargo build --release
|
||||
working-directory: tests
|
2743
dist/restore/index.js
vendored
2743
dist/restore/index.js
vendored
File diff suppressed because it is too large
Load diff
2743
dist/save/index.js
vendored
2743
dist/save/index.js
vendored
File diff suppressed because it is too large
Load diff
28
package-lock.json
generated
28
package-lock.json
generated
|
@ -9,6 +9,7 @@
|
|||
"version": "2.7.2",
|
||||
"license": "LGPL-3.0",
|
||||
"dependencies": {
|
||||
"@actions/blacksmith-cache": "npm:@useblacksmith/cache@3.2.4",
|
||||
"@actions/buildjet-cache": "npm:github-actions.cache-buildjet@0.2.0",
|
||||
"@actions/cache": "^3.2.3",
|
||||
"@actions/core": "^1.10.1",
|
||||
|
@ -26,6 +27,33 @@
|
|||
"url": "https://github.com/sponsors/Swatinem"
|
||||
}
|
||||
},
|
||||
"node_modules/@actions/blacksmith-cache": {
|
||||
"name": "@useblacksmith/cache",
|
||||
"version": "3.2.4",
|
||||
"resolved": "https://registry.npmjs.org/@useblacksmith/cache/-/cache-3.2.4.tgz",
|
||||
"integrity": "sha512-dF6utEJF4l2Wu7jJq5+ghiol5YqgAHLpNqYXAdgWBI7+n323T5TjUjRnx2NrT9x62VHK8UltVgq7uehCbF5alA==",
|
||||
"dependencies": {
|
||||
"@actions/core": "^1.10.0",
|
||||
"@actions/exec": "^1.0.1",
|
||||
"@actions/glob": "^0.1.0",
|
||||
"@actions/http-client": "^2.1.1",
|
||||
"@actions/io": "^1.0.1",
|
||||
"@azure/abort-controller": "^1.1.0",
|
||||
"@azure/ms-rest-js": "^2.6.0",
|
||||
"@azure/storage-blob": "^12.13.0",
|
||||
"semver": "^6.1.0",
|
||||
"uuid": "^3.3.3"
|
||||
}
|
||||
},
|
||||
"node_modules/@actions/blacksmith-cache/node_modules/@actions/glob": {
|
||||
"version": "0.1.2",
|
||||
"resolved": "https://registry.npmjs.org/@actions/glob/-/glob-0.1.2.tgz",
|
||||
"integrity": "sha512-SclLR7Ia5sEqjkJTPs7Sd86maMDw43p769YxBOxvPvEWuPEhpAnBsQfENOpXjFYMmhCqd127bmf+YdvJqVqR4A==",
|
||||
"dependencies": {
|
||||
"@actions/core": "^1.2.6",
|
||||
"minimatch": "^3.0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/@actions/buildjet-cache": {
|
||||
"name": "github-actions.cache-buildjet",
|
||||
"version": "0.2.0",
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
},
|
||||
"homepage": "https://github.com/Swatinem/rust-cache#readme",
|
||||
"dependencies": {
|
||||
"@actions/blacksmith-cache": "npm:@useblacksmith/cache@3.2.4",
|
||||
"@actions/buildjet-cache": "npm:github-actions.cache-buildjet@0.2.0",
|
||||
"@actions/cache": "^3.2.3",
|
||||
"@actions/core": "^1.10.1",
|
||||
|
|
|
@ -2,6 +2,7 @@ import * as core from "@actions/core";
|
|||
import * as exec from "@actions/exec";
|
||||
import * as buildjetCache from "@actions/buildjet-cache";
|
||||
import * as ghCache from "@actions/cache";
|
||||
import * as bsCache from "@actions/blacksmith-cache"
|
||||
import fs from "fs";
|
||||
|
||||
export function reportError(e: any) {
|
||||
|
@ -51,7 +52,7 @@ export interface CacheProvider {
|
|||
|
||||
export function getCacheProvider(): CacheProvider {
|
||||
const cacheProvider = core.getInput("cache-provider");
|
||||
const cache = cacheProvider === "github" ? ghCache : cacheProvider === "buildjet" ? buildjetCache : undefined;
|
||||
const cache = cacheProvider === "github" ? ghCache : cacheProvider === "buildjet" ? buildjetCache : cacheProvider === "blacksmith" ? bsCache : undefined;
|
||||
|
||||
if (!cache) {
|
||||
throw new Error(`The \`cache-provider\` \`{cacheProvider}\` is not valid.`);
|
||||
|
|
Loading…
Reference in a new issue