1
0
Fork 0
mirror of https://code.forgejo.org/actions/setup-python synced 2025-06-09 21:02:19 +02:00

Add cache-save: false option

This commit is contained in:
Aarni Koskela 2023-11-10 10:24:46 +02:00
parent 7e8faf07b9
commit 8f0a0b0eda
5 changed files with 85 additions and 9 deletions

View file

@ -34,8 +34,8 @@ describe('run', () => {
beforeEach(() => {
process.env['RUNNER_OS'] = process.env['RUNNER_OS'] ?? 'linux';
for(const key in process.env) {
if(key.startsWith('INPUT_')) {
for (const key in process.env) {
if (key.startsWith('INPUT_')) {
delete process.env[key];
}
}
@ -251,6 +251,18 @@ describe('run', () => {
expect(saveCacheSpy).toHaveBeenCalled();
expect(setFailedSpy).not.toHaveBeenCalled();
});
it('should not save the cache when requested not to', async () => {
setInput('cache', 'pip');
setInput('cache-save', 'false');
setInput('python-version', '3.10.0');
await run();
expect(infoSpy).toHaveBeenCalledWith(
'Not saving cache since `cache-save` is false'
);
expect(saveCacheSpy).not.toHaveBeenCalled();
expect(setFailedSpy).not.toHaveBeenCalled();
});
});
afterEach(() => {