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

Add caching tests #2

Open
wants to merge 42 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
d1c96e7
first iteration for implementation of caching
dmitry-shibanov May 25, 2021
9f50fca
add logs
dmitry-shibanov May 25, 2021
4cca2c6
add debug line
dmitry-shibanov May 25, 2021
da0e85f
fix build command
dmitry-shibanov May 25, 2021
63abf56
fix path
dmitry-shibanov May 25, 2021
85b8fb0
add possible post-if
dmitry-shibanov May 26, 2021
da6d5de
remove braces
dmitry-shibanov May 26, 2021
2248a7a
test new action post-if variant
dmitry-shibanov May 26, 2021
911e913
work on built-in caching
dmitry-shibanov May 26, 2021
7c66d28
remove post-if
dmitry-shibanov May 26, 2021
3c6ab3c
pass version
dmitry-shibanov May 26, 2021
bd3feac
work on yarn support
dmitry-shibanov May 27, 2021
87764b5
fix return value
dmitry-shibanov May 27, 2021
b38fc9b
change names and remove logs
dmitry-shibanov May 27, 2021
74b0791
worked on resolving comments
dmitry-shibanov May 31, 2021
d415a30
check post-if for null
dmitry-shibanov May 31, 2021
cf8ada0
add success() condition
dmitry-shibanov May 31, 2021
a8106dc
remove primary key field
dmitry-shibanov May 31, 2021
515f6db
work on resolving comments
dmitry-shibanov Jun 1, 2021
0535369
remove logs
dmitry-shibanov Jun 1, 2021
90501c0
resolving comments
dmitry-shibanov Jun 1, 2021
de27331
resolving comments
dmitry-shibanov Jun 2, 2021
5d37868
resolving comments
dmitry-shibanov Jun 2, 2021
7409201
resolving comments
dmitry-shibanov Jun 2, 2021
4fd9b96
fix getpackageManagerVersion
dmitry-shibanov Jun 2, 2021
38d335a
run clean for unstaged changes
dmitry-shibanov Jun 4, 2021
1b970e4
fix falling version tests
dmitry-shibanov Jun 9, 2021
3cef065
add tests to cover node's caching
dmitry-shibanov Jun 9, 2021
c0ee865
work on resolving comments
dmitry-shibanov Jun 9, 2021
be26f79
Merge branch 'add-caching' into add-caching-tests
dmitry-shibanov Jun 9, 2021
5d6b336
work on fixing tests
dmitry-shibanov Jun 9, 2021
14e5f5d
fix e2e tests
dmitry-shibanov Jun 9, 2021
227feac
resolving comments
dmitry-shibanov Jun 9, 2021
e375799
Merge branch 'add-caching' into add-caching-tests
dmitry-shibanov Jun 9, 2021
0477a57
rebuild and fix test
dmitry-shibanov Jun 9, 2021
796d3f0
fix comment
dmitry-shibanov Jun 10, 2021
72659ff
Merge branch 'add-caching' into add-caching-tests
dmitry-shibanov Jun 10, 2021
506430d
fixing tests
dmitry-shibanov Jun 10, 2021
d9ae421
resolve comments
dmitry-shibanov Jun 11, 2021
fe44334
Merge branch 'add-caching' into add-caching-tests
dmitry-shibanov Jun 11, 2021
99708b4
change name of describes, it and fix test
dmitry-shibanov Jun 11, 2021
8281172
add names for jobs
dmitry-shibanov Jun 15, 2021
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
fix falling version tests
dmitry-shibanov committed Jun 9, 2021
commit 1b970e4ba6a76909750a7934c67e6376a9a4df4a
5 changes: 3 additions & 2 deletions dist/cache-save/index.js
Original file line number Diff line number Diff line change
@@ -50336,7 +50336,7 @@ function run() {
yield cachePackages(cacheLock);
}
catch (error) {
core.setFailed('Failed to remove private key');
core.setFailed(error.message);
}
});
}
@@ -50345,7 +50345,8 @@ const cachePackages = (packageManager) => __awaiter(void 0, void 0, void 0, func
const primaryKey = core.getState(constants_1.State.CachePrimaryKey);
const packageManagerInfo = yield cache_utils_1.getPackageManagerInfo(packageManager);
if (!packageManagerInfo) {
throw new Error(`Caching for '${packageManager}' is not supported`);
core.debug(`Caching for '${packageManager}' is not supported`);
return;
}
const cachePath = yield cache_utils_1.getCacheDirectoryPath(packageManagerInfo, packageManager);
if (primaryKey === state) {
2 changes: 1 addition & 1 deletion dist/setup/index.js
Original file line number Diff line number Diff line change
@@ -64608,7 +64608,7 @@ function getNode(versionSpec, stable, checkLatest, auth, arch = os.arch()) {
let extPath;
info = info || {}; // satisfy compiler, never null when reaches here
if (osPlat == 'win32') {
let _7zPath = path.join(__dirname, '..', 'externals', '7zr.exe');
let _7zPath = path.join(__dirname, '../..', 'externals', '7zr.exe');
extPath = yield tc.extract7z(downloadPath, undefined, _7zPath);
// 7z extracts to folder matching file name
let nestedPath = path.join(extPath, path.basename(info.fileName, '.7z'));
5 changes: 3 additions & 2 deletions src/cache-save.ts
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ async function run() {
try {
await cachePackages(cacheLock);
} catch (error) {
core.setFailed('Failed to remove private key');
core.setFailed(error.message);
}
}

@@ -18,7 +18,8 @@ const cachePackages = async (packageManager: string) => {

const packageManagerInfo = await getPackageManagerInfo(packageManager);
if (!packageManagerInfo) {
throw new Error(`Caching for '${packageManager}' is not supported`);
core.debug(`Caching for '${packageManager}' is not supported`);
return;
}

const cachePath = await getCacheDirectoryPath(
2 changes: 1 addition & 1 deletion src/installer.ts
Original file line number Diff line number Diff line change
@@ -128,7 +128,7 @@ export async function getNode(
let extPath: string;
info = info || ({} as INodeVersionInfo); // satisfy compiler, never null when reaches here
if (osPlat == 'win32') {
let _7zPath = path.join(__dirname, '..', 'externals', '7zr.exe');
let _7zPath = path.join(__dirname, '../..', 'externals', '7zr.exe');
extPath = await tc.extract7z(downloadPath, undefined, _7zPath);
// 7z extracts to folder matching file name
let nestedPath = path.join(extPath, path.basename(info.fileName, '.7z'));