mirror of
https://github.com/actions/cache.git
synced 2025-04-22 00:29:43 +08:00
Compare commits
651 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
5a3ec84eff | ||
|
7de21022a7 | ||
|
76d40dd347 | ||
|
76dd5eb692 | ||
|
8c80c27c5e | ||
|
45cfd0e7ff | ||
|
edd449b9cf | ||
|
0576707e37 | ||
|
3105dc9754 | ||
|
9450d42d15 | ||
|
7d05b27fb9 | ||
|
507b84c6a6 | ||
|
f248408e15 | ||
|
c30eb5542e | ||
|
5b6ae99d8b | ||
|
eca7c65a55 | ||
|
1b5d75f5cf | ||
|
d4323d4df1 | ||
|
da26677639 | ||
|
7921ae235b | ||
|
3937731706 | ||
|
0c907a75c2 | ||
|
710893c236 | ||
|
9fa7e61ec7 | ||
|
36f1e144e1 | ||
|
53aa38c736 | ||
|
1bd1e32a3b | ||
|
882d7ced4c | ||
|
f2695d7a42 | ||
|
f46ceeb60d | ||
|
e6f5858749 | ||
|
4ae6f21c0d | ||
|
c16df86586 | ||
|
b109c12f3b | ||
|
b7d227d702 | ||
|
faf639248d | ||
|
4bc41c01bd | ||
|
6849a64899 | ||
|
5a1720c49e | ||
|
d9fef48d24 | ||
|
a50e8d027b | ||
|
acc9ae5c14 | ||
|
1ea5f18c31 | ||
|
cc679ff3ba | ||
|
366d43d6f8 | ||
|
02bf31969b | ||
|
6f6220be5a | ||
|
ebdd24ede1 | ||
|
255c8ff306 | ||
|
010f24cd9d | ||
|
d6151ba7db | ||
|
4ca7071576 | ||
|
5d692d65f4 | ||
|
3aef79d3a3 | ||
|
aa55e5f344 | ||
|
772385291f | ||
|
e5dc90df92 | ||
|
8585f2ac5c | ||
|
9803087a86 | ||
|
e7e2547a88 | ||
|
71d826cc33 | ||
|
25942a73ac | ||
|
d73025053b | ||
|
8469c94c6a | ||
|
3624ceb22c | ||
|
2cdf405574 | ||
|
a11fb02296 | ||
|
cf7a75e7b9 | ||
|
c74ca4022c | ||
|
f8a7ab490b | ||
|
45b7be0774 | ||
|
81382a721f | ||
|
c4ee99a3bd | ||
|
57b8e405f0 | ||
|
40c3b67b29 | ||
|
e47d9f9ec8 | ||
|
4a28cbc054 | ||
|
bf9a7572fe | ||
|
0c45773b62 | ||
|
8a55f839aa | ||
|
3884cace14 | ||
|
e29dad3e36 | ||
|
ab5e6d0c87 | ||
|
89c7d86c71 | ||
|
d2c84da363 | ||
|
37e7d4eb16 | ||
|
a18323f504 | ||
|
104f95683b | ||
|
a2ed59d39b | ||
|
dc88ab52d7 | ||
|
1d78355196 | ||
|
c36458f13b | ||
|
13aacd865c | ||
|
53b35c5439 | ||
|
65b8989fab | ||
|
d0be34d544 | ||
|
66cf064d47 | ||
|
1326563738 | ||
|
e12d46a63a | ||
|
1baebfc3ba | ||
|
eb94f1a6bf | ||
|
e71876755e | ||
|
01229828ff | ||
|
3185ecfd61 | ||
|
25618a0a67 | ||
|
a0a285ffd4 | ||
|
b00bedba4a | ||
|
99d573b49d | ||
|
6f0a1fdd90 | ||
|
2001ca4114 | ||
|
0e9aed0d0d | ||
|
3b7dac1789 | ||
|
b1378c8403 | ||
|
704facf57e | ||
|
17e2888746 | ||
|
667d8fdfa2 | ||
|
f7ebb81a3f | ||
|
67b839edb6 | ||
|
57f0e3f198 | ||
|
04f198bf0b | ||
|
bd9b49b6c3 | ||
|
ea0503788c | ||
|
6a1a45d49b | ||
|
9c7b3e90bd | ||
|
8f2671f18e | ||
|
6f1f1e10f3 | ||
|
5cb4bb86c0 | ||
|
84995e0d91 | ||
|
bf96a3f9d8 | ||
|
4b8460cbff | ||
|
57014a2baa | ||
|
cb865c1889 | ||
|
4e7c82221f | ||
|
88522ab9f3 | ||
|
ef11f54eee | ||
|
4b381be638 | ||
|
7893481812 | ||
|
940f3d7cf1 | ||
|
e0d62270e2 | ||
|
77eb7eb198 | ||
|
69d9d449ac | ||
|
8d3a1e02aa | ||
|
b1db4b4897 | ||
|
7d4d6f7ffd | ||
|
8f7fa5d715 | ||
|
95b455a0fb | ||
|
81b7281936 | ||
|
6998d139dd | ||
|
2b8105bdae | ||
|
e08330827d | ||
|
22d3da765b | ||
|
627f0f41f6 | ||
|
8e3048d0f7 | ||
|
1b004e8a69 | ||
|
75b110bc85 | ||
|
2b5a782c64 | ||
|
6c2de3ba98 | ||
|
b63536828e | ||
|
cd2aaa9df8 | ||
|
9b7ef12f3e | ||
|
3c08cab74f | ||
|
8315026919 | ||
|
4791017169 | ||
|
22cbf49050 | ||
|
5868318cdc | ||
|
804b679d21 | ||
|
c9869a589f | ||
|
003f5452bf | ||
|
efacb0248b | ||
|
76ee6bdfdc | ||
|
9183691e97 | ||
|
094a24099d | ||
|
87396fe6b4 | ||
|
e630eda107 | ||
|
58c146cc91 | ||
|
6fd2d4538c | ||
|
1f414295fe | ||
|
365406cb70 | ||
|
d6217569d5 | ||
|
84e54000da | ||
|
d0e7eb01c9 | ||
|
4723a57e26 | ||
|
d1507cccba | ||
|
3337563725 | ||
|
d70353d8a4 | ||
|
60c7666709 | ||
|
b053f2b699 | ||
|
501277cfd7 | ||
|
c1a5de879e | ||
|
9b0be58822 | ||
|
c17f4bf466 | ||
|
ac25611cae | ||
|
dc097e3bb9 | ||
|
fb86cbf360 | ||
|
a57932faba | ||
|
04b13caea4 | ||
|
941bc71a24 | ||
|
08d8639046 | ||
|
a2f324eeb7 | ||
|
35f4702f6c | ||
|
e050ebdd63 | ||
|
0d47d164e9 | ||
|
e2d614414f | ||
|
532752012e | ||
|
b26da1fc31 | ||
|
ce61cc4d24 | ||
|
268ae08cbc | ||
|
b4ac56fa43 | ||
|
24f54d74c0 | ||
|
8d99052cbc | ||
|
58a0402e7d | ||
|
7920f570b8 | ||
|
f8116c8945 | ||
|
2a6cd14175 | ||
|
651d82954c | ||
|
cfa1b7695d | ||
|
fa8856311e | ||
|
ef145dd134 | ||
|
6babf202a4 | ||
|
5c79b3fd6c | ||
|
3ff04605d3 | ||
|
db8d946d18 | ||
|
0e93819da5 | ||
|
9a6a4f6079 | ||
|
d0af8a3ecc | ||
|
8bec1e4cc3 | ||
|
14f2d18ea2 | ||
|
083fb3041b | ||
|
5085ac92ef | ||
|
76639bb4e5 | ||
|
5294b3f306 | ||
|
4fe9c4bd54 | ||
|
2b04a41915 | ||
|
9b0c1fce7a | ||
|
18103f63fe | ||
|
3e383cd9c3 | ||
|
43428ea056 | ||
|
1c73980b09 | ||
|
a3f5edc237 | ||
|
831ee695a5 | ||
|
b9c8bfe442 | ||
|
0f20846208 | ||
|
862fc14188 | ||
|
f77a0d297b | ||
|
50a4a3a126 | ||
|
56461b9eb0 | ||
|
f85d12c3b2 | ||
|
98044e486f | ||
|
edc49897ec | ||
|
68d96986b5 | ||
|
ac8075791e | ||
|
0ff0597934 | ||
|
12681847c6 | ||
|
3238536a48 | ||
|
1a78ace131 | ||
|
1bc650b06c | ||
|
92e01f4797 | ||
|
b195c997a4 | ||
|
9f98a2f01c | ||
|
471fb0c87e | ||
|
a213d1e898 | ||
|
0c180092a2 | ||
|
c38f55d874 | ||
|
2865f2c28c | ||
|
f52a12d355 | ||
|
a057257949 | ||
|
d1124f7857 | ||
|
7b5e3aaf23 | ||
|
eb8b610ee6 | ||
|
27c0af5532 | ||
|
7e7820edca | ||
|
6c9470d12d | ||
|
a59a2347a7 | ||
|
d785f8b8a2 | ||
|
81423d07fe | ||
|
c1dbd4593f | ||
|
5f975d03e6 | ||
|
8a9a57869f | ||
|
fb1d96e3ff | ||
|
2048ecfa86 | ||
|
8954b07458 | ||
|
0ae6818675 | ||
|
f316f94f31 | ||
|
204fa1ab69 | ||
|
fd5de65bc8 | ||
|
d49b6bb21d | ||
|
23d218be27 | ||
|
a7c34adf76 | ||
|
83394c99b7 | ||
|
e839c25979 | ||
|
33a923d660 | ||
|
a404368986 | ||
|
f4278025ab | ||
|
9916fe1701 | ||
|
318935ef66 | ||
|
85efbb58b9 | ||
|
4387dbc81a | ||
|
71e3ee5cce | ||
|
c316eb7911 | ||
|
0865c47f36 | ||
|
354a2ae15e | ||
|
baed3516c3 | ||
|
8829e97be1 | ||
|
eec8cd3f5f | ||
|
5cc84c0123 | ||
|
a0e530f115 | ||
|
afc669e7fc | ||
|
a0efc56c52 | ||
|
d25c51bbfd | ||
|
a080a3bda4 | ||
|
02be3a9c73 | ||
|
c3f1317a9e | ||
|
d0a54b996c | ||
|
8c5bd0c82d | ||
|
c9c0f73558 | ||
|
2b6caae3c9 | ||
|
dd58d1315f | ||
|
acace7fa1b | ||
|
438628ac22 | ||
|
c296e6a08c | ||
|
7ed7f22ed8 | ||
|
30f413bfed | ||
|
f2ea0f25f2 | ||
|
d5956bbc3c | ||
|
a686c72e4a | ||
|
8e680ea440 | ||
|
c376fc84c9 | ||
|
4ce1a96732 | ||
|
a2bd439f8e | ||
|
35ef551d1f | ||
|
14c4fd4871 | ||
|
455d267066 | ||
|
ccaf2d8fb1 | ||
|
34f9efca11 | ||
|
11dd8059a1 | ||
|
e19e89eb2a | ||
|
95f200e41c | ||
|
9c784e290b | ||
|
a34051afb0 | ||
|
bdb21a7177 | ||
|
d55d005ab0 | ||
|
b44d6c5cbf | ||
|
60742c2acf | ||
|
12086c7bbf | ||
|
626c44ce85 | ||
|
f2d5621efc | ||
|
cab6d27614 | ||
|
69811fd677 | ||
|
887b9060fe | ||
|
c6762fdd6a | ||
|
95c3ae75f4 | ||
|
797382fe42 | ||
|
36dbd93a7c | ||
|
45f362d0ca | ||
|
ca0688b4ab | ||
|
ef8498dcba | ||
|
8f1e2e0286 | ||
|
48af2dc4a9 | ||
|
f63a711791 | ||
|
770a27cf65 | ||
|
c2131abcd8 | ||
|
575160481d | ||
|
136d96b4ae | ||
|
7d4f40b464 | ||
|
2d8d0d1c9b | ||
|
7799d864d9 | ||
|
4b0cf6cc46 | ||
|
60c606a2b4 | ||
|
b6e9a919a7 | ||
|
c842503583 | ||
|
2b7da2a62c | ||
|
3722efebf1 | ||
|
deae296ab3 | ||
|
c7c46bcb6d | ||
|
6535c5fb5f | ||
|
3fdafa472e | ||
|
341e6d75d9 | ||
|
3fe001f5ca | ||
|
ab4bea262c | ||
|
7772fcab79 | ||
|
6c2ab9416b | ||
|
2c7b30f330 | ||
|
73cb7e0405 | ||
|
757c5a8ca4 | ||
|
4e817c1f42 | ||
|
5074380beb | ||
|
72d1e4fdff | ||
|
8e70c71aee | ||
|
4d3516739c | ||
|
9c2f1a93d4 | ||
|
5df1ae880d | ||
|
45bb0b1552 | ||
|
b32c91dfec | ||
|
7f8b9fe1f0 | ||
|
0ac93353cd | ||
|
051d7bc106 | ||
|
934cc8fa30 | ||
|
35dd74a1a0 | ||
|
869d93f182 | ||
|
a848fb313f | ||
|
de7c17c6a9 | ||
|
611465405c | ||
|
c64c5261d3 | ||
|
4e8aa1cc93 | ||
|
f7a7367bb2 | ||
|
3bb5ffcc9c | ||
|
e6890046a6 | ||
|
62fa565f30 | ||
|
e882008267 | ||
|
8e0501dcaf | ||
|
a3b6799c91 | ||
|
bd49291365 | ||
|
937d244753 | ||
|
eb0698d1c5 | ||
|
67b6d52d50 | ||
|
92f67a4829 | ||
|
447f0fd1d3 | ||
|
47e8bd685f | ||
|
795a8f09a9 | ||
|
6bbe742add | ||
|
c9db520cf3 | ||
|
10906ba9cd | ||
|
2ebdcff279 | ||
|
5807af2642 | ||
|
0638051e9a | ||
|
c64c572235 | ||
|
cc2d767a72 | ||
|
2fa955d825 | ||
|
4762de4681 | ||
|
3a696372f2 | ||
|
366e5ba022 | ||
|
12ed05f49a | ||
|
8d3f2fc3ce | ||
|
1a9e2138d9 | ||
|
981fa981ed | ||
|
4498c5b4d8 | ||
|
3767bf0386 | ||
|
4134e6de47 | ||
|
2086306d9c | ||
|
26968a09c0 | ||
|
aeaf731ae2 | ||
|
56a8a2f775 | ||
|
1bfe3accb3 | ||
|
354332455a | ||
|
3303695afa | ||
|
e64ab303d1 | ||
|
26c48dce83 | ||
|
72f66cfa6d | ||
|
009fe4e01c | ||
|
9f3a4d3e65 | ||
|
7b630ee04f | ||
|
d2583f08bc | ||
|
752e778edb | ||
|
a3047dcdce | ||
|
9c77c9dbfc | ||
|
29cdd22c60 | ||
|
62a4d75442 | ||
|
0781355a23 | ||
|
22c64ac772 | ||
|
cbbf882ea4 | ||
|
4557c6a937 | ||
|
8819edf476 | ||
|
19530ba135 | ||
|
d1255ad936 | ||
|
68cfb2ccb7 | ||
|
cce3c03a74 | ||
|
4bceb75b5b | ||
|
a6f1f4b32e | ||
|
d606e039ae | ||
|
d3e4f218f3 | ||
|
55a5894438 | ||
|
3f6dfcbcc4 | ||
|
0f71d4ac9a | ||
|
2850cd8f45 | ||
|
67f61c6e6b | ||
|
4d604c6cce | ||
|
d33b5077b5 | ||
|
765fb6d234 | ||
|
11e417fa43 | ||
|
8b407f7777 | ||
|
5ca27f25cb | ||
|
244fc0ba29 | ||
|
943d2a4dac | ||
|
01f7f296b1 | ||
|
ab48bf6f67 | ||
|
59a8d125e7 | ||
|
d29c1df198 | ||
|
d59a1464f2 | ||
|
481a91ba10 | ||
|
35f35f44e8 | ||
|
ca1c035094 | ||
|
4978dc4f31 | ||
|
66891cb075 | ||
|
5c77066753 | ||
|
24fb121989 | ||
|
55bbcc2eab | ||
|
c5475843b3 | ||
|
0065ae9713 | ||
|
4aa79d91d3 | ||
|
5474af707f | ||
|
591646a21e | ||
|
eed9cfe64d | ||
|
b773382817 | ||
|
984ce638f0 | ||
|
ff937cc950 | ||
|
d60d2bef10 | ||
|
e561127c3e | ||
|
b8204782bb | ||
|
e6c708b5ce | ||
|
581312be20 | ||
|
9ab95382c8 | ||
|
6c7d57dc97 | ||
|
2b83e91661 | ||
|
1034aaeec8 | ||
|
bcc23b930f | ||
|
249a22026d | ||
|
7f9517a009 | ||
|
16a133d9a7 | ||
|
46fead7f5e | ||
|
bac1a40c81 | ||
|
916cc60b3c | ||
|
4967c8e6c5 | ||
|
a0024e2bd0 | ||
|
5ddc028cc8 | ||
|
05b13411a0 | ||
|
e756b19f93 | ||
|
354f70a56c | ||
|
ddc4681e8d | ||
|
29b4783cc7 | ||
|
2403bbedac | ||
|
ccc66f769e | ||
|
5d8c995f20 | ||
|
ce9276c90e | ||
|
9eb452c280 | ||
|
75cd46ec0c | ||
|
a5d9a3b1a6 | ||
|
97f7baa910 | ||
|
9ceee97d99 | ||
|
ccf9619480 | ||
|
9f07ee13de | ||
|
1ed0c23029 | ||
|
54626c4a4f | ||
|
48b62c1c52 | ||
|
9bb13c71ec | ||
|
8b2a57849f | ||
|
f00dedfa6c | ||
|
12b87469d4 | ||
|
52046d1409 | ||
|
08438313d5 | ||
|
7ccdf5c70d | ||
|
306f72536b | ||
|
4fa017f2b7 | ||
|
78809b91d7 | ||
|
a4e3c3b64e | ||
|
e5370355e6 | ||
|
0e86d5c038 | ||
|
2ba9edf492 | ||
|
f15bc7a0d9 | ||
|
b6b8aa78d8 | ||
|
272268544c | ||
|
64f8769515 | ||
|
4a724707e9 | ||
|
f60097cd16 | ||
|
eb78578266 | ||
|
22d71e33ad | ||
|
b13df3fa54 | ||
|
cae64ca3cd | ||
|
af8651e0c5 | ||
|
6c471ae9f6 | ||
|
206172ea8e | ||
|
5833d5c131 | ||
|
826785142a | ||
|
8e9c167fd7 | ||
|
e8230b28a9 | ||
|
4944275b95 | ||
|
78a4b2143b | ||
|
4dc4b4e758 | ||
|
85aee6a487 | ||
|
fab26f3f4f | ||
|
4887979af8 | ||
|
f9c9166ecb | ||
|
23e301d35c | ||
|
e43776276f | ||
|
b6d538e2aa | ||
|
296374f6c9 | ||
|
6c11532937 | ||
|
c33bff8d72 | ||
|
d1991bb4c5 | ||
|
60e292adf7 | ||
|
c262ac0154 | ||
|
1da52de10f | ||
|
b45d91cc4b | ||
|
a631fadf14 | ||
|
e223b0a12d | ||
|
decbafc350 | ||
|
3854a40aee | ||
|
0188dffc5a | ||
|
002d3a77f4 | ||
|
4809f4ada4 | ||
|
3d01b4eb53 | ||
|
95c1798369 | ||
|
639f9d8b81 | ||
|
d9fe1b81f9 | ||
|
92ae3b63f8 | ||
|
84b3b283f0 | ||
|
8d14a2150b | ||
|
c0584c42d1 | ||
|
bb828da54c | ||
|
7e7aef2963 | ||
|
b7d83b4095 | ||
|
50a2fdee6f | ||
|
f0cbadd748 | ||
|
4657a5f525 | ||
|
fb50aa45ec | ||
|
31508256ff | ||
|
bc821d0c12 | ||
|
bde557aefd | ||
|
4b0709a0d5 | ||
|
ecf6eea708 | ||
|
eb10706a9d | ||
|
30524a6fbd | ||
|
b034b26a44 | ||
|
e1ed41a9c9 | ||
|
5f4d4d4555 | ||
|
5d3ad75a2b | ||
|
d8c5e69fe2 | ||
|
f66a56e59e | ||
|
21f72b1fcc | ||
|
ce4a52af49 | ||
|
57f889e86e | ||
|
8c4c641fa0 | ||
|
fe98aa6782 | ||
|
87c0185d27 | ||
|
25e0c8faac | ||
|
d384987622 | ||
|
7058277028 | ||
|
2523667574 | ||
|
0e86554410 | ||
|
aae1376422 | ||
|
fc310d4670 | ||
|
287ee0671b | ||
|
c401b561b2 | ||
|
526c940a94 | ||
|
d676b6c354 | ||
|
6be35d19ef | ||
|
3743276c66 | ||
|
6e37fd16ea | ||
|
83bb08ded3 | ||
|
7611296bb3 | ||
|
889c603691 | ||
|
b2cac08cff |
14
.devcontainer/devcontainer.json
Normal file
14
.devcontainer/devcontainer.json
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"name": "Node.js & TypeScript",
|
||||||
|
"image": "mcr.microsoft.com/devcontainers/typescript-node:16-bullseye",
|
||||||
|
// Features to add to the dev container. More info: https://containers.dev/implementors/features.
|
||||||
|
// "features": {},
|
||||||
|
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
||||||
|
// "forwardPorts": [],
|
||||||
|
// Use 'postCreateCommand' to run commands after the container is created.
|
||||||
|
"postCreateCommand": "npm install"
|
||||||
|
// Configure tool-specific properties.
|
||||||
|
// "customizations": {},
|
||||||
|
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
|
||||||
|
// "remoteUser": "root"
|
||||||
|
}
|
22
.eslintrc.json
Normal file
22
.eslintrc.json
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
{
|
||||||
|
"env": { "node": true, "jest": true },
|
||||||
|
"parser": "@typescript-eslint/parser",
|
||||||
|
"parserOptions": { "ecmaVersion": 2020, "sourceType": "module" },
|
||||||
|
"extends": [
|
||||||
|
"eslint:recommended",
|
||||||
|
"plugin:@typescript-eslint/eslint-recommended",
|
||||||
|
"plugin:@typescript-eslint/recommended",
|
||||||
|
"plugin:import/errors",
|
||||||
|
"plugin:import/warnings",
|
||||||
|
"plugin:import/typescript",
|
||||||
|
"plugin:prettier/recommended"
|
||||||
|
],
|
||||||
|
"plugins": ["@typescript-eslint", "simple-import-sort", "jest"],
|
||||||
|
"rules": {
|
||||||
|
"import/first": "error",
|
||||||
|
"import/newline-after-import": "error",
|
||||||
|
"import/no-duplicates": "error",
|
||||||
|
"simple-import-sort/imports": "error",
|
||||||
|
"sort-imports": "off"
|
||||||
|
}
|
||||||
|
}
|
2
.gitattributes
vendored
Normal file
2
.gitattributes
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
.licenses/** -diff linguist-generated=true
|
||||||
|
* text=auto eol=lf
|
1
.github/CODEOWNERS
vendored
Normal file
1
.github/CODEOWNERS
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
* @actions/actions-cache
|
22
.github/dependabot.yml
vendored
Normal file
22
.github/dependabot.yml
vendored
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
# To get started with Dependabot version updates, you'll need to specify which
|
||||||
|
# package ecosystems to update and where the package manifests are located.
|
||||||
|
# Please see the documentation for all configuration options:
|
||||||
|
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
|
||||||
|
|
||||||
|
version: 2
|
||||||
|
updates:
|
||||||
|
- package-ecosystem: "github-actions"
|
||||||
|
directory: "/"
|
||||||
|
schedule:
|
||||||
|
interval: "weekly"
|
||||||
|
groups:
|
||||||
|
minor-actions-dependencies:
|
||||||
|
update-types: [minor, patch]
|
||||||
|
|
||||||
|
- package-ecosystem: "npm"
|
||||||
|
directory: "/"
|
||||||
|
schedule:
|
||||||
|
interval: "daily"
|
||||||
|
allow:
|
||||||
|
- dependency-type: direct
|
||||||
|
- dependency-type: production
|
32
.github/pull_request_template.md
vendored
Normal file
32
.github/pull_request_template.md
vendored
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
<!--- Provide a general summary of your changes in the Title above -->
|
||||||
|
|
||||||
|
## Description
|
||||||
|
<!--- Describe your changes in detail -->
|
||||||
|
|
||||||
|
## Motivation and Context
|
||||||
|
<!--- Why is this change required? What problem does it solve? -->
|
||||||
|
<!--- If it fixes an open issue, please link to the issue here. -->
|
||||||
|
|
||||||
|
## How Has This Been Tested?
|
||||||
|
<!--- Please describe in detail how you tested your changes. -->
|
||||||
|
<!--- Include details of your testing environment, and the tests you ran to -->
|
||||||
|
<!--- see how your change affects other areas of the code, etc. -->
|
||||||
|
|
||||||
|
## Screenshots (if appropriate):
|
||||||
|
|
||||||
|
## Types of changes
|
||||||
|
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
|
||||||
|
- [ ] Bug fix (non-breaking change which fixes an issue)
|
||||||
|
- [ ] New feature (non-breaking change which adds functionality)
|
||||||
|
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
|
||||||
|
- [ ] Documentation (add or update README or docs)
|
||||||
|
|
||||||
|
## Checklist:
|
||||||
|
<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
|
||||||
|
<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
|
||||||
|
- [ ] My code follows the code style of this project.
|
||||||
|
- [ ] My change requires a change to the documentation.
|
||||||
|
- [ ] I have updated the documentation accordingly.
|
||||||
|
- [ ] I have read the **CONTRIBUTING** document.
|
||||||
|
- [ ] I have added tests to cover my changes.
|
||||||
|
- [ ] All new and existing tests passed.
|
19
.github/workflows/check-dist.yml
vendored
Normal file
19
.github/workflows/check-dist.yml
vendored
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
name: Check dist/
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
paths-ignore:
|
||||||
|
- '**.md'
|
||||||
|
pull_request:
|
||||||
|
paths-ignore:
|
||||||
|
- '**.md'
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
call-check-dist:
|
||||||
|
name: Check dist/
|
||||||
|
uses: actions/reusable-workflows/.github/workflows/check-dist.yml@main
|
||||||
|
with:
|
||||||
|
node-version: "20.x"
|
22
.github/workflows/close-inactive-issues.yml
vendored
Normal file
22
.github/workflows/close-inactive-issues.yml
vendored
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
name: Close inactive issues
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
- cron: "30 8 * * *"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
close-issues:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
issues: write
|
||||||
|
pull-requests: write
|
||||||
|
steps:
|
||||||
|
- uses: actions/stale@v9
|
||||||
|
with:
|
||||||
|
days-before-issue-stale: 200
|
||||||
|
days-before-issue-close: 5
|
||||||
|
stale-issue-label: "stale"
|
||||||
|
stale-issue-message: "This issue is stale because it has been open for 200 days with no activity. Leave a comment to avoid closing this issue in 5 days."
|
||||||
|
close-issue-message: "This issue was closed because it has been inactive for 5 days since being marked as stale."
|
||||||
|
days-before-pr-stale: -1
|
||||||
|
days-before-pr-close: -1
|
||||||
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
46
.github/workflows/codeql.yml
vendored
Normal file
46
.github/workflows/codeql.yml
vendored
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
name: "Code scanning - action"
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
pull_request:
|
||||||
|
schedule:
|
||||||
|
- cron: '0 19 * * 0'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
CodeQL-Build:
|
||||||
|
# CodeQL runs on ubuntu-latest, windows-latest, and macos-latest
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
# required for all workflows
|
||||||
|
security-events: write
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
# Initializes the CodeQL tools for scanning.
|
||||||
|
- name: Initialize CodeQL
|
||||||
|
uses: github/codeql-action/init@v3
|
||||||
|
# Override language selection by uncommenting this and choosing your languages
|
||||||
|
# with:
|
||||||
|
# languages: go, javascript, csharp, python, cpp, java, ruby
|
||||||
|
|
||||||
|
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
|
||||||
|
# If this step fails, then you should remove it and run the build manually (see below).
|
||||||
|
- name: Autobuild
|
||||||
|
uses: github/codeql-action/autobuild@v3
|
||||||
|
|
||||||
|
# ℹ️ Command-line programs to run using the OS shell.
|
||||||
|
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
|
||||||
|
|
||||||
|
# ✏️ If the Autobuild fails above, remove it and uncomment the following
|
||||||
|
# three lines and modify them (or add more) to build your code if your
|
||||||
|
# project uses a compiled language
|
||||||
|
|
||||||
|
#- run: |
|
||||||
|
# make bootstrap
|
||||||
|
# make release
|
||||||
|
|
||||||
|
- name: Perform CodeQL Analysis
|
||||||
|
uses: github/codeql-action/analyze@v3
|
16
.github/workflows/issue-opened-workflow.yml
vendored
Normal file
16
.github/workflows/issue-opened-workflow.yml
vendored
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
name: Assign issue
|
||||||
|
on:
|
||||||
|
issues:
|
||||||
|
types: [opened]
|
||||||
|
jobs:
|
||||||
|
run-action:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Get current oncall
|
||||||
|
id: oncall
|
||||||
|
run: |
|
||||||
|
echo "CURRENT=$(curl --request GET 'https://api.pagerduty.com/oncalls?include[]=users&schedule_ids[]=P5VG2BX&earliest=true' --header 'Authorization: Token token=${{ secrets.PAGERDUTY_TOKEN }}' --header 'Accept: application/vnd.pagerduty+json;version=2' --header 'Content-Type: application/json' | jq -r '.oncalls[].user.name')" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: add_assignees
|
||||||
|
run: |
|
||||||
|
curl -X POST -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN}}" https://api.github.com/repos/${{github.repository}}/issues/${{ github.event.issue.number}}/assignees -d '{"assignees":["${{steps.oncall.outputs.CURRENT}}"]}'
|
15
.github/workflows/licensed.yml
vendored
Normal file
15
.github/workflows/licensed.yml
vendored
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
name: Licensed
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
call-licensed:
|
||||||
|
name: Licensed
|
||||||
|
uses: actions/reusable-workflows/.github/workflows/licensed.yml@main
|
20
.github/workflows/pr-opened-workflow.yml
vendored
Normal file
20
.github/workflows/pr-opened-workflow.yml
vendored
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
name: Add Reviewer PR
|
||||||
|
on:
|
||||||
|
pull_request_target:
|
||||||
|
types: [opened]
|
||||||
|
jobs:
|
||||||
|
run-action:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Get current oncall
|
||||||
|
id: oncall
|
||||||
|
run: |
|
||||||
|
echo "CURRENT=$(curl --request GET 'https://api.pagerduty.com/oncalls?include[]=users&schedule_ids[]=P5VG2BX&earliest=true' --header 'Authorization: Token token=${{ secrets.PAGERDUTY_TOKEN }}' --header 'Accept: application/vnd.pagerduty+json;version=2' --header 'Content-Type: application/json' | jq -r '.oncalls[].user.name')" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Request Review
|
||||||
|
run: |
|
||||||
|
curl -X POST -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN}}" https://api.github.com/repos/${{github.repository}}/pulls/${{ github.event.pull_request.number}}/requested_reviewers -d '{"reviewers":["${{steps.oncall.outputs.CURRENT}}"]}'
|
||||||
|
|
||||||
|
- name: Add Assignee
|
||||||
|
run: |
|
||||||
|
curl -X POST -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN}}" https://api.github.com/repos/${{github.repository}}/issues/${{ github.event.pull_request.number}}/assignees -d '{"assignees":["${{steps.oncall.outputs.CURRENT}}"]}'
|
20
.github/workflows/publish-immutable-actions.yml
vendored
Normal file
20
.github/workflows/publish-immutable-actions.yml
vendored
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
name: 'Publish Immutable Action Version'
|
||||||
|
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [released]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
publish:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
id-token: write
|
||||||
|
packages: write
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checking out
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- name: Publish
|
||||||
|
id: publish
|
||||||
|
uses: actions/publish-immutable-action@0.0.3
|
28
.github/workflows/release-new-action-version.yml
vendored
Normal file
28
.github/workflows/release-new-action-version.yml
vendored
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
name: Release new action version
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [released]
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
TAG_NAME:
|
||||||
|
description: 'Tag name that the major tag will point to'
|
||||||
|
required: true
|
||||||
|
|
||||||
|
env:
|
||||||
|
TAG_NAME: ${{ github.event.inputs.TAG_NAME || github.event.release.tag_name }}
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
update_tag:
|
||||||
|
name: Update the major tag to include the ${{ github.event.inputs.TAG_NAME || github.event.release.tag_name }} changes
|
||||||
|
environment:
|
||||||
|
name: releaseNewActionVersion
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Update the ${{ env.TAG_NAME }} tag
|
||||||
|
id: update-major-tag
|
||||||
|
uses: actions/publish-action@v0.3.0
|
||||||
|
with:
|
||||||
|
source-tag: ${{ env.TAG_NAME }}
|
||||||
|
slack-webhook: ${{ secrets.SLACK_WEBHOOK }}
|
124
.github/workflows/workflow.yml
vendored
124
.github/workflows/workflow.yml
vendored
@ -1,31 +1,129 @@
|
|||||||
name: Tests
|
name: Tests
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
- releases/**
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- main
|
||||||
paths-ignore:
|
- releases/**
|
||||||
- '**.md'
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
# Build and unit test
|
||||||
name: Test on ${{ matrix.os }}
|
build:
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-latest, windows-latest, macOS-latest]
|
os: [ubuntu-latest, windows-latest, macOS-latest]
|
||||||
|
fail-fast: false
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
- uses: actions/setup-node@v1
|
- name: Setup Node.js 20.x
|
||||||
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: '12.x'
|
node-version: 20.x
|
||||||
|
cache: npm
|
||||||
- run: npm ci
|
- run: npm ci
|
||||||
|
|
||||||
- name: Prettier Format Check
|
- name: Prettier Format Check
|
||||||
run: npm run format-check
|
run: npm run format-check
|
||||||
|
- name: ESLint Check
|
||||||
|
run: npm run lint
|
||||||
- name: Build & Test
|
- name: Build & Test
|
||||||
run: npm run test
|
run: npm run test
|
||||||
|
|
||||||
|
# End to end save and restore
|
||||||
|
test-save:
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
os: [ubuntu-latest, windows-latest, macOS-latest]
|
||||||
|
fail-fast: false
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- name: Generate files in working directory
|
||||||
|
shell: bash
|
||||||
|
run: __tests__/create-cache-files.sh ${{ runner.os }} test-cache
|
||||||
|
- name: Generate files outside working directory
|
||||||
|
shell: bash
|
||||||
|
run: __tests__/create-cache-files.sh ${{ runner.os }} ~/test-cache
|
||||||
|
- name: Save cache
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
key: test-${{ runner.os }}-${{ github.run_id }}
|
||||||
|
path: |
|
||||||
|
test-cache
|
||||||
|
~/test-cache
|
||||||
|
test-restore:
|
||||||
|
needs: test-save
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
os: [ubuntu-latest, windows-latest, macOS-latest]
|
||||||
|
fail-fast: false
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- name: Restore cache
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
key: test-${{ runner.os }}-${{ github.run_id }}
|
||||||
|
path: |
|
||||||
|
test-cache
|
||||||
|
~/test-cache
|
||||||
|
- name: Verify cache files in working directory
|
||||||
|
shell: bash
|
||||||
|
run: __tests__/verify-cache-files.sh ${{ runner.os }} test-cache
|
||||||
|
- name: Verify cache files outside working directory
|
||||||
|
shell: bash
|
||||||
|
run: __tests__/verify-cache-files.sh ${{ runner.os }} ~/test-cache
|
||||||
|
|
||||||
|
# End to end with proxy
|
||||||
|
test-proxy-save:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container:
|
||||||
|
image: ubuntu:latest
|
||||||
|
options: --dns 127.0.0.1
|
||||||
|
services:
|
||||||
|
squid-proxy:
|
||||||
|
image: ubuntu/squid:latest
|
||||||
|
ports:
|
||||||
|
- 3128:3128
|
||||||
|
env:
|
||||||
|
https_proxy: http://squid-proxy:3128
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- name: Generate files
|
||||||
|
run: __tests__/create-cache-files.sh proxy test-cache
|
||||||
|
- name: Save cache
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
key: test-proxy-${{ github.run_id }}
|
||||||
|
path: test-cache
|
||||||
|
test-proxy-restore:
|
||||||
|
needs: test-proxy-save
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container:
|
||||||
|
image: ubuntu:latest
|
||||||
|
options: --dns 127.0.0.1
|
||||||
|
services:
|
||||||
|
squid-proxy:
|
||||||
|
image: ubuntu/squid:latest
|
||||||
|
ports:
|
||||||
|
- 3128:3128
|
||||||
|
env:
|
||||||
|
https_proxy: http://squid-proxy:3128
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- name: Restore cache
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
key: test-proxy-${{ github.run_id }}
|
||||||
|
path: test-cache
|
||||||
|
- name: Verify cache
|
||||||
|
run: __tests__/verify-cache-files.sh proxy test-cache
|
||||||
|
6
.gitignore
vendored
6
.gitignore
vendored
@ -1,8 +1,5 @@
|
|||||||
__tests__/runner/*
|
__tests__/runner/*
|
||||||
|
|
||||||
# comment out in distribution branches
|
|
||||||
dist/
|
|
||||||
|
|
||||||
node_modules/
|
node_modules/
|
||||||
lib/
|
lib/
|
||||||
|
|
||||||
@ -94,3 +91,6 @@ typings/
|
|||||||
|
|
||||||
# DynamoDB Local files
|
# DynamoDB Local files
|
||||||
.dynamodb/
|
.dynamodb/
|
||||||
|
|
||||||
|
# Text editor files
|
||||||
|
.vscode/
|
||||||
|
22
.licensed.yml
Normal file
22
.licensed.yml
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
sources:
|
||||||
|
npm: true
|
||||||
|
|
||||||
|
allowed:
|
||||||
|
- apache-2.0
|
||||||
|
- bsd-2-clause
|
||||||
|
- bsd-3-clause
|
||||||
|
- isc
|
||||||
|
- mit
|
||||||
|
- cc0-1.0
|
||||||
|
- unlicense
|
||||||
|
- 0bsd
|
||||||
|
|
||||||
|
reviewed:
|
||||||
|
npm:
|
||||||
|
- sax
|
||||||
|
- "@protobuf-ts/plugin-framework" # Apache-2.0
|
||||||
|
- "@protobuf-ts/runtime" # Apache-2.0
|
||||||
|
- fs.realpath # ISC
|
||||||
|
- glob # ISC
|
||||||
|
- prettier # MIT
|
||||||
|
- lodash # MIT
|
BIN
.licenses/NOTICE
generated
Normal file
BIN
.licenses/NOTICE
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/@actions/cache.dep.yml
generated
Normal file
BIN
.licenses/npm/@actions/cache.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/@actions/core.dep.yml
generated
Normal file
BIN
.licenses/npm/@actions/core.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/@actions/exec.dep.yml
generated
Normal file
BIN
.licenses/npm/@actions/exec.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/@actions/glob.dep.yml
generated
Normal file
BIN
.licenses/npm/@actions/glob.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/@actions/http-client.dep.yml
generated
Normal file
BIN
.licenses/npm/@actions/http-client.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/@actions/io.dep.yml
generated
Normal file
BIN
.licenses/npm/@actions/io.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/@azure/abort-controller.dep.yml
generated
Normal file
BIN
.licenses/npm/@azure/abort-controller.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/@azure/core-auth.dep.yml
generated
Normal file
BIN
.licenses/npm/@azure/core-auth.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/@azure/core-http.dep.yml
generated
Normal file
BIN
.licenses/npm/@azure/core-http.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/@azure/core-lro.dep.yml
generated
Normal file
BIN
.licenses/npm/@azure/core-lro.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/@azure/core-paging.dep.yml
generated
Normal file
BIN
.licenses/npm/@azure/core-paging.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/@azure/core-tracing.dep.yml
generated
Normal file
BIN
.licenses/npm/@azure/core-tracing.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/@azure/core-util.dep.yml
generated
Normal file
BIN
.licenses/npm/@azure/core-util.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/@azure/logger.dep.yml
generated
Normal file
BIN
.licenses/npm/@azure/logger.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/@azure/ms-rest-js.dep.yml
generated
Normal file
BIN
.licenses/npm/@azure/ms-rest-js.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/@azure/storage-blob.dep.yml
generated
Normal file
BIN
.licenses/npm/@azure/storage-blob.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/@opentelemetry/api.dep.yml
generated
Normal file
BIN
.licenses/npm/@opentelemetry/api.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/@protobuf-ts/plugin-framework.dep.yml
generated
Normal file
BIN
.licenses/npm/@protobuf-ts/plugin-framework.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/@protobuf-ts/plugin.dep.yml
generated
Normal file
BIN
.licenses/npm/@protobuf-ts/plugin.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/@protobuf-ts/protoc.dep.yml
generated
Normal file
BIN
.licenses/npm/@protobuf-ts/protoc.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/@protobuf-ts/runtime-rpc.dep.yml
generated
Normal file
BIN
.licenses/npm/@protobuf-ts/runtime-rpc.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/@protobuf-ts/runtime.dep.yml
generated
Normal file
BIN
.licenses/npm/@protobuf-ts/runtime.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/@types/node-fetch.dep.yml
generated
Normal file
BIN
.licenses/npm/@types/node-fetch.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/@types/node.dep.yml
generated
Normal file
BIN
.licenses/npm/@types/node.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/@types/tunnel.dep.yml
generated
Normal file
BIN
.licenses/npm/@types/tunnel.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/abort-controller.dep.yml
generated
Normal file
BIN
.licenses/npm/abort-controller.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/asynckit.dep.yml
generated
Normal file
BIN
.licenses/npm/asynckit.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/balanced-match.dep.yml
generated
Normal file
BIN
.licenses/npm/balanced-match.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/brace-expansion.dep.yml
generated
Normal file
BIN
.licenses/npm/brace-expansion.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/camel-case.dep.yml
generated
Normal file
BIN
.licenses/npm/camel-case.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/combined-stream.dep.yml
generated
Normal file
BIN
.licenses/npm/combined-stream.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/commander.dep.yml
generated
Normal file
BIN
.licenses/npm/commander.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/concat-map.dep.yml
generated
Normal file
BIN
.licenses/npm/concat-map.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/delayed-stream.dep.yml
generated
Normal file
BIN
.licenses/npm/delayed-stream.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/dot-object.dep.yml
generated
Normal file
BIN
.licenses/npm/dot-object.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/event-target-shim.dep.yml
generated
Normal file
BIN
.licenses/npm/event-target-shim.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/events.dep.yml
generated
Normal file
BIN
.licenses/npm/events.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/form-data-2.5.1.dep.yml
generated
Normal file
BIN
.licenses/npm/form-data-2.5.1.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/form-data-3.0.1.dep.yml
generated
Normal file
BIN
.licenses/npm/form-data-3.0.1.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/form-data-4.0.0.dep.yml
generated
Normal file
BIN
.licenses/npm/form-data-4.0.0.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/fs.realpath.dep.yml
generated
Normal file
BIN
.licenses/npm/fs.realpath.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/glob.dep.yml
generated
Normal file
BIN
.licenses/npm/glob.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/inflight.dep.yml
generated
Normal file
BIN
.licenses/npm/inflight.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/inherits.dep.yml
generated
Normal file
BIN
.licenses/npm/inherits.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/lodash.dep.yml
generated
Normal file
BIN
.licenses/npm/lodash.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/lower-case.dep.yml
generated
Normal file
BIN
.licenses/npm/lower-case.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/mime-db.dep.yml
generated
Normal file
BIN
.licenses/npm/mime-db.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/mime-types.dep.yml
generated
Normal file
BIN
.licenses/npm/mime-types.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/minimatch.dep.yml
generated
Normal file
BIN
.licenses/npm/minimatch.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/no-case.dep.yml
generated
Normal file
BIN
.licenses/npm/no-case.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/node-fetch.dep.yml
generated
Normal file
BIN
.licenses/npm/node-fetch.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/once.dep.yml
generated
Normal file
BIN
.licenses/npm/once.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/pascal-case.dep.yml
generated
Normal file
BIN
.licenses/npm/pascal-case.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/path-is-absolute.dep.yml
generated
Normal file
BIN
.licenses/npm/path-is-absolute.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/path-to-regexp.dep.yml
generated
Normal file
BIN
.licenses/npm/path-to-regexp.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/prettier.dep.yml
generated
Normal file
BIN
.licenses/npm/prettier.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/process.dep.yml
generated
Normal file
BIN
.licenses/npm/process.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/sax.dep.yml
generated
Normal file
BIN
.licenses/npm/sax.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/semver.dep.yml
generated
Normal file
BIN
.licenses/npm/semver.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/tr46.dep.yml
generated
Normal file
BIN
.licenses/npm/tr46.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/ts-poet.dep.yml
generated
Normal file
BIN
.licenses/npm/ts-poet.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/tslib-1.14.1.dep.yml
generated
Normal file
BIN
.licenses/npm/tslib-1.14.1.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/tslib-2.3.1.dep.yml
generated
Normal file
BIN
.licenses/npm/tslib-2.3.1.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/tslib-2.5.0.dep.yml
generated
Normal file
BIN
.licenses/npm/tslib-2.5.0.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/tslib-2.8.1.dep.yml
generated
Normal file
BIN
.licenses/npm/tslib-2.8.1.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/tunnel.dep.yml
generated
Normal file
BIN
.licenses/npm/tunnel.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/twirp-ts.dep.yml
generated
Normal file
BIN
.licenses/npm/twirp-ts.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/typescript.dep.yml
generated
Normal file
BIN
.licenses/npm/typescript.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/uuid.dep.yml
generated
Normal file
BIN
.licenses/npm/uuid.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/webidl-conversions.dep.yml
generated
Normal file
BIN
.licenses/npm/webidl-conversions.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/whatwg-url.dep.yml
generated
Normal file
BIN
.licenses/npm/whatwg-url.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/wrappy.dep.yml
generated
Normal file
BIN
.licenses/npm/wrappy.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/xml2js.dep.yml
generated
Normal file
BIN
.licenses/npm/xml2js.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/xmlbuilder.dep.yml
generated
Normal file
BIN
.licenses/npm/xmlbuilder.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/yaml.dep.yml
generated
Normal file
BIN
.licenses/npm/yaml.dep.yml
generated
Normal file
Binary file not shown.
@ -27,6 +27,10 @@ Here are a few things you can do that will increase the likelihood of your pull
|
|||||||
- Keep your change as focused as possible. If there are multiple changes you would like to make that are not dependent upon each other, consider submitting them as separate pull requests.
|
- Keep your change as focused as possible. If there are multiple changes you would like to make that are not dependent upon each other, consider submitting them as separate pull requests.
|
||||||
- Write a [good commit message](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html).
|
- Write a [good commit message](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html).
|
||||||
|
|
||||||
|
## Licensed
|
||||||
|
|
||||||
|
This repository uses a tool called [Licensed](https://github.com/github/licensed) to verify third party dependencies. You may need to locally install licensed and run `licensed cache` to update the dependency cache if you install or update a production dependency. If licensed cache is unable to determine the dependency, you may need to modify the cache file yourself to put the correct license. You should still verify the dependency, licensed is a tool to help, but is not a substitute for human review of dependencies.
|
||||||
|
|
||||||
## Resources
|
## Resources
|
||||||
|
|
||||||
- [How to Contribute to Open Source](https://opensource.guide/how-to-contribute/)
|
- [How to Contribute to Open Source](https://opensource.guide/how-to-contribute/)
|
||||||
|
320
README.md
320
README.md
@ -1,30 +1,106 @@
|
|||||||
# cache
|
# Cache action
|
||||||
|
|
||||||
This GitHub Action allows caching dependencies and build outputs to improve workflow execution time.
|
This action allows caching dependencies and build outputs to improve workflow execution time.
|
||||||
|
|
||||||
<a href="https://github.com/actions/cache"><img alt="GitHub Actions status" src="https://github.com/actions/cache/workflows/Tests/badge.svg"></a>
|
>Two other actions are available in addition to the primary `cache` action:
|
||||||
|
>
|
||||||
|
>* [Restore action](./restore/README.md)
|
||||||
|
>* [Save action](./save/README.md)
|
||||||
|
|
||||||
|
[](https://github.com/actions/cache/actions/workflows/workflow.yml)
|
||||||
|
|
||||||
|
## Documentation
|
||||||
|
|
||||||
|
See ["Caching dependencies to speed up workflows"](https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows).
|
||||||
|
|
||||||
|
## What's New
|
||||||
|
|
||||||
|
### ⚠️ Important changes
|
||||||
|
|
||||||
|
The cache backend service has been rewritten from the ground up for improved performance and reliability. [actions/cache](https://github.com/actions/cache) now integrates with the new cache service (v2) APIs.
|
||||||
|
|
||||||
|
The new service will gradually roll out as of **February 1st, 2025**. The legacy service will also be sunset on the same date. Changes in these release are **fully backward compatible**.
|
||||||
|
|
||||||
|
**We are deprecating some versions of this action**. We recommend upgrading to version `v4` or `v3` as soon as possible before **February 1st, 2025.** (Upgrade instructions below).
|
||||||
|
|
||||||
|
If you are using pinned SHAs, please use the SHAs of versions `v4.2.0` or `v3.4.0`
|
||||||
|
|
||||||
|
If you do not upgrade, all workflow runs using any of the deprecated [actions/cache](https://github.com/actions/cache) will fail.
|
||||||
|
|
||||||
|
Upgrading to the recommended versions will not break your workflows.
|
||||||
|
|
||||||
|
Read more about the change & access the migration guide: [reference to the announcement](https://github.com/actions/cache/discussions/1510).
|
||||||
|
|
||||||
|
### v4
|
||||||
|
|
||||||
|
* Integrated with the new cache service (v2) APIs.
|
||||||
|
* Updated to node 20
|
||||||
|
|
||||||
|
### v3
|
||||||
|
|
||||||
|
* Integrated with the new cache service (v2) APIs.
|
||||||
|
* Added support for caching in GHES 3.5+.
|
||||||
|
* Fixed download issue for files > 2GB during restore.
|
||||||
|
* Updated the minimum runner version support from node 12 -> node 16.
|
||||||
|
* Fixed avoiding empty cache save when no files are available for caching.
|
||||||
|
* Fixed tar creation error while trying to create tar with path as `~/` home folder on `ubuntu-latest`.
|
||||||
|
* Fixed zstd failing on amazon linux 2.0 runners.
|
||||||
|
* Fixed cache not working with github workspace directory or current directory.
|
||||||
|
* Fixed the download stuck problem by introducing a timeout of 1 hour for cache downloads.
|
||||||
|
* Fix zstd not working for windows on gnu tar in issues.
|
||||||
|
* Allowing users to provide a custom timeout as input for aborting download of a cache segment using an environment variable `SEGMENT_DOWNLOAD_TIMEOUT_MINS`. Default is 10 minutes.
|
||||||
|
* New actions are available for granular control over caches - [restore](restore/action.yml) and [save](save/action.yml).
|
||||||
|
* Support cross-os caching as an opt-in feature. See [Cross OS caching](./tips-and-workarounds.md#cross-os-cache) for more info.
|
||||||
|
* Added option to fail job on cache miss. See [Exit workflow on cache miss](./restore/README.md#exit-workflow-on-cache-miss) for more info.
|
||||||
|
* Fix zstd not being used after zstd version upgrade to 1.5.4 on hosted runners
|
||||||
|
* Added option to lookup cache without downloading it.
|
||||||
|
* Reduced segment size to 128MB and segment timeout to 10 minutes to fail fast in case the cache download is stuck.
|
||||||
|
|
||||||
|
See the [v2 README.md](https://github.com/actions/cache/blob/v2/README.md) for older updates.
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
### Pre-requisites
|
### Pre-requisites
|
||||||
Create a workflow `.yml` file in your repositories `.github/workflows` directory. An [example workflow](#example-workflow) is available below. For more information, reference the GitHub Help Documentation for [Creating a workflow file](https://help.github.com/en/articles/configuring-a-workflow#creating-a-workflow-file).
|
|
||||||
|
Create a workflow `.yml` file in your repository's `.github/workflows` directory. An [example workflow](#example-cache-workflow) is available below. For more information, see the GitHub Help Documentation for [Creating a workflow file](https://help.github.com/en/articles/configuring-a-workflow#creating-a-workflow-file).
|
||||||
|
|
||||||
|
If you are using this inside a container, a POSIX-compliant `tar` needs to be included and accessible from the execution path.
|
||||||
|
|
||||||
|
If you are using a `self-hosted` Windows runner, `GNU tar` and `zstd` are required for [Cross-OS caching](https://github.com/actions/cache/blob/main/tips-and-workarounds.md#cross-os-cache) to work. They are also recommended to be installed in general so the performance is on par with `hosted` Windows runners.
|
||||||
|
|
||||||
### Inputs
|
### Inputs
|
||||||
|
|
||||||
* `path` - A directory to store and save the cache
|
* `key` - An explicit key for a cache entry. See [creating a cache key](#creating-a-cache-key).
|
||||||
* `key` - An explicit key for restoring and saving the cache
|
* `path` - A list of files, directories, and wildcard patterns to cache and restore. See [`@actions/glob`](https://github.com/actions/toolkit/tree/main/packages/glob) for supported patterns.
|
||||||
* `restore-keys` - An ordered list of keys to use for restoring the cache if no cache hit occurred for key
|
* `restore-keys` - An ordered multiline string listing the prefix-matched keys, that are used for restoring stale cache if no cache hit occurred for key.
|
||||||
|
* `enableCrossOsArchive` - An optional boolean when enabled, allows Windows runners to save or restore caches that can be restored or saved respectively on other platforms. Default: `false`
|
||||||
|
* `fail-on-cache-miss` - Fail the workflow if cache entry is not found. Default: `false`
|
||||||
|
* `lookup-only` - If true, only checks if cache entry exists and skips download. Does not change save cache behavior. Default: `false`
|
||||||
|
|
||||||
|
#### Environment Variables
|
||||||
|
|
||||||
|
* `SEGMENT_DOWNLOAD_TIMEOUT_MINS` - Segment download timeout (in minutes, default `10`) to abort download of the segment if not completed in the defined number of minutes. [Read more](https://github.com/actions/cache/blob/main/tips-and-workarounds.md#cache-segment-restore-timeout)
|
||||||
|
|
||||||
### Outputs
|
### Outputs
|
||||||
|
|
||||||
* `cache-hit` - A boolean value to indicate an exact match was found for the key
|
* `cache-hit` - A string value to indicate an exact match was found for the key.
|
||||||
|
* If there's a cache hit, this will be 'true' or 'false' to indicate if there's an exact match for `key`.
|
||||||
|
* If there's a cache miss, this will be an empty string.
|
||||||
|
|
||||||
> See [Skipping steps based on cache-hit](#Skipping-steps-based-on-cache-hit) for info on using this output
|
See [Skipping steps based on cache-hit](#skipping-steps-based-on-cache-hit) for info on using this output
|
||||||
|
|
||||||
### Example workflow
|
### Cache scopes
|
||||||
|
|
||||||
|
The cache is scoped to the key, [version](#cache-version), and branch. The default branch cache is available to other branches.
|
||||||
|
|
||||||
|
See [Matching a cache key](https://help.github.com/en/actions/configuring-and-managing-workflows/caching-dependencies-to-speed-up-workflows#matching-a-cache-key) for more info.
|
||||||
|
|
||||||
|
### Example cache workflow
|
||||||
|
|
||||||
|
#### Restoring and saving cache using a single action
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
name: Example Caching with npm
|
name: Caching Primes
|
||||||
|
|
||||||
on: push
|
on: push
|
||||||
|
|
||||||
@ -33,44 +109,148 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Cache node modules
|
- name: Cache Primes
|
||||||
uses: actions/cache@preview
|
id: cache-primes
|
||||||
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: node_modules
|
path: prime-numbers
|
||||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
key: ${{ runner.os }}-primes
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-node-
|
|
||||||
|
|
||||||
- name: Install Dependencies
|
- name: Generate Prime Numbers
|
||||||
run: npm install
|
if: steps.cache-primes.outputs.cache-hit != 'true'
|
||||||
|
run: /generate-primes.sh -d prime-numbers
|
||||||
|
|
||||||
- name: Build
|
- name: Use Prime Numbers
|
||||||
run: npm run build
|
run: /primes.sh -d prime-numbers
|
||||||
|
|
||||||
- name: Test
|
|
||||||
run: npm run test
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Ecosystem Examples
|
The `cache` action provides a `cache-hit` output which is set to `true` when the cache is restored using the primary `key` and `false` when the cache is restored using `restore-keys` or no cache is restored.
|
||||||
|
|
||||||
See [Examples](examples.md)
|
#### Using a combination of restore and save actions
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
name: Caching Primes
|
||||||
|
|
||||||
|
on: push
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Restore cached Primes
|
||||||
|
id: cache-primes-restore
|
||||||
|
uses: actions/cache/restore@v4
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
path/to/dependencies
|
||||||
|
some/other/dependencies
|
||||||
|
key: ${{ runner.os }}-primes
|
||||||
|
.
|
||||||
|
. //intermediate workflow steps
|
||||||
|
.
|
||||||
|
- name: Save Primes
|
||||||
|
id: cache-primes-save
|
||||||
|
uses: actions/cache/save@v4
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
path/to/dependencies
|
||||||
|
some/other/dependencies
|
||||||
|
key: ${{ steps.cache-primes-restore.outputs.cache-primary-key }}
|
||||||
|
```
|
||||||
|
|
||||||
|
> **Note**
|
||||||
|
> You must use the `cache` or `restore` action in your workflow before you need to use the files that might be restored from the cache. If the provided `key` matches an existing cache, a new cache is not created and if the provided `key` doesn't match an existing cache, a new cache is automatically created provided the job completes successfully.
|
||||||
|
|
||||||
|
## Caching Strategies
|
||||||
|
|
||||||
|
With the introduction of the `restore` and `save` actions, a lot of caching use cases can now be achieved. Please see the [caching strategies](./caching-strategies.md) document for understanding how you can use the actions strategically to achieve the desired goal.
|
||||||
|
|
||||||
|
## Implementation Examples
|
||||||
|
|
||||||
|
Every programming language and framework has its own way of caching.
|
||||||
|
|
||||||
|
See [Examples](examples.md) for a list of `actions/cache` implementations for use with:
|
||||||
|
|
||||||
|
* [Bun](./examples.md#bun)
|
||||||
|
* [C# - NuGet](./examples.md#c---nuget)
|
||||||
|
* [Clojure - Lein Deps](./examples.md#clojure---lein-deps)
|
||||||
|
* [D - DUB](./examples.md#d---dub)
|
||||||
|
* [Deno](./examples.md#deno)
|
||||||
|
* [Elixir - Mix](./examples.md#elixir---mix)
|
||||||
|
* [Go - Modules](./examples.md#go---modules)
|
||||||
|
* [Haskell - Cabal](./examples.md#haskell---cabal)
|
||||||
|
* [Haskell - Stack](./examples.md#haskell---stack)
|
||||||
|
* [Java - Gradle](./examples.md#java---gradle)
|
||||||
|
* [Java - Maven](./examples.md#java---maven)
|
||||||
|
* [Node - npm](./examples.md#node---npm)
|
||||||
|
* [Node - Lerna](./examples.md#node---lerna)
|
||||||
|
* [Node - Yarn](./examples.md#node---yarn)
|
||||||
|
* [OCaml/Reason - esy](./examples.md#ocamlreason---esy)
|
||||||
|
* [PHP - Composer](./examples.md#php---composer)
|
||||||
|
* [Python - pip](./examples.md#python---pip)
|
||||||
|
* [Python - pipenv](./examples.md#python---pipenv)
|
||||||
|
* [R - renv](./examples.md#r---renv)
|
||||||
|
* [Ruby - Bundler](./examples.md#ruby---bundler)
|
||||||
|
* [Rust - Cargo](./examples.md#rust---cargo)
|
||||||
|
* [Scala - SBT](./examples.md#scala---sbt)
|
||||||
|
* [Swift, Objective-C - Carthage](./examples.md#swift-objective-c---carthage)
|
||||||
|
* [Swift, Objective-C - CocoaPods](./examples.md#swift-objective-c---cocoapods)
|
||||||
|
* [Swift - Swift Package Manager](./examples.md#swift---swift-package-manager)
|
||||||
|
* [Swift - Mint](./examples.md#swift---mint)
|
||||||
|
|
||||||
|
## Creating a cache key
|
||||||
|
|
||||||
|
A cache key can include any of the contexts, functions, literals, and operators supported by GitHub Actions.
|
||||||
|
|
||||||
|
For example, using the [`hashFiles`](https://docs.github.com/en/actions/learn-github-actions/expressions#hashfiles) function allows you to create a new cache when dependencies change.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
- uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
path/to/dependencies
|
||||||
|
some/other/dependencies
|
||||||
|
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
|
||||||
|
```
|
||||||
|
|
||||||
|
Additionally, you can use arbitrary command output in a cache key, such as a date or software version:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
# http://man7.org/linux/man-pages/man1/date.1.html
|
||||||
|
- name: Get Date
|
||||||
|
id: get-date
|
||||||
|
run: |
|
||||||
|
echo "date=$(/bin/date -u "+%Y%m%d")" >> $GITHUB_OUTPUT
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
- uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: path/to/dependencies
|
||||||
|
key: ${{ runner.os }}-${{ steps.get-date.outputs.date }}-${{ hashFiles('**/lockfiles') }}
|
||||||
|
```
|
||||||
|
|
||||||
|
See [Using contexts to create cache keys](https://help.github.com/en/actions/configuring-and-managing-workflows/caching-dependencies-to-speed-up-workflows#using-contexts-to-create-cache-keys)
|
||||||
|
|
||||||
## Cache Limits
|
## Cache Limits
|
||||||
|
|
||||||
Individual caches are limited to 200MB and a repository can have up to 2GB of caches. Once the 2GB limit is reached, older caches will be evicted based on when the cache was last accessed. Caches that are not accessed within the last week will also be evicted.
|
A repository can have up to 10GB of caches. Once the 10GB limit is reached, older caches will be evicted based on when the cache was last accessed. Caches that are not accessed within the last week will also be evicted.
|
||||||
|
|
||||||
## Skipping steps based on cache-hit
|
## Skipping steps based on cache-hit
|
||||||
|
|
||||||
Using the `cache-hit` output, subsequent steps (such as install or build) can be skipped when a cache hit occurs on the key.
|
Using the `cache-hit` output, subsequent steps (such as install or build) can be skipped when a cache hit occurs on the key. It is recommended to install missing/updated dependencies in case of a partial key match when the key is dependent on the `hash` of the package file.
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- uses: actions/cache@preview
|
- uses: actions/cache@v4
|
||||||
id: cache
|
id: cache
|
||||||
with:
|
with:
|
||||||
path: path/to/dependencies
|
path: path/to/dependencies
|
||||||
@ -81,10 +261,84 @@ steps:
|
|||||||
run: /install.sh
|
run: /install.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
> Note: The `id` defined in `actions/cache` must match the `id` in the `if` statement (i.e. `steps.[ID].outputs.cache-hit`)
|
> **Note** The `id` defined in `actions/cache` must match the `id` in the `if` statement (i.e. `steps.[ID].outputs.cache-hit`)
|
||||||
|
|
||||||
|
## Cache Version
|
||||||
|
|
||||||
|
Cache version is a hash [generated](https://github.com/actions/toolkit/blob/500d0b42fee2552ae9eeb5933091fe2fbf14e72d/packages/cache/src/internal/cacheHttpClient.ts#L73-L90) for a combination of compression tool used (Gzip, Zstd, etc. based on the runner OS) and the `path` of directories being cached. If two caches have different versions, they are identified as unique caches while matching. This, for example, means that a cache created on a `windows-latest` runner can't be restored on `ubuntu-latest` as cache `Version`s are different.
|
||||||
|
|
||||||
|
> Pro tip: The [list caches](https://docs.github.com/en/rest/actions/cache#list-github-actions-caches-for-a-repository) API can be used to get the version of a cache. This can be helpful to troubleshoot cache miss due to version.
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Example</summary>
|
||||||
|
The workflow will create 3 unique caches with same keys. Ubuntu and windows runners will use different compression technique and hence create two different caches. And `build-linux` will create two different caches as the `paths` are different.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
jobs:
|
||||||
|
build-linux:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Cache Primes
|
||||||
|
id: cache-primes
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: prime-numbers
|
||||||
|
key: primes
|
||||||
|
|
||||||
|
- name: Generate Prime Numbers
|
||||||
|
if: steps.cache-primes.outputs.cache-hit != 'true'
|
||||||
|
run: ./generate-primes.sh -d prime-numbers
|
||||||
|
|
||||||
|
- name: Cache Numbers
|
||||||
|
id: cache-numbers
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: numbers
|
||||||
|
key: primes
|
||||||
|
|
||||||
|
- name: Generate Numbers
|
||||||
|
if: steps.cache-numbers.outputs.cache-hit != 'true'
|
||||||
|
run: ./generate-primes.sh -d numbers
|
||||||
|
|
||||||
|
build-windows:
|
||||||
|
runs-on: windows-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Cache Primes
|
||||||
|
id: cache-primes
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: prime-numbers
|
||||||
|
key: primes
|
||||||
|
|
||||||
|
- name: Generate Prime Numbers
|
||||||
|
if: steps.cache-primes.outputs.cache-hit != 'true'
|
||||||
|
run: ./generate-primes -d prime-numbers
|
||||||
|
```
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
|
## Known practices and workarounds
|
||||||
|
|
||||||
|
There are a number of community practices/workarounds to fulfill specific requirements. You may choose to use them if they suit your use case. Note these are not necessarily the only solution or even a recommended solution.
|
||||||
|
|
||||||
|
* [Cache segment restore timeout](./tips-and-workarounds.md#cache-segment-restore-timeout)
|
||||||
|
* [Update a cache](./tips-and-workarounds.md#update-a-cache)
|
||||||
|
* [Use cache across feature branches](./tips-and-workarounds.md#use-cache-across-feature-branches)
|
||||||
|
* [Cross OS cache](./tips-and-workarounds.md#cross-os-cache)
|
||||||
|
* [Force deletion of caches overriding default cache eviction policy](./tips-and-workarounds.md#force-deletion-of-caches-overriding-default-cache-eviction-policy)
|
||||||
|
|
||||||
|
### Windows environment variables
|
||||||
|
|
||||||
|
Please note that Windows environment variables (like `%LocalAppData%`) will NOT be expanded by this action. Instead, prefer using `~` in your paths which will expand to the HOME directory. For example, instead of `%LocalAppData%`, use `~\AppData\Local`. For a list of supported default environment variables, see the [Learn GitHub Actions: Variables](https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables) page.
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
We would love for you to contribute to `@actions/cache`, pull requests are welcome! Please see the [CONTRIBUTING.md](CONTRIBUTING.md) for more information.
|
|
||||||
|
We would love for you to contribute to `actions/cache`. Pull requests are welcome! Please see the [CONTRIBUTING.md](CONTRIBUTING.md) for more information.
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
The scripts and documentation in this project are released under the [MIT License](LICENSE)
|
The scripts and documentation in this project are released under the [MIT License](LICENSE)
|
||||||
|
174
RELEASES.md
Normal file
174
RELEASES.md
Normal file
@ -0,0 +1,174 @@
|
|||||||
|
# Releases
|
||||||
|
|
||||||
|
### 4.2.3
|
||||||
|
|
||||||
|
- Bump `@actions/cache` to v4.0.3 (obfuscates SAS token in debug logs for cache entries)
|
||||||
|
|
||||||
|
### 4.2.2
|
||||||
|
|
||||||
|
- Bump `@actions/cache` to v4.0.2
|
||||||
|
|
||||||
|
### 4.2.1
|
||||||
|
|
||||||
|
- Bump `@actions/cache` to v4.0.1
|
||||||
|
|
||||||
|
### 4.2.0
|
||||||
|
|
||||||
|
TLDR; The cache backend service has been rewritten from the ground up for improved performance and reliability. [actions/cache](https://github.com/actions/cache) now integrates with the new cache service (v2) APIs.
|
||||||
|
|
||||||
|
The new service will gradually roll out as of **February 1st, 2025**. The legacy service will also be sunset on the same date. Changes in these release are **fully backward compatible**.
|
||||||
|
|
||||||
|
**We are deprecating some versions of this action**. We recommend upgrading to version `v4` or `v3` as soon as possible before **February 1st, 2025.** (Upgrade instructions below).
|
||||||
|
|
||||||
|
If you are using pinned SHAs, please use the SHAs of versions `v4.2.0` or `v3.4.0`
|
||||||
|
|
||||||
|
If you do not upgrade, all workflow runs using any of the deprecated [actions/cache](https://github.com/actions/cache) will fail.
|
||||||
|
|
||||||
|
Upgrading to the recommended versions will not break your workflows.
|
||||||
|
|
||||||
|
### 4.1.2
|
||||||
|
|
||||||
|
- Add GitHub Enterprise Cloud instances hostname filters to inform API endpoint choices - [#1474](https://github.com/actions/cache/pull/1474)
|
||||||
|
- Security fix: Bump braces from 3.0.2 to 3.0.3 - [#1475](https://github.com/actions/cache/pull/1475)
|
||||||
|
|
||||||
|
### 4.1.1
|
||||||
|
|
||||||
|
- Restore original behavior of `cache-hit` output - [#1467](https://github.com/actions/cache/pull/1467)
|
||||||
|
|
||||||
|
### 4.1.0
|
||||||
|
|
||||||
|
- Ensure `cache-hit` output is set when a cache is missed - [#1404](https://github.com/actions/cache/pull/1404)
|
||||||
|
- Deprecate `save-always` input - [#1452](https://github.com/actions/cache/pull/1452)
|
||||||
|
|
||||||
|
### 4.0.2
|
||||||
|
|
||||||
|
- Fixed restore `fail-on-cache-miss` not working.
|
||||||
|
|
||||||
|
### 4.0.1
|
||||||
|
|
||||||
|
- Updated `isGhes` check
|
||||||
|
|
||||||
|
### 4.0.0
|
||||||
|
|
||||||
|
- Updated minimum runner version support from node 12 -> node 20
|
||||||
|
|
||||||
|
### 3.4.0
|
||||||
|
|
||||||
|
- Integrated with the new cache service (v2) APIs
|
||||||
|
|
||||||
|
### 3.3.3
|
||||||
|
|
||||||
|
- Updates @actions/cache to v3.2.3 to fix accidental mutated path arguments to `getCacheVersion` [actions/toolkit#1378](https://github.com/actions/toolkit/pull/1378)
|
||||||
|
- Additional audit fixes of npm package(s)
|
||||||
|
|
||||||
|
### 3.3.2
|
||||||
|
|
||||||
|
- Fixes bug with Azure SDK causing blob downloads to get stuck.
|
||||||
|
|
||||||
|
### 3.3.1
|
||||||
|
|
||||||
|
- Reduced segment size to 128MB and segment timeout to 10 minutes to fail fast in case the cache download is stuck.
|
||||||
|
|
||||||
|
### 3.3.0
|
||||||
|
|
||||||
|
- Added option to lookup cache without downloading it.
|
||||||
|
|
||||||
|
### 3.2.6
|
||||||
|
|
||||||
|
- Fix zstd not being used after zstd version upgrade to 1.5.4 on hosted runners.
|
||||||
|
|
||||||
|
### 3.2.5
|
||||||
|
|
||||||
|
- Added fix to prevent from setting MYSYS environment variable globally.
|
||||||
|
|
||||||
|
### 3.2.4
|
||||||
|
|
||||||
|
- Added option to fail job on cache miss.
|
||||||
|
|
||||||
|
### 3.2.3
|
||||||
|
|
||||||
|
- Support cross os caching on Windows as an opt-in feature.
|
||||||
|
- Fix issue with symlink restoration on Windows for cross-os caches.
|
||||||
|
|
||||||
|
### 3.2.2
|
||||||
|
|
||||||
|
- Reverted the changes made in 3.2.1 to use gnu tar and zstd by default on windows.
|
||||||
|
|
||||||
|
### 3.2.1
|
||||||
|
|
||||||
|
- Update `@actions/cache` on windows to use gnu tar and zstd by default and fallback to bsdtar and zstd if gnu tar is not available. ([issue](https://github.com/actions/cache/issues/984))
|
||||||
|
- Added support for fallback to gzip to restore old caches on windows.
|
||||||
|
- Added logs for cache version in case of a cache miss.
|
||||||
|
|
||||||
|
### 3.2.0
|
||||||
|
|
||||||
|
- Released the two new actions - [restore](restore/action.yml) and [save](save/action.yml) for granular control on cache
|
||||||
|
|
||||||
|
### 3.2.0-beta.1
|
||||||
|
|
||||||
|
- Added two new actions - [restore](restore/action.yml) and [save](save/action.yml) for granular control on cache.
|
||||||
|
|
||||||
|
### 3.1.0-beta.3
|
||||||
|
|
||||||
|
- Bug fixes for bsdtar fallback if gnutar not available and gzip fallback if cache saved using old cache action on windows.
|
||||||
|
|
||||||
|
### 3.1.0-beta.2
|
||||||
|
|
||||||
|
- Added support for fallback to gzip to restore old caches on windows.
|
||||||
|
|
||||||
|
### 3.1.0-beta.1
|
||||||
|
|
||||||
|
- Update `@actions/cache` on windows to use gnu tar and zstd by default and fallback to bsdtar and zstd if gnu tar is not available. ([issue](https://github.com/actions/cache/issues/984))
|
||||||
|
|
||||||
|
### 3.0.11
|
||||||
|
|
||||||
|
- Update toolkit version to 3.0.5 to include `@actions/core@^1.10.0`
|
||||||
|
- Update `@actions/cache` to use updated `saveState` and `setOutput` functions from `@actions/core@^1.10.0`
|
||||||
|
|
||||||
|
### 3.0.10
|
||||||
|
|
||||||
|
- Fix a bug with sorting inputs.
|
||||||
|
- Update definition for restore-keys in README.md
|
||||||
|
|
||||||
|
### 3.0.9
|
||||||
|
|
||||||
|
- Enhanced the warning message for cache unavailablity in case of GHES.
|
||||||
|
|
||||||
|
### 3.0.8
|
||||||
|
|
||||||
|
- Fix zstd not working for windows on gnu tar in issues [#888](https://github.com/actions/cache/issues/888) and [#891](https://github.com/actions/cache/issues/891).
|
||||||
|
- Allowing users to provide a custom timeout as input for aborting download of a cache segment using an environment variable `SEGMENT_DOWNLOAD_TIMEOUT_MINS`. Default is 60 minutes.
|
||||||
|
|
||||||
|
### 3.0.7
|
||||||
|
|
||||||
|
- Fixed [#810](https://github.com/actions/cache/issues/810) - download stuck issue. A new timeout is introduced in the download process to abort the download if it gets stuck and doesn't finish within an hour.
|
||||||
|
|
||||||
|
### 3.0.6
|
||||||
|
|
||||||
|
- Fixed [#809](https://github.com/actions/cache/issues/809) - zstd -d: no such file or directory error
|
||||||
|
- Fixed [#833](https://github.com/actions/cache/issues/833) - cache doesn't work with github workspace directory
|
||||||
|
|
||||||
|
### 3.0.5
|
||||||
|
|
||||||
|
- Removed error handling by consuming actions/cache 3.0 toolkit, Now cache server error handling will be done by toolkit. ([PR](https://github.com/actions/cache/pull/834))
|
||||||
|
|
||||||
|
### 3.0.4
|
||||||
|
|
||||||
|
- Fixed tar creation error while trying to create tar with path as `~/` home folder on `ubuntu-latest`. ([issue](https://github.com/actions/cache/issues/689))
|
||||||
|
|
||||||
|
### 3.0.3
|
||||||
|
|
||||||
|
- Fixed avoiding empty cache save when no files are available for caching. ([issue](https://github.com/actions/cache/issues/624))
|
||||||
|
|
||||||
|
### 3.0.2
|
||||||
|
|
||||||
|
- Added support for dynamic cache size cap on GHES.
|
||||||
|
|
||||||
|
### 3.0.1
|
||||||
|
|
||||||
|
- Added support for caching from GHES 3.5.
|
||||||
|
- Fixed download issue for files > 2GB during restore.
|
||||||
|
|
||||||
|
### 3.0.0
|
||||||
|
|
||||||
|
- Updated minimum runner version support from node 12 -> node 16
|
1
__tests__/__fixtures__/helloWorld.txt
Normal file
1
__tests__/__fixtures__/helloWorld.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
hello world
|
267
__tests__/actionUtils.test.ts
Normal file
267
__tests__/actionUtils.test.ts
Normal file
@ -0,0 +1,267 @@
|
|||||||
|
import * as cache from "@actions/cache";
|
||||||
|
import * as core from "@actions/core";
|
||||||
|
|
||||||
|
import { Events, RefKey } from "../src/constants";
|
||||||
|
import * as actionUtils from "../src/utils/actionUtils";
|
||||||
|
import * as testUtils from "../src/utils/testUtils";
|
||||||
|
|
||||||
|
jest.mock("@actions/core");
|
||||||
|
jest.mock("@actions/cache");
|
||||||
|
|
||||||
|
let pristineEnv: NodeJS.ProcessEnv;
|
||||||
|
|
||||||
|
beforeAll(() => {
|
||||||
|
pristineEnv = process.env;
|
||||||
|
jest.spyOn(core, "getInput").mockImplementation((name, options) => {
|
||||||
|
return jest.requireActual("@actions/core").getInput(name, options);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
jest.resetModules();
|
||||||
|
process.env = pristineEnv;
|
||||||
|
delete process.env[Events.Key];
|
||||||
|
delete process.env[RefKey];
|
||||||
|
});
|
||||||
|
|
||||||
|
afterAll(() => {
|
||||||
|
process.env = pristineEnv;
|
||||||
|
});
|
||||||
|
|
||||||
|
test("isGhes returns true if server url is not github.com", () => {
|
||||||
|
try {
|
||||||
|
process.env["GITHUB_SERVER_URL"] = "http://example.com";
|
||||||
|
expect(actionUtils.isGhes()).toBe(true);
|
||||||
|
} finally {
|
||||||
|
process.env["GITHUB_SERVER_URL"] = undefined;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
test("isGhes returns false when server url is github.com", () => {
|
||||||
|
try {
|
||||||
|
process.env["GITHUB_SERVER_URL"] = "http://github.com";
|
||||||
|
expect(actionUtils.isGhes()).toBe(false);
|
||||||
|
} finally {
|
||||||
|
process.env["GITHUB_SERVER_URL"] = undefined;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
test("isExactKeyMatch with undefined cache key returns false", () => {
|
||||||
|
const key = "linux-rust";
|
||||||
|
const cacheKey = undefined;
|
||||||
|
|
||||||
|
expect(actionUtils.isExactKeyMatch(key, cacheKey)).toBe(false);
|
||||||
|
});
|
||||||
|
|
||||||
|
test("isExactKeyMatch with empty cache key returns false", () => {
|
||||||
|
const key = "linux-rust";
|
||||||
|
const cacheKey = "";
|
||||||
|
|
||||||
|
expect(actionUtils.isExactKeyMatch(key, cacheKey)).toBe(false);
|
||||||
|
});
|
||||||
|
|
||||||
|
test("isExactKeyMatch with different keys returns false", () => {
|
||||||
|
const key = "linux-rust";
|
||||||
|
const cacheKey = "linux-";
|
||||||
|
|
||||||
|
expect(actionUtils.isExactKeyMatch(key, cacheKey)).toBe(false);
|
||||||
|
});
|
||||||
|
|
||||||
|
test("isExactKeyMatch with different key accents returns false", () => {
|
||||||
|
const key = "linux-áccent";
|
||||||
|
const cacheKey = "linux-accent";
|
||||||
|
|
||||||
|
expect(actionUtils.isExactKeyMatch(key, cacheKey)).toBe(false);
|
||||||
|
});
|
||||||
|
|
||||||
|
test("isExactKeyMatch with same key returns true", () => {
|
||||||
|
const key = "linux-rust";
|
||||||
|
const cacheKey = "linux-rust";
|
||||||
|
|
||||||
|
expect(actionUtils.isExactKeyMatch(key, cacheKey)).toBe(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
test("isExactKeyMatch with same key and different casing returns true", () => {
|
||||||
|
const key = "linux-rust";
|
||||||
|
const cacheKey = "LINUX-RUST";
|
||||||
|
|
||||||
|
expect(actionUtils.isExactKeyMatch(key, cacheKey)).toBe(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
test("logWarning logs a message with a warning prefix", () => {
|
||||||
|
const message = "A warning occurred.";
|
||||||
|
|
||||||
|
const infoMock = jest.spyOn(core, "info");
|
||||||
|
|
||||||
|
actionUtils.logWarning(message);
|
||||||
|
|
||||||
|
expect(infoMock).toHaveBeenCalledWith(`[warning]${message}`);
|
||||||
|
});
|
||||||
|
|
||||||
|
test("isValidEvent returns false for event that does not have a branch or tag", () => {
|
||||||
|
const event = "foo";
|
||||||
|
process.env[Events.Key] = event;
|
||||||
|
|
||||||
|
const isValidEvent = actionUtils.isValidEvent();
|
||||||
|
|
||||||
|
expect(isValidEvent).toBe(false);
|
||||||
|
});
|
||||||
|
|
||||||
|
test("isValidEvent returns true for event that has a ref", () => {
|
||||||
|
const event = Events.Push;
|
||||||
|
process.env[Events.Key] = event;
|
||||||
|
process.env[RefKey] = "ref/heads/feature";
|
||||||
|
|
||||||
|
const isValidEvent = actionUtils.isValidEvent();
|
||||||
|
|
||||||
|
expect(isValidEvent).toBe(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
test("getInputAsArray returns empty array if not required and missing", () => {
|
||||||
|
expect(actionUtils.getInputAsArray("foo")).toEqual([]);
|
||||||
|
});
|
||||||
|
|
||||||
|
test("getInputAsArray throws error if required and missing", () => {
|
||||||
|
expect(() =>
|
||||||
|
actionUtils.getInputAsArray("foo", { required: true })
|
||||||
|
).toThrowError();
|
||||||
|
});
|
||||||
|
|
||||||
|
test("getInputAsArray handles single line correctly", () => {
|
||||||
|
testUtils.setInput("foo", "bar");
|
||||||
|
expect(actionUtils.getInputAsArray("foo")).toEqual(["bar"]);
|
||||||
|
});
|
||||||
|
|
||||||
|
test("getInputAsArray handles multiple lines correctly", () => {
|
||||||
|
testUtils.setInput("foo", "bar\nbaz");
|
||||||
|
expect(actionUtils.getInputAsArray("foo")).toEqual(["bar", "baz"]);
|
||||||
|
});
|
||||||
|
|
||||||
|
test("getInputAsArray handles different new lines correctly", () => {
|
||||||
|
testUtils.setInput("foo", "bar\r\nbaz");
|
||||||
|
expect(actionUtils.getInputAsArray("foo")).toEqual(["bar", "baz"]);
|
||||||
|
});
|
||||||
|
|
||||||
|
test("getInputAsArray handles empty lines correctly", () => {
|
||||||
|
testUtils.setInput("foo", "\n\nbar\n\nbaz\n\n");
|
||||||
|
expect(actionUtils.getInputAsArray("foo")).toEqual(["bar", "baz"]);
|
||||||
|
});
|
||||||
|
|
||||||
|
test("getInputAsArray removes spaces after ! at the beginning", () => {
|
||||||
|
testUtils.setInput(
|
||||||
|
"foo",
|
||||||
|
"! bar\n! baz\n! qux\n!quux\ncorge\ngrault! garply\n!\r\t waldo"
|
||||||
|
);
|
||||||
|
expect(actionUtils.getInputAsArray("foo")).toEqual([
|
||||||
|
"!bar",
|
||||||
|
"!baz",
|
||||||
|
"!qux",
|
||||||
|
"!quux",
|
||||||
|
"corge",
|
||||||
|
"grault! garply",
|
||||||
|
"!waldo"
|
||||||
|
]);
|
||||||
|
});
|
||||||
|
|
||||||
|
test("getInputAsInt returns undefined if input not set", () => {
|
||||||
|
expect(actionUtils.getInputAsInt("undefined")).toBeUndefined();
|
||||||
|
});
|
||||||
|
|
||||||
|
test("getInputAsInt returns value if input is valid", () => {
|
||||||
|
testUtils.setInput("foo", "8");
|
||||||
|
expect(actionUtils.getInputAsInt("foo")).toBe(8);
|
||||||
|
});
|
||||||
|
|
||||||
|
test("getInputAsInt returns undefined if input is invalid or NaN", () => {
|
||||||
|
testUtils.setInput("foo", "bar");
|
||||||
|
expect(actionUtils.getInputAsInt("foo")).toBeUndefined();
|
||||||
|
});
|
||||||
|
|
||||||
|
test("getInputAsInt throws if required and value missing", () => {
|
||||||
|
expect(() =>
|
||||||
|
actionUtils.getInputAsInt("undefined", { required: true })
|
||||||
|
).toThrowError();
|
||||||
|
});
|
||||||
|
|
||||||
|
test("getInputAsBool returns false if input not set", () => {
|
||||||
|
expect(actionUtils.getInputAsBool("undefined")).toBe(false);
|
||||||
|
});
|
||||||
|
|
||||||
|
test("getInputAsBool returns value if input is valid", () => {
|
||||||
|
testUtils.setInput("foo", "true");
|
||||||
|
expect(actionUtils.getInputAsBool("foo")).toBe(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
test("getInputAsBool returns false if input is invalid or NaN", () => {
|
||||||
|
testUtils.setInput("foo", "bar");
|
||||||
|
expect(actionUtils.getInputAsBool("foo")).toBe(false);
|
||||||
|
});
|
||||||
|
|
||||||
|
test("getInputAsBool throws if required and value missing", () => {
|
||||||
|
expect(() =>
|
||||||
|
actionUtils.getInputAsBool("undefined2", { required: true })
|
||||||
|
).toThrowError();
|
||||||
|
});
|
||||||
|
|
||||||
|
test("isCacheFeatureAvailable for ac enabled", () => {
|
||||||
|
jest.spyOn(cache, "isFeatureAvailable").mockImplementation(() => true);
|
||||||
|
|
||||||
|
expect(actionUtils.isCacheFeatureAvailable()).toBe(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
test("isCacheFeatureAvailable for ac disabled on GHES", () => {
|
||||||
|
jest.spyOn(cache, "isFeatureAvailable").mockImplementation(() => false);
|
||||||
|
|
||||||
|
const message = `Cache action is only supported on GHES version >= 3.5. If you are on version >=3.5 Please check with GHES admin if Actions cache service is enabled or not.
|
||||||
|
Otherwise please upgrade to GHES version >= 3.5 and If you are also using Github Connect, please unretire the actions/cache namespace before upgrade (see https://docs.github.com/en/enterprise-server@3.5/admin/github-actions/managing-access-to-actions-from-githubcom/enabling-automatic-access-to-githubcom-actions-using-github-connect#automatic-retirement-of-namespaces-for-actions-accessed-on-githubcom)`;
|
||||||
|
const infoMock = jest.spyOn(core, "info");
|
||||||
|
|
||||||
|
try {
|
||||||
|
process.env["GITHUB_SERVER_URL"] = "http://example.com";
|
||||||
|
expect(actionUtils.isCacheFeatureAvailable()).toBe(false);
|
||||||
|
expect(infoMock).toHaveBeenCalledWith(`[warning]${message}`);
|
||||||
|
} finally {
|
||||||
|
delete process.env["GITHUB_SERVER_URL"];
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
test("isCacheFeatureAvailable for ac disabled on dotcom", () => {
|
||||||
|
jest.spyOn(cache, "isFeatureAvailable").mockImplementation(() => false);
|
||||||
|
|
||||||
|
const message =
|
||||||
|
"An internal error has occurred in cache backend. Please check https://www.githubstatus.com/ for any ongoing issue in actions.";
|
||||||
|
const infoMock = jest.spyOn(core, "info");
|
||||||
|
|
||||||
|
try {
|
||||||
|
process.env["GITHUB_SERVER_URL"] = "http://github.com";
|
||||||
|
expect(actionUtils.isCacheFeatureAvailable()).toBe(false);
|
||||||
|
expect(infoMock).toHaveBeenCalledWith(`[warning]${message}`);
|
||||||
|
} finally {
|
||||||
|
delete process.env["GITHUB_SERVER_URL"];
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
test("isGhes returns false when the GITHUB_SERVER_URL environment variable is not defined", async () => {
|
||||||
|
delete process.env["GITHUB_SERVER_URL"];
|
||||||
|
expect(actionUtils.isGhes()).toBeFalsy();
|
||||||
|
});
|
||||||
|
|
||||||
|
test("isGhes returns false when the GITHUB_SERVER_URL environment variable is set to github.com", async () => {
|
||||||
|
process.env["GITHUB_SERVER_URL"] = "https://github.com";
|
||||||
|
expect(actionUtils.isGhes()).toBeFalsy();
|
||||||
|
});
|
||||||
|
|
||||||
|
test("isGhes returns false when the GITHUB_SERVER_URL environment variable is set to a GitHub Enterprise Cloud-style URL", async () => {
|
||||||
|
process.env["GITHUB_SERVER_URL"] = "https://contoso.ghe.com";
|
||||||
|
expect(actionUtils.isGhes()).toBeFalsy();
|
||||||
|
});
|
||||||
|
|
||||||
|
test("isGhes returns false when the GITHUB_SERVER_URL environment variable has a .localhost suffix", async () => {
|
||||||
|
process.env["GITHUB_SERVER_URL"] = "https://mock-github.localhost";
|
||||||
|
expect(actionUtils.isGhes()).toBeFalsy();
|
||||||
|
});
|
||||||
|
|
||||||
|
test("isGhes returns true when the GITHUB_SERVER_URL environment variable is set to some other URL", async () => {
|
||||||
|
process.env["GITHUB_SERVER_URL"] = "https://src.onpremise.fabrikam.com";
|
||||||
|
expect(actionUtils.isGhes()).toBeTruthy();
|
||||||
|
});
|
17
__tests__/create-cache-files.sh
Executable file
17
__tests__/create-cache-files.sh
Executable file
@ -0,0 +1,17 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# Validate args
|
||||||
|
prefix="$1"
|
||||||
|
if [ -z "$prefix" ]; then
|
||||||
|
echo "Must supply prefix argument"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
path="$2"
|
||||||
|
if [ -z "$path" ]; then
|
||||||
|
echo "Must supply path argument"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
mkdir -p $path
|
||||||
|
echo "$prefix $GITHUB_RUN_ID" > $path/test-file.txt
|
@ -1,22 +0,0 @@
|
|||||||
import * as core from "@actions/core";
|
|
||||||
|
|
||||||
import { Inputs } from "../src/constants";
|
|
||||||
import run from "../src/restore";
|
|
||||||
import * as testUtils from "../src/utils/testUtils";
|
|
||||||
|
|
||||||
test("restore with no path", async () => {
|
|
||||||
const failedMock = jest.spyOn(core, "setFailed");
|
|
||||||
await run();
|
|
||||||
expect(failedMock).toHaveBeenCalledWith(
|
|
||||||
"Input required and not supplied: path"
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
test("restore with no key", async () => {
|
|
||||||
testUtils.setInput(Inputs.Path, "node_modules");
|
|
||||||
const failedMock = jest.spyOn(core, "setFailed");
|
|
||||||
await run();
|
|
||||||
expect(failedMock).toHaveBeenCalledWith(
|
|
||||||
"Input required and not supplied: key"
|
|
||||||
);
|
|
||||||
});
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user