Skip to content

fix(ci): build server-core before the packed SSH host test #419

fix(ci): build server-core before the packed SSH host test

fix(ci): build server-core before the packed SSH host test #419

Workflow file for this run

name: CI
on:
pull_request:
push:
branches:
- main
permissions:
contents: read
concurrency:
group: terminay-ci-${{ github.ref }}
cancel-in-progress: true
jobs:
packaged-macos-smoke:
name: Packaged macOS startup smoke
runs-on: macos-latest
timeout-minutes: 15
steps:
- name: Check out code
uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5.1.0
with:
persist-credentials: false
- name: Set up Node.js
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
with:
node-version: 24.15.0
cache: npm
- name: Install dependencies
run: |
npm install --global npm@12.0.2
npm ci
- name: Build unsigned packaged application
run: |
npm run build:app
CSC_IDENTITY_AUTO_DISCOVERY=false npx electron-builder --dir --mac --arm64 --publish never
- name: Require the native supported macOS arm64 architecture
run: |
test "$(node -p 'process.platform')" = darwin
test "$(node -p 'process.arch')" = arm64
test "$(uname -m)" = arm64
- name: Verify packaged built-in extension lifecycle
env:
TERMINAY_ELECTRON_BUILT_INS: release/0.0.0/mac-arm64/Terminay.app/Contents/Resources/built-in-extensions
TERMINAY_STANDALONE_BUILT_INS: apps/terminay-server/dist/built-in-extensions
run: npm run test:packaged-built-in-extension-runtime
- name: Boot packaged application from a read-only DMG copy
env:
TERMINAY_RELEASE_DIAGNOSTICS_DIR: ${{ runner.temp }}/terminay-packaged-smoke
run: bash scripts/packaged-macos-pr-smoke.sh
packaged-linux-built-in-lifecycle:
name: Packaged Linux built-in lifecycle (${{ matrix.target }})
runs-on: ${{ matrix.runner }}
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
include:
- target: linux-x64
runner: ubuntu-24.04
node_arch: x64
uname_arch: x86_64
- target: linux-arm64
runner: ubuntu-24.04-arm
node_arch: arm64
uname_arch: aarch64
steps:
- name: Check out code
uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5.1.0
with:
persist-credentials: false
- name: Set up Node.js
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
with:
node-version: 24.15.0
cache: npm
- name: Require the native supported Linux architecture
env:
EXPECTED_NODE_ARCH: ${{ matrix.node_arch }}
EXPECTED_UNAME_ARCH: ${{ matrix.uname_arch }}
run: |
test "$(node -p 'process.platform')" = linux
test "$(node -p 'process.arch')" = "$EXPECTED_NODE_ARCH"
test "$(uname -m)" = "$EXPECTED_UNAME_ARCH"
- name: Install dependencies from the clean manifest
run: |
npm install --global npm@12.0.2
npm ci
- name: Build, extract, and exercise packaged built-ins offline
run: npm run test:packaged-built-in-extension-runtime:linux -- ${{ matrix.target }}
build-and-test:
name: Build, lint, and unit tests
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Check out code
uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5.1.0
with:
persist-credentials: false
- name: Set up Node.js
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
with:
node-version: 24.15.0
cache: npm
- name: Install dependencies
run: |
npm install --global npm@12.0.2
npm ci
- name: Build, lint, and run fast tests
run: npm run test:ci
mcp-cli-compatibility:
name: Real MCP CLI compatibility
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Check out code
uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5.1.0
with:
persist-credentials: false
- name: Test latest MCP clients in Docker
run: npm run e2e:mcp-cli-real-tests
e2e-image:
name: Build E2E image
runs-on: ubuntu-latest
timeout-minutes: 15
outputs:
image: ${{ steps.image.outputs.tag }}
image-id: ${{ steps.archive.outputs.image_id }}
steps:
- name: Check out code
uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5.1.0
with:
persist-credentials: false
- name: Require amd64 Docker host
shell: bash
run: |
case "$(uname -m)" in
x86_64|amd64) ;;
*)
echo "The shared Linux E2E image requires an amd64 runner." >&2
exit 1
;;
esac
- name: Resolve E2E image reference
id: image
shell: bash
run: |
echo "tag=terminay-e2e:ci-$GITHUB_SHA" >> "$GITHUB_OUTPUT"
- name: Build and save E2E image
id: archive
env:
IMAGE_TAG: ${{ steps.image.outputs.tag }}
run: |
docker build \
--pull \
--platform linux/amd64 \
--file Dockerfile.e2e \
--tag "$IMAGE_TAG" \
.
mkdir -p .docker-cache/e2e-image
docker save --output .docker-cache/e2e-image/terminay-e2e-image.tar "$IMAGE_TAG"
tar -tf .docker-cache/e2e-image/terminay-e2e-image.tar >/dev/null
gzip -1 --no-name .docker-cache/e2e-image/terminay-e2e-image.tar
gzip -t .docker-cache/e2e-image/terminay-e2e-image.tar.gz
echo "image_id=$(docker image inspect --format '{{.Id}}' "$IMAGE_TAG")" >> "$GITHUB_OUTPUT"
- name: Upload shared E2E image
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: terminay-e2e-image-${{ github.sha }}
path: .docker-cache/e2e-image/terminay-e2e-image.tar.gz
if-no-files-found: error
compression-level: 0
retention-days: 1
e2e-test:
name: E2E (${{ matrix.shard }}/10)
runs-on: ubuntu-latest
timeout-minutes: 10
needs: e2e-image
strategy:
fail-fast: false
matrix:
shard: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
steps:
- name: Check out code
uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5.1.0
with:
persist-credentials: false
- name: Require amd64 Docker host
shell: bash
run: |
case "$(uname -m)" in
x86_64|amd64) ;;
*)
echo "The shared Linux E2E image requires an amd64 runner." >&2
exit 1
;;
esac
- name: Download shared E2E image
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
name: terminay-e2e-image-${{ github.sha }}
path: .docker-cache/e2e-image
- name: Load shared E2E image
run: docker load --input .docker-cache/e2e-image/terminay-e2e-image.tar.gz
- name: Verify shared E2E image
env:
IMAGE_TAG: ${{ needs.e2e-image.outputs.image }}
EXPECTED_IMAGE_ID: ${{ needs.e2e-image.outputs.image-id }}
run: test "$(docker image inspect --format '{{.Id}}' "$IMAGE_TAG")" = "$EXPECTED_IMAGE_ID"
- name: Run end-to-end test shard
env:
TERMINAY_E2E_IMAGE: ${{ needs.e2e-image.outputs.image }}
TERMINAY_E2E_IMAGE_IS_PRELOADED: "1"
TERMINAY_E2E_PLATFORM: linux/amd64
TERMINAY_E2E_ARTIFACT_DIR: ${{ github.workspace }}/.docker-cache/e2e/shard-${{ matrix.shard }}-of-10
run: npm run test:e2e -- --shard=${{ matrix.shard }}/10
- name: Upload Playwright artifacts
if: ${{ always() }}
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: playwright-report-${{ matrix.shard }}-of-10
path: .docker-cache/e2e/shard-${{ matrix.shard }}-of-10
if-no-files-found: ignore
compression-level: 0
retention-days: 7