Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preview v0.0.2 Release #50

Merged
merged 26 commits into from
Nov 4, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
b2cac08
Create CODE_OF_CONDUCT.md
joshmgross Oct 30, 2019
889c603
Update workflow (#1)
joshmgross Oct 31, 2019
7611296
Add Ruby Gem example (#4)
koogawa Oct 31, 2019
83bb08d
Add Cocoapods example (#5)
koogawa Oct 31, 2019
6e37fd1
Add Carthage example (#10)
ry-itto Oct 31, 2019
3743276
Move examples to their own page (#13)
joshmgross Oct 31, 2019
6be35d1
Minor typo in README (#15)
akhyarrh Oct 31, 2019
d676b6c
Update README.md
chrispat Oct 31, 2019
526c940
Prevent commands from executing during tests (#21)
joshmgross Oct 31, 2019
c401b56
Link to NuGet lock files documentation (#20)
zarenner Oct 31, 2019
287ee06
Add trailing dash to Maven fallback key (#19)
zarenner Oct 31, 2019
fc310d4
Fix README.md (#25)
peter7z Oct 31, 2019
aae1376
Exclude documentation from CI tests (#28)
joshmgross Oct 31, 2019
0e86554
Ignore all .md files
joshmgross Nov 1, 2019
2523667
Add note about time-based eviction to README (#30)
dhadka Nov 1, 2019
7058277
Fix typo in error message (#29)
winterjung Nov 1, 2019
d384987
Time based eviction interval is 1 week (#34)
zarenner Nov 1, 2019
25e0c8f
Remove cache checksum debug - close #24 (#26)
ad-m Nov 1, 2019
87c0185
Add Go modules example (#18)
crazy-max Nov 1, 2019
fe98aa6
Fix repo name in contact email (#41)
xt0rted Nov 3, 2019
8c4c641
Add Elixir Mix example (#42)
ghostrick Nov 4, 2019
57f889e
Add cargo example for Rust project (#8)
rhysd Nov 4, 2019
ce4a52a
Stop warning when cache is not found (#40)
poiru Nov 4, 2019
21f72b1
Bump package version
joshmgross Nov 4, 2019
f7a83c3
Release v0.0.2
joshmgross Nov 4, 2019
0400ab3
Merge branch 'preview' into preview-v0.0.2
joshmgross Nov 4, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Stop warning when cache is not found (#40)
The cache not being found is a common situation so very visible warning
is a little too much.
  • Loading branch information
poiru authored and joshmgross committed Nov 4, 2019
commit ce4a52af49a216b8cf2738812233f8a51dee225d
6 changes: 2 additions & 4 deletions src/cacheHttpClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { ArtifactCacheEntry } from "./contracts";

export async function getCacheEntry(
keys: string[]
): Promise<ArtifactCacheEntry> {
): Promise<ArtifactCacheEntry | null> {
const cacheUrl = getCacheUrl();
const token = process.env["ACTIONS_RUNTIME_TOKEN"] || "";
const bearerCredentialHandler = new BearerCredentialHandler(token);
Expand All @@ -28,9 +28,7 @@ export async function getCacheEntry(
getRequestOptions()
);
if (response.statusCode === 204) {
throw new Error(
`Cache not found for input keys: ${JSON.stringify(keys)}.`
);
return null;
}
if (response.statusCode !== 200) {
throw new Error(`Cache service responded with ${response.statusCode}`);
Expand Down
12 changes: 9 additions & 3 deletions src/restore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,20 @@ async function run() {
}

try {
const cacheEntry = await cacheHttpClient.getCacheEntry(keys);
if (!cacheEntry) {
core.info(
`Cache not found for input keys: ${JSON.stringify(keys)}.`
);
return;
}

let archivePath = path.join(
await utils.createTempDirectory(),
"cache.tgz"
);
core.debug(`Archive Path: ${archivePath}`);

const cacheEntry = await cacheHttpClient.getCacheEntry(keys);

// Store the cache result
utils.setCacheState(cacheEntry);

Expand Down Expand Up @@ -92,7 +98,7 @@ async function run() {
utils.setCacheHitOutput(isExactKeyMatch);

core.info(
`Cache restored from key:${cacheEntry && cacheEntry.cacheKey}`
`Cache restored from key: ${cacheEntry && cacheEntry.cacheKey}`
);
} catch (error) {
core.warning(error.message);
Expand Down