name: CI on: workflow_call: push: branches: - main pull_request: branches: - main concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true jobs: lint: runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 - name: Install Bun uses: oven-sh/setup-bun@v2.2.0 - name: Use cached node_modules uses: actions/cache@v5.1.0 with: path: node_modules key: node-modules-${{ hashFiles('**/bun.lock') }} restore-keys: | node-modules- - name: Install Dependencies run: bun install - name: Lint run: bun run lint typecheck: runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 - name: Install Bun uses: oven-sh/setup-bun@v2.2.0 - name: Use cached node_modules uses: actions/cache@v5.1.0 with: path: node_modules key: node-modules-${{ hashFiles('**/bun.lock') }} restore-keys: | node-modules- - name: Install Dependencies run: bun install - name: Typecheck run: bun --bun run typecheck test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 - name: Install Bun uses: oven-sh/setup-bun@v2.2.0 - name: Use cached node_modules uses: actions/cache@v5.1.0 with: path: node_modules key: node-modules-${{ hashFiles('**/bun.lock') }} restore-keys: | node-modules- - name: Install Dependencies run: bun install - name: Record the host timeout implementation run: timeout --version - name: Install the required GNU process deadline tool uses: pantry-pm/pantry/packages/action@40edb8cd30b4e58a2be08352c6961722af58b47c with: version: '0.11.185' install: 'false' packages: 'gnu.org/coreutils@9.10.0' - name: Verify the managed deadline tool run: timeout --version - name: Build run: bun run build - name: Unit Test run: bun run test persistent-storage: runs-on: ubuntu-latest timeout-minutes: 5 steps: - uses: actions/checkout@v6 - uses: oven-sh/setup-bun@v2.2.0 with: bun-version: '1.4.4' - name: Verify migration and no-op exclusion on an owned filesystem shell: bash run: | set -euo pipefail fixture=$(mktemp -d) volume="$fixture/volume" image="$fixture/volume.img" device='' cleanup() { sudo umount "$volume" 2>/dev/null || true if [ -n "$device" ]; then sudo losetup -d "$device"; fi rm -rf "$fixture" } trap cleanup EXIT mkdir "$volume" truncate -s 4G "$image" device=$(sudo losetup --find --show "$image") case "$device" in /dev/loop[0-9]*) ;; *) exit 1 ;; esac sudo mkfs.ext4 -q "$device" sudo mount "$device" "$volume" sudo mkdir -p /var/lib/ts-cloud sudo env TS_CLOUD_TEST_VOLUME_PATH="$volume" TS_CLOUD_TEST_VOLUME_DEVICE="$device" \ "$(command -v bun)" test ./packages/ts-cloud/test/integration/persistent-storage-mounts.test.ts public-sdk: runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 - name: Provision qualified publication tools uses: pantry-pm/pantry/packages/action@362da3ef0602f51232ab9431da8d05c84c5f49ba # v0.11.197 with: version: '0.11.197' install: 'false' packages: bun.com@1.4.4 git-scm.org@2.53.0 - run: bun install --frozen-lockfile - run: bun run build - name: Qualify the installed public core SDK run: bun run test:package env: TS_CLOUD_PACKAGE_EVIDENCE: ${{ runner.temp }}/ts-cloud-public-sdk - uses: actions/upload-artifact@v7.0.2 if: always() with: name: ts-cloud-public-sdk-${{ github.run_id }} path: ${{ runner.temp }}/ts-cloud-public-sdk if-no-files-found: error publish-commit: needs: [lint, typecheck, test, persistent-storage, public-sdk] runs-on: ubuntu-latest if: github.event_name == 'push' && github.ref == 'refs/heads/main' && vars.PANTRY_PUBLISH_COMMITS == 'true' steps: - uses: actions/checkout@v6 with: fetch-depth: 0 - name: Setup Pantry uses: home-lang/pantry/packages/action@main - name: Install Dependencies run: bun install - name: Build run: bun run build - name: Publish Commit run: pantry publish:commit './packages/*' env: PANTRY_TOKEN: ${{ secrets.PANTRY_TOKEN }}