| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105 |
- name: CI
- on:
- push:
- branches: [main]
- pull_request:
- branches: [main]
- jobs:
- test-node:
- name: Node ${{ matrix.node-version }} (${{ matrix.os }})
- runs-on: ${{ matrix.os }}
- strategy:
- fail-fast: false
- matrix:
- os: [ubuntu-latest, macos-latest]
- node-version: ["22", "23"]
- steps:
- - uses: actions/checkout@v4
- - uses: actions/setup-node@v4
- with:
- node-version: ${{ matrix.node-version }}
- - name: Install SQLite (Ubuntu)
- if: runner.os == 'Linux'
- run: sudo apt-get update && sudo apt-get install -y libsqlite3-dev
- - name: Install SQLite (macOS)
- if: runner.os == 'macOS'
- run: brew install sqlite
- - run: npm install
- - name: Tests
- run: npx vitest run --reporter=verbose --testTimeout 60000 test/
- env:
- CI: true
- test-bun:
- name: Bun (${{ matrix.os }})
- runs-on: ${{ matrix.os }}
- strategy:
- fail-fast: false
- matrix:
- os: [ubuntu-latest, macos-latest]
- steps:
- - uses: actions/checkout@v4
- - uses: oven-sh/setup-bun@v2
- with:
- bun-version: latest
- - name: Install SQLite (Ubuntu)
- if: runner.os == 'Linux'
- run: sudo apt-get update && sudo apt-get install -y libsqlite3-dev
- - name: Install SQLite (macOS)
- if: runner.os == 'macOS'
- run: brew install sqlite
- - name: Verify lockfile is up-to-date
- run: bun install --frozen-lockfile
- - name: Tests
- run: bun test --timeout 60000 --preload ./src/test-preload.ts test/
- env:
- CI: true
- DYLD_LIBRARY_PATH: /opt/homebrew/opt/sqlite/lib
- LD_LIBRARY_PATH: /usr/lib/x86_64-linux-gnu
- dist-sync:
- # Verify that committed dist/ matches what `npm run build` produces from
- # the committed src/. Drift here would crash consumers that import from
- # @oivo/qmd's pre-built dist/ (e.g. fleet oc.tgz bundles ship dist/
- # AS-IS without rebuilding). See i-9l2ueyyz / i-qkarfffa retrospective.
- name: dist/ in sync with src/
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v4
- - uses: actions/setup-node@v4
- with:
- node-version: "22"
- - name: Install SQLite
- run: sudo apt-get update && sudo apt-get install -y libsqlite3-dev
- - run: npm install
- - name: Build dist/
- run: npm run build
- - name: Verify dist/ is committed and in sync
- run: |
- if ! git diff --exit-code -- dist/; then
- echo ""
- echo "::error::dist/ drifted after npm run build -- commit the rebuilt dist/ alongside src/."
- echo "::error::Reproduce locally: cd vendor/qmd && npm install && npm run build && git diff dist/"
- echo "::error::Then: git add dist/ && git commit --amend --no-edit (or new commit) and push."
- exit 1
- fi
- echo "dist/ is in sync with src/ ✓"
|