attempt to replicate layout

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
This commit is contained in:
Alex Goodman 2025-11-11 14:36:10 -05:00
parent 5f823b97ba
commit 30324e9a9f

View File

@ -105,6 +105,8 @@ jobs:
const baseDir = "./snapshot" const baseDir = "./snapshot"
const dirs = ls(baseDir).filter(f => f.isDirectory()).map(f => f.name) const dirs = ls(baseDir).filter(f => f.isDirectory()).map(f => f.name)
const uploads = [] const uploads = []
// upload platform subdirectories
for (const dir of dirs) { for (const dir of dirs) {
// uploadArtifact returns Promise<{id, size}> // uploadArtifact returns Promise<{id, size}>
uploads.push(artifact.uploadArtifact( uploads.push(artifact.uploadArtifact(
@ -117,10 +119,23 @@ jobs:
{ retentionDays: 30 } { retentionDays: 30 }
)) ))
} }
// upload checksums file (needed by install tests)
const rootFiles = ls(baseDir).filter(f => f.isFile() && f.name.match(/syft_.*_checksums\.txt$/))
if (rootFiles.length > 0) {
const checksumsFile = rootFiles[0].name
uploads.push(artifact.uploadArtifact(
'syft_checksums.txt',
[`${baseDir}/${checksumsFile}`],
baseDir,
{ retentionDays: 30 }
))
}
// wait for all uploads to finish // wait for all uploads to finish
try { try {
const results = await Promise.all(uploads) const results = await Promise.all(uploads)
console.log(`Successfully uploaded ${results.length} platform artifacts`) console.log(`Successfully uploaded ${results.length} artifacts`)
} catch (error) { } catch (error) {
console.error('Upload failed:', error) console.error('Upload failed:', error)
throw error throw error
@ -142,11 +157,17 @@ jobs:
with: with:
download-test-fixture-cache: true download-test-fixture-cache: true
- name: Download checksums file
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 #v6.0.0
with:
name: syft_checksums.txt
path: snapshot
- name: Download Linux amd64 snapshot - name: Download Linux amd64 snapshot
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 #v6.0.0 uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 #v6.0.0
with: with:
name: linux-build_linux_amd64_v1 name: linux-build_linux_amd64_v1
path: snapshot/linux-build_linux_amd64_v1 path: snapshot/linux-build_linux_amd64_v1/syft
- name: Run comparison tests (Linux) - name: Run comparison tests (Linux)
run: make compare-linux run: make compare-linux
@ -182,11 +203,17 @@ jobs:
go-dependencies: false go-dependencies: false
download-test-fixture-cache: true download-test-fixture-cache: true
- name: Download checksums file
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 #v6.0.0
with:
name: syft_checksums.txt
path: snapshot
- name: Download macOS Intel snapshot - name: Download macOS Intel snapshot
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 #v6.0.0 uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 #v6.0.0
with: with:
name: darwin-build_darwin_amd64_v1 name: darwin-build_darwin_amd64_v1
path: snapshot/darwin-build_darwin_amd64_v1 path: snapshot/darwin-build_darwin_amd64_v1/syft
- name: Run comparison tests (Mac) - name: Run comparison tests (Mac)
run: make compare-mac run: make compare-mac
@ -214,7 +241,7 @@ jobs:
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 #v6.0.0 uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 #v6.0.0
with: with:
name: linux-build_linux_amd64_v1 name: linux-build_linux_amd64_v1
path: snapshot/linux-build_linux_amd64_v1 path: snapshot/linux-build_linux_amd64_v1/syft
- name: Run CLI Tests (Linux) - name: Run CLI Tests (Linux)
run: make cli run: make cli