Skip to content

feat(artifacts): mountable artifact store #15

feat(artifacts): mountable artifact store

feat(artifacts): mountable artifact store #15

Workflow file for this run

name: test
on:
push:
branches: [main]
pull_request:
jobs:
test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:16
env:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: artifact_core
ports: ["5457:5432"]
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
ARTIFACT_DATABASE_URL: postgres://postgres:postgres@localhost:5457/artifact_core
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
with:
bun-version: 1.3.14
- run: bun install --frozen-lockfile
# No unpublished @workbench/* scope may leak in — it does not exist on
# npm, so a leak makes the package uninstallable outside the monorepo.
- name: check-deps
run: bun run --cwd packages/artifacts scripts/check-deps.ts
- name: typecheck
run: bun run typecheck
- name: unit + integration tests
run: bun run --cwd packages/artifacts test:coverage
# Emits dist/, which is also what the reference host resolves through —
# so this proves the published artifact, not just the sources.
- name: build
run: bun run build
- name: reference-host acceptance
run: bun test --cwd examples/reference-host
# A consumer on plain Node must be able to install and import the
# tarball; Node cannot strip types, so a src-pointing manifest would die
# here rather than after publish.
- name: node consumer smoke test
run: |
set -euo pipefail
TARBALL="$(cd packages/artifacts && npm pack --silent)"
TARBALL="$PWD/packages/artifacts/$TARBALL"
mkdir -p "$RUNNER_TEMP/consumer" && cd "$RUNNER_TEMP/consumer"
npm init -y >/dev/null && npm pkg set type=module >/dev/null
npm install "$TARBALL"
node -e '
import("@corbits/artifacts").then((m) => {
for (const name of ["mountArtifacts", "runArtifactMigrations"]) {
if (typeof m[name] !== "function") throw new Error(`missing export: ${name}`);
}
console.log("node consumer ok");
});
'