Skip to content

Commit e4e7436

Browse files
committed
_
Signed-off-by: Sora Morimoto <[email protected]>
1 parent 8b4a3e7 commit e4e7436

File tree

5 files changed

+78
-80
lines changed

5 files changed

+78
-80
lines changed

.github/workflows/workflow.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,5 @@ jobs:
6767
with:
6868
ocaml-compiler: ${{ matrix.ocaml-compiler }}
6969
allow-prerelease-opam: true
70-
dune-cache: true
7170

7271
- run: opam install uri

dist/index.js

Lines changed: 24 additions & 26 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/post/index.js

Lines changed: 24 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/setup-ocaml/src/cache.ts

Lines changed: 29 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -159,15 +159,40 @@ async function saveCache(key: string, paths: string[]) {
159159
}
160160
}
161161

162-
export async function restoreCygwinCache() {
163-
return await core.group("Retrieve the Cygwin cache", async () => {
164-
const { key, restoreKeys } = await composeCygwinCacheKeys();
165-
const paths = composeCygwinCachePaths();
162+
export async function restoreDuneCache() {
163+
return await core.group("Retrieve the dune cache", async () => {
164+
const { key, restoreKeys } = composeDuneCacheKeys();
165+
const paths = composeDuneCachePaths();
166166
const cacheKey = await restoreCache(key, restoreKeys, paths);
167167
return cacheKey;
168168
});
169169
}
170170

171+
async function restoreCygwinCache() {
172+
const { key, restoreKeys } = await composeCygwinCacheKeys();
173+
const paths = composeCygwinCachePaths();
174+
const cacheKey = await restoreCache(key, restoreKeys, paths);
175+
return cacheKey;
176+
}
177+
178+
async function restoreOpamCache() {
179+
const { key, restoreKeys } = await composeOpamCacheKeys();
180+
const paths = composeOpamCachePaths();
181+
const cacheKey = await restoreCache(key, restoreKeys, paths);
182+
return cacheKey;
183+
}
184+
185+
export async function restoreOpamCaches() {
186+
return await core.group("Retrieve the opam cache", async () => {
187+
const [opamCacheHit, cygwinCacheHit] = await Promise.all(
188+
PLATFORM === "windows"
189+
? [restoreOpamCache(), restoreCygwinCache()]
190+
: [restoreOpamCache()],
191+
);
192+
return { opamCacheHit, cygwinCacheHit };
193+
});
194+
}
195+
171196
export async function saveCygwinCache() {
172197
await core.group("Save the Cygwin cache", async () => {
173198
const { key } = await composeCygwinCacheKeys();
@@ -176,15 +201,6 @@ export async function saveCygwinCache() {
176201
});
177202
}
178203

179-
export async function restoreDuneCache() {
180-
return await core.group("Retrieve the dune cache", async () => {
181-
const { key, restoreKeys } = composeDuneCacheKeys();
182-
const paths = composeDuneCachePaths();
183-
const cacheKey = await restoreCache(key, restoreKeys, paths);
184-
return cacheKey;
185-
});
186-
}
187-
188204
export async function saveDuneCache() {
189205
await core.group("Save the dune cache", async () => {
190206
const { key } = composeDuneCacheKeys();
@@ -193,15 +209,6 @@ export async function saveDuneCache() {
193209
});
194210
}
195211

196-
export async function restoreOpamCache() {
197-
return await core.group("Retrieve the opam cache", async () => {
198-
const { key, restoreKeys } = await composeOpamCacheKeys();
199-
const paths = composeOpamCachePaths();
200-
const cacheKey = await restoreCache(key, restoreKeys, paths);
201-
return cacheKey;
202-
});
203-
}
204-
205212
export async function saveOpamCache() {
206213
await core.group("Save the opam cache", async () => {
207214
await exec("opam", [

packages/setup-ocaml/src/installer.ts

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@ import * as process from "node:process";
33
import * as core from "@actions/core";
44
import { exec } from "@actions/exec";
55
import {
6-
restoreCygwinCache,
76
restoreDuneCache,
8-
restoreOpamCache,
7+
restoreOpamCaches,
98
saveCygwinCache,
109
saveOpamCache,
1110
} from "./cache.js";
@@ -31,15 +30,6 @@ import { getOpamLocalPackages } from "./packages.js";
3130
import { resolveCompiler } from "./version.js";
3231
import { setupCygwin } from "./windows.js";
3332

34-
async function restoreOpamCaches() {
35-
const [opamCacheHit, cygwinCacheHit] = await Promise.all(
36-
PLATFORM === "windows"
37-
? [restoreOpamCache(), restoreCygwinCache()]
38-
: [restoreOpamCache()],
39-
);
40-
return { opamCacheHit, cygwinCacheHit };
41-
}
42-
4333
export async function installer() {
4434
if (core.isDebug()) {
4535
core.exportVariable("OPAMVERBOSE", 1);

0 commit comments

Comments
 (0)