Skip to content

fix(void): normalize nested Cloudflare queue names #80

fix(void): normalize nested Cloudflare queue names

fix(void): normalize nested Cloudflare queue names #80

Workflow file for this run

name: Platform CI
on:
pull_request:
branches: [main]
paths:
- 'platform/**'
- 'packages/**'
- 'package.json'
- 'pnpm-lock.yaml'
- 'pnpm-workspace.yaml'
- 'vite.config.ts'
- '.github/workflows/platform-*.yml'
workflow_call:
inputs:
require-schema-compat:
description: Run the production schema-compatibility guard. The production deploy sets this for every trigger.
type: boolean
default: false
permissions: {}
jobs:
build-api-container:
if: github.event_name == 'pull_request'
runs-on: ${{ github.repository == 'voidzero-dev/void' && 'blacksmith-4vcpu-ubuntu-2404' || 'ubuntu-latest' }}
timeout-minutes: 10
permissions:
contents: read
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Build API build container
run: docker build --pull --tag void-api-build-container:ci platform/packages/api/container
lint-build-check:
runs-on: ${{ github.repository == 'voidzero-dev/void' && 'blacksmith-4vcpu-ubuntu-2404' || 'ubuntu-latest' }}
permissions:
contents: read
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: voidzero-dev/setup-vp@1b32467adbe183473499fd9d5d372c3ed9641754 # v1.18.0
with:
cache: true
node-version-file: .node-version
- run: vp fmt --check
- run: vp lint
- run: vp run build
- run: vp run --filter './platform/packages/**' build
# After the builds: the type-aware platform lint reads the dashboard's generated
# `.void/tsconfig.json`, which only exists once the dashboard has been built.
- run: vp run lint:platform
# Platform packages only. The framework and the playgrounds are typechecked by ci.yml, and
# the playground typechecks need the playground builds, which this job does not run.
- run: vp run check:platform
# SDK packages too: the deploy workflows run only this job, the dashboard and the
# workers bundle the SDK, and `vp pack` does not typecheck.
- run: vp run check:sdk
test:
runs-on: ${{ github.repository == 'voidzero-dev/void' && 'blacksmith-4vcpu-ubuntu-2404' || 'ubuntu-latest' }}
permissions:
contents: read
strategy:
fail-fast: false
matrix:
project: [platform-unit, platform-api-integration]
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: voidzero-dev/setup-vp@1b32467adbe183473499fd9d5d372c3ed9641754 # v1.18.0
with:
cache: true
node-version-file: .node-version
- run: vp run build
- run: vp run --filter './platform/packages/**' build
- run: vp test run --project ${{ matrix.project }}
# The production guard. `platform-deploy.yml` migrates before it deploys the api worker, so a
# push to `prod` applies a new schema while the previous release is still serving traffic. This
# migrates a real Postgres with the migrations under test, then runs the selected released ref's
# integration tests against that schema: if the code that is live cannot run on the new schema,
# the push must not ship. Void Cloud defaults to `prod`; forks opt in by setting the repository
# variable VOID_PLATFORM_PRODUCTION_REF to their released branch, tag, or commit. The selected
# ref must represent the deployed version, and released migrations are assumed append-only
# (drizzle never re-applies an entry and skips entries not newer than the last applied).
#
# It has teeth on PRs, where the code under test is a different commit from the one that is
# live. The production deploy explicitly requests `require-schema-compat`, including on
# manual dispatch. Fork reusable-workflow callers can request it with their own baseline.
# Staging deploys run source checks without the production compatibility comparison.
schema-compat:
if: >-
${{ inputs.require-schema-compat || (github.event_name == 'pull_request'
&& (github.repository == 'voidzero-dev/void' || vars.VOID_PLATFORM_PRODUCTION_REF != '')) }}
runs-on: ${{ github.repository == 'voidzero-dev/void' && 'blacksmith-4vcpu-ubuntu-2404' || 'ubuntu-latest' }}
timeout-minutes: 20
permissions:
contents: read
env:
PRODUCTION_REF: ${{ vars.VOID_PLATFORM_PRODUCTION_REF || 'prod' }}
POSTGRES_USER: void_ci
POSTGRES_PASSWORD: void_ci_pass
POSTGRES_DB: void_schema_compat
COMPAT_DATABASE_URL: postgresql://void_ci:void_ci_pass@localhost:5432/void_schema_compat
# Pinned: the suite compares timestamps written by Postgres with local time, so a
# runner whose locale is not UTC shifts them by the offset.
TZ: UTC
services:
postgres:
image: postgres:18
env:
POSTGRES_USER: ${{ env.POSTGRES_USER }}
POSTGRES_PASSWORD: ${{ env.POSTGRES_PASSWORD }}
POSTGRES_DB: ${{ env.POSTGRES_DB }}
ports:
- 5432:5432
options: >-
--health-cmd="pg_isready -U $POSTGRES_USER"
--health-interval=5s
--health-timeout=5s
--health-retries=5
steps:
- name: Require a production baseline for fork deployment checks
if: ${{ github.repository != 'voidzero-dev/void' && vars.VOID_PLATFORM_PRODUCTION_REF == '' }}
run: |
echo '::error::Set the repository variable VOID_PLATFORM_PRODUCTION_REF to the released platform ref before requesting schema compatibility checks.'
exit 1
# Phase 1 — apply the migrations under test to a real Postgres.
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: voidzero-dev/setup-vp@1b32467adbe183473499fd9d5d372c3ed9641754 # v1.18.0
with:
cache: true
node-version-file: .node-version
- run: vp run build
- run: vp run --filter @voidcloud/api migrate
env:
DATABASE_URL: ${{ env.COMPAT_DATABASE_URL }}
# Phase 2 — the selected released ref must still run on the migrated schema.
# Forks opt in with VOID_PLATFORM_PRODUCTION_REF; Void Cloud defaults to prod.
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ env.PRODUCTION_REF }}
persist-credentials: false
- name: Require platform code in the baseline
run: |
if [ ! -d platform/packages/api ]; then
echo '::error::The selected production baseline does not contain the platform. Choose a released platform ref with VOID_PLATFORM_PRODUCTION_REF.'
exit 1
fi
- uses: voidzero-dev/setup-vp@1b32467adbe183473499fd9d5d372c3ed9641754 # v1.18.0
with:
cache: true
node-version-file: .node-version
- name: Run the production ref's integration tests on the migrated schema
run: |
vp run build
vp run --filter './platform/packages/**' build
vp test run --project platform-api-integration
env:
VOID_TEST_DATABASE_URL: ${{ env.COMPAT_DATABASE_URL }}