mirror of
https://github.com/goreleaser/goreleaser-action.git
synced 2026-05-14 06:40:32 +00:00
test: cover install across release eras (#555)
Add install tests pinned to versions that exercise every release era so we don't regress the graceful-skip path for releases that pre-date the cosign v3 sigstore bundle: - v0.182.0 pre-checksums-signing - v1.26.2 cosign v2 detached .sig only - v2.12.4 last release before sigstore bundles - v2.13.0 first release with sigstore bundle (minimum verifiable) - v2.15.3 recent release with sigstore bundle Plus an explicit verifyChecksum integration test that installs v2.12.4 with cosign in PATH to confirm the cosign step is skipped (not failed) when the sigstore bundle is absent. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
parent
e24998b8b6
commit
15fa2a96d4
1 changed files with 35 additions and 0 deletions
|
|
@ -16,11 +16,38 @@ describe('install', () => {
|
|||
expect(fs.existsSync(bin)).toBe(true);
|
||||
}, 100000);
|
||||
|
||||
// The following pinned versions exercise install across release eras to
|
||||
// guard against regressions in checksum handling and the cosign skip path:
|
||||
// - v0.182.0 : pre-checksums-signing era
|
||||
// - v1.26.2 : cosign v2 detached `.sig` only
|
||||
// - v2.12.4 : last release before sigstore bundles (cosign skipped)
|
||||
// - v2.13.0 : first release with cosign v3 sigstore bundle
|
||||
// - v2.15.3 : recent release with sigstore bundle
|
||||
it('acquires v0.182.0 (pre-signing) version of GoReleaser', async () => {
|
||||
const bin = await goreleaser.install('goreleaser', 'v0.182.0');
|
||||
expect(fs.existsSync(bin)).toBe(true);
|
||||
}, 100000);
|
||||
|
||||
it('acquires v1.26.2 (cosign v2 .sig) version of GoReleaser', async () => {
|
||||
const bin = await goreleaser.install('goreleaser', 'v1.26.2');
|
||||
expect(fs.existsSync(bin)).toBe(true);
|
||||
}, 100000);
|
||||
|
||||
it('acquires v2.12.4 (last pre-sigstore-bundle) version of GoReleaser', async () => {
|
||||
const bin = await goreleaser.install('goreleaser', 'v2.12.4');
|
||||
expect(fs.existsSync(bin)).toBe(true);
|
||||
}, 100000);
|
||||
|
||||
it('acquires v2.13.0 (minimum cosign-verifiable) version of GoReleaser', async () => {
|
||||
const bin = await goreleaser.install('goreleaser', 'v2.13.0');
|
||||
expect(fs.existsSync(bin)).toBe(true);
|
||||
}, 100000);
|
||||
|
||||
it('acquires v2.15.3 (recent sigstore-bundle) version of GoReleaser', async () => {
|
||||
const bin = await goreleaser.install('goreleaser', 'v2.15.3');
|
||||
expect(fs.existsSync(bin)).toBe(true);
|
||||
}, 100000);
|
||||
|
||||
it('acquires latest v2 version of GoReleaser Pro', async () => {
|
||||
const bin = await goreleaser.install('goreleaser-pro', '~> v2');
|
||||
expect(fs.existsSync(bin)).toBe(true);
|
||||
|
|
@ -112,6 +139,14 @@ describe('verifyChecksum', () => {
|
|||
expect(fs.existsSync(bin)).toBe(true);
|
||||
}, 120000);
|
||||
|
||||
it('installs a pre-v2.13 release (no sigstore bundle) without failing when cosign is present', async () => {
|
||||
// v2.12.x is the last release that did NOT publish checksums.txt.sigstore.json.
|
||||
// The action must still install it cleanly: checksum verified, cosign step skipped.
|
||||
await requireCosign();
|
||||
const bin = await goreleaser.install('goreleaser', 'v2.12.4');
|
||||
expect(fs.existsSync(bin)).toBe(true);
|
||||
}, 120000);
|
||||
|
||||
it('throws on checksum mismatch', async () => {
|
||||
const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'gha-'));
|
||||
const archive = path.join(dir, 'fake.tar.gz');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue