mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2026-10-24 10:03:20 +00:00
Preserve the multi-platform CLI build cache during validation
This commit is contained in:
1 parent
8892f659f6
commit
4a51253299
3 files changed
+15
-4
No files matched your search
@@ -58,8 +58,11 @@ jobs:
|
|||||||
load: true
|
load: true
|
||||||
tags: livesync-cli
|
tags: livesync-cli
|
||||||
platforms: linux/amd64
|
platforms: linux/amd64
|
||||||
cache-from: type=gha,scope=cli-image
|
cache-from: |
|
||||||
cache-to: type=gha,scope=cli-image,mode=max
|
type=gha,scope=cli-image-amd64
|
||||||
|
type=gha,scope=cli-image
|
||||||
|
# Keep amd64 validation from replacing the cache for both platforms.
|
||||||
|
cache-to: type=gha,scope=cli-image-amd64,mode=max
|
||||||
|
|
||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
uses: actions/setup-node@v5
|
uses: actions/setup-node@v5
|
||||||
|
|||||||
@@ -129,5 +129,7 @@ jobs:
|
|||||||
push: ${{ steps.meta.outputs.push }}
|
push: ${{ steps.meta.outputs.push }}
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
platforms: linux/amd64,linux/arm64
|
platforms: linux/amd64,linux/arm64
|
||||||
cache-from: type=gha,scope=cli-image
|
cache-from: |
|
||||||
|
type=gha,scope=cli-image-amd64
|
||||||
|
type=gha,scope=cli-image
|
||||||
cache-to: type=gha,scope=cli-image,mode=max
|
cache-to: type=gha,scope=cli-image,mode=max
|
||||||
@@ -138,6 +138,12 @@ describe("CLI CI selection", () => {
|
|||||||
step.uses?.startsWith("docker/build-push-action@")
|
step.uses?.startsWith("docker/build-push-action@")
|
||||||
);
|
);
|
||||||
expect(publishBuild?.with?.["cache-from"]).toBe(build?.with?.["cache-from"]);
|
expect(publishBuild?.with?.["cache-from"]).toBe(build?.with?.["cache-from"]);
|
||||||
expect(publishBuild?.with?.["cache-to"]).toBe(build?.with?.["cache-to"]);
|
const validationScope = String(build?.with?.["cache-to"]).match(/scope=([^,\s]+)/)?.[1];
|
||||||
|
const publicationScope = String(publishBuild?.with?.["cache-to"]).match(/scope=([^,\s]+)/)?.[1];
|
||||||
|
expect(validationScope).toBeDefined();
|
||||||
|
expect(publicationScope).toBeDefined();
|
||||||
|
expect(publicationScope).not.toBe(validationScope);
|
||||||
|
expect(publishBuild?.with?.["cache-from"]).toContain(`scope=${validationScope}`);
|
||||||
|
expect(publishBuild?.with?.["cache-from"]).toContain(`scope=${publicationScope}`);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
Reference in new issue
Block a user