diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index a3dd726..d2c5646 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -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: 15 + 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 diff --git a/src/utils/manifest.test.js b/src/utils/manifest.test.js index 617bea3..c533443 100644 --- a/src/utils/manifest.test.js +++ b/src/utils/manifest.test.js @@ -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) })), @@ -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 @@ -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 }) }) } })