Skip to content

Commit

Permalink
test master manifest in CI (it's slow)
Browse files Browse the repository at this point in the history
  • Loading branch information
incognitojam committed Mar 2, 2025
1 parent d032e97 commit 2c87bc1
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
15 changes: 14 additions & 1 deletion .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,17 @@ jobs:

- run: bun install
- run: bun lint
- run: bun vitest
- run: bun run test

manifest:
runs-on: ubuntu-latest
timeout-minutes: 12
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v1

- run: bun install
- name: test manifest in master
run: bun run test "manifest"
env:
MANIFEST_BRANCH: master
8 changes: 5 additions & 3 deletions src/utils/manifest.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import * as Comlink from 'comlink'
import config from '../config'
import { getManifest } from './manifest'

const MANIFEST_BRANCH = import.meta.env.MANIFEST_BRANCH

globalThis.navigator = {
storage: {
estimate: vi.fn().mockImplementation(() => ({ quota: 10 * (1024 ** 3) })),
Expand Down Expand Up @@ -32,7 +34,7 @@ vi.resetModules() // this makes the import be reevaluated on each call
await import('./../workers/image.worker')

for (const [branch, manifestUrl] of Object.entries(config.manifests)) {
describe(`${branch} manifest`, async () => {
describe.skipIf(MANIFEST_BRANCH && branch !== MANIFEST_BRANCH)(`${branch} manifest`, async () => {
const images = await getManifest(manifestUrl)

// Check all images are present
Expand All @@ -58,9 +60,9 @@ for (const [branch, manifestUrl] of Object.entries(config.manifests)) {
}
})

test('download', async () => {
test.skipIf(image.name === 'system' && !MANIFEST_BRANCH)('download', async () => {
await imageWorker.downloadImage(image)
}, { skip: image.name === 'system', timeout: 8 * 1000 })
}, { timeout: (image.name === 'system' ? 11 * 60 : 8) * 1000 })
})
}
})
Expand Down

0 comments on commit 2c87bc1

Please sign in to comment.