From d6a8b1876a2cc8e05112ae99e524a02adf7ee020 Mon Sep 17 00:00:00 2001 From: Timothee Guerin Date: Wed, 25 Mar 2026 09:17:44 -0400 Subject: [PATCH 01/10] Migrate core ci to github actions --- .github/workflows/core-ci.yml | 184 ++++++++++++++++++++++++++++++++++ 1 file changed, 184 insertions(+) create mode 100644 .github/workflows/core-ci.yml diff --git a/.github/workflows/core-ci.yml b/.github/workflows/core-ci.yml new file mode 100644 index 00000000000..37ba874c990 --- /dev/null +++ b/.github/workflows/core-ci.yml @@ -0,0 +1,184 @@ +name: Core CI + +on: + push: + branches: + - main + # Exclude isolated emitter packages and files already checked by dedicated CI workflows + paths-ignore: + - ".prettierignore" + - ".prettierrc.json" + - "cspell.yaml" + - "eslint.config.json" + - ".chronus/**" + - "eng/emitters/**" + - "packages/http-client-csharp/**" + - "packages/http-client-java/**" + - "packages/http-client-python/**" + pull_request: + branches: + - main + - "release/*" + paths-ignore: + - ".prettierignore" + - ".prettierrc.json" + - "cspell.yaml" + - "eslint.config.json" + - ".chronus/**" + - "eng/emitters/**" + - "packages/http-client-csharp/**" + - "packages/http-client-java/**" + - "packages/http-client-python/**" + merge_group: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build-and-test: + name: Build & Test (${{ matrix.os }}, Node ${{ matrix.node-version }}) + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest] + node-version: ["20.x", "22.x", "24.x"] + + env: + TYPESPEC_VS_CI_BUILD: true + TYPESPEC_SKIP_WEBSITE_BUILD: true + + steps: + - uses: actions/checkout@v4 + + - uses: ./.github/actions/setup + with: + node-version: ${{ matrix.node-version }} + + - uses: actions/setup-dotnet@v5 + with: + dotnet-version: 8.0.x + + - name: Install dependencies + run: pnpm install + + - name: Restore .NET dependencies + run: dotnet restore + working-directory: packages/typespec-vs + + - name: Build + run: pnpm run build + + - name: Test + run: pnpm run test:ci + + - name: Upload coverage artifacts + uses: actions/upload-artifact@v4 + if: always() + with: + name: coverage-${{ matrix.os }}-node${{ matrix.node-version }} + path: packages/*/coverage/ + retention-days: 5 + + - name: Upload test results + uses: actions/upload-artifact@v4 + if: always() + with: + name: test-results-${{ matrix.os }}-node${{ matrix.node-version }} + path: packages/*/test-results.xml + retention-days: 5 + + - name: Check for changed files + run: node eng/common/scripts/check-for-changed-files.js + + website: + name: Website + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - uses: ./.github/actions/setup + + - name: Install dependencies + run: pnpm install + + - name: Install Playwright browsers + run: npx playwright install --with-deps + + - name: Build website + run: pnpm --filter "@typespec/website..." run build + + - name: Check for changed files + run: node eng/common/scripts/check-for-changed-files.js + + e2e: + name: E2E Tests + runs-on: ubuntu-latest + + env: + TYPESPEC_VS_CI_BUILD: false + TYPESPEC_SKIP_WEBSITE_BUILD: true + DISPLAY: ":99" + + steps: + - uses: actions/checkout@v4 + + - uses: ./.github/actions/setup + + - name: Install dependencies + run: pnpm install + + - name: Install Playwright browsers + run: | + sudo dpkg --configure -a + npx playwright install --with-deps + + - name: Start Xvfb + run: | + /usr/bin/Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 & + echo "Started xvfb" + + - name: Build + run: pnpm run build + + - name: E2E Tests + run: pnpm run test:e2e + + - name: Upload UI test results + uses: actions/upload-artifact@v4 + if: always() + with: + name: uitestresults-e2e + path: packages/playground-website/test-results/ + retention-days: 5 + + - name: Upload screenshots + uses: actions/upload-artifact@v4 + if: always() + with: + name: screenshots + path: packages/typespec-vscode/temp/images-linux/ + retention-days: 5 + + - name: Upload trace results + uses: actions/upload-artifact@v4 + if: always() + with: + name: trace-results + path: packages/typespec-vscode/test-results/ + retention-days: 5 + + - name: Check for changed files + run: node eng/common/scripts/check-for-changed-files.js + + docker: + name: Docker Build + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Build Docker image + run: docker build -f ./docker/Dockerfile . From 696c87d4f113ce2b578c49a0049e406c5da45b8c Mon Sep 17 00:00:00 2001 From: Timothee Guerin Date: Wed, 25 Mar 2026 09:19:44 -0400 Subject: [PATCH 02/10] long paths --- .github/workflows/core-ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/core-ci.yml b/.github/workflows/core-ci.yml index 37ba874c990..07a4ee51d36 100644 --- a/.github/workflows/core-ci.yml +++ b/.github/workflows/core-ci.yml @@ -50,6 +50,10 @@ jobs: TYPESPEC_SKIP_WEBSITE_BUILD: true steps: + - name: Enable git long paths (Windows) + if: runner.os == 'Windows' + run: git config --global core.longpaths true + - uses: actions/checkout@v4 - uses: ./.github/actions/setup From 459d0d892a918a2ec99ec5246cb0a09b6af3e515 Mon Sep 17 00:00:00 2001 From: Timothee Guerin Date: Wed, 25 Mar 2026 11:40:05 -0400 Subject: [PATCH 03/10] github action reporter --- .github/workflows/core-ci.yml | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/.github/workflows/core-ci.yml b/.github/workflows/core-ci.yml index 07a4ee51d36..8f9e36c2f84 100644 --- a/.github/workflows/core-ci.yml +++ b/.github/workflows/core-ci.yml @@ -75,7 +75,7 @@ jobs: run: pnpm run build - name: Test - run: pnpm run test:ci + run: pnpm vitest run --coverage --reporter=default --reporter=github-actions - name: Upload coverage artifacts uses: actions/upload-artifact@v4 @@ -85,14 +85,6 @@ jobs: path: packages/*/coverage/ retention-days: 5 - - name: Upload test results - uses: actions/upload-artifact@v4 - if: always() - with: - name: test-results-${{ matrix.os }}-node${{ matrix.node-version }} - path: packages/*/test-results.xml - retention-days: 5 - - name: Check for changed files run: node eng/common/scripts/check-for-changed-files.js From b47383e65c8c20bacf43fba2bb569f876402478d Mon Sep 17 00:00:00 2001 From: Timothee Guerin Date: Wed, 25 Mar 2026 11:50:58 -0400 Subject: [PATCH 04/10] force no color --- packages/compiler/test/e2e/cli/cli.e2e.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/compiler/test/e2e/cli/cli.e2e.ts b/packages/compiler/test/e2e/cli/cli.e2e.ts index 528aa8b60af..3b63235b4e3 100644 --- a/packages/compiler/test/e2e/cli/cli.e2e.ts +++ b/packages/compiler/test/e2e/cli/cli.e2e.ts @@ -16,7 +16,10 @@ interface ExecCliOptions { async function execCli(args: string[], { cwd }: ExecCliOptions) { const node = process.platform === "win32" ? "node.exe" : "node"; - return execAsync(node, [resolvePath(pkgRoot, "entrypoints/cli.js"), ...args], { cwd }); + return execAsync(node, [resolvePath(pkgRoot, "entrypoints/cli.js"), ...args], { + cwd, + env: { ...process.env, NO_COLOR: "1" }, + }); } async function execCliSuccess(args: string[], { cwd }: ExecCliOptions) { const result = await execCli(args, { cwd }); From 16296ce9869a87a41019e5481ee00bdfc791de25 Mon Sep 17 00:00:00 2001 From: Timothee Guerin Date: Wed, 25 Mar 2026 12:02:26 -0400 Subject: [PATCH 05/10] shorter name --- .github/workflows/core-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/core-ci.yml b/.github/workflows/core-ci.yml index 8f9e36c2f84..3ac59022fe0 100644 --- a/.github/workflows/core-ci.yml +++ b/.github/workflows/core-ci.yml @@ -36,8 +36,8 @@ concurrency: cancel-in-progress: true jobs: - build-and-test: - name: Build & Test (${{ matrix.os }}, Node ${{ matrix.node-version }}) + build: + name: Build (${{ matrix.os }}, Node ${{ matrix.node-version }}) runs-on: ${{ matrix.os }} strategy: fail-fast: false From dc10bdf170952397373681b45412af5e04b12cf4 Mon Sep 17 00:00:00 2001 From: Timothee Guerin Date: Wed, 25 Mar 2026 13:13:22 -0400 Subject: [PATCH 06/10] try ubuntu slim --- .github/workflows/core-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/core-ci.yml b/.github/workflows/core-ci.yml index 3ac59022fe0..be168a26877 100644 --- a/.github/workflows/core-ci.yml +++ b/.github/workflows/core-ci.yml @@ -90,7 +90,7 @@ jobs: website: name: Website - runs-on: ubuntu-latest + runs-on: ubuntu-slim steps: - uses: actions/checkout@v4 @@ -171,7 +171,7 @@ jobs: docker: name: Docker Build - runs-on: ubuntu-latest + runs-on: ubuntu-slim steps: - uses: actions/checkout@v4 From 604ce9abaafcedc1f4aa329d9ae0480a975871d8 Mon Sep 17 00:00:00 2001 From: Timothee Guerin Date: Wed, 25 Mar 2026 13:23:37 -0400 Subject: [PATCH 07/10] revert ubuntu slim --- .github/workflows/core-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/core-ci.yml b/.github/workflows/core-ci.yml index be168a26877..3ac59022fe0 100644 --- a/.github/workflows/core-ci.yml +++ b/.github/workflows/core-ci.yml @@ -90,7 +90,7 @@ jobs: website: name: Website - runs-on: ubuntu-slim + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -171,7 +171,7 @@ jobs: docker: name: Docker Build - runs-on: ubuntu-slim + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 From 566122bab8af33f6c35b6e077ef60bda07d8b6ac Mon Sep 17 00:00:00 2001 From: Timothee Guerin Date: Thu, 26 Mar 2026 08:18:05 -0400 Subject: [PATCH 08/10] add final job --- .github/workflows/core-ci.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/core-ci.yml b/.github/workflows/core-ci.yml index 3ac59022fe0..4a241dcb270 100644 --- a/.github/workflows/core-ci.yml +++ b/.github/workflows/core-ci.yml @@ -178,3 +178,16 @@ jobs: - name: Build Docker image run: docker build -f ./docker/Dockerfile . + + # This allows us to have a branch protection rule for tests and deploys with matrix + ci-status: + runs-on: ubuntu-latest + needs: [build, website, e2e, docker] + if: always() + steps: + - name: Successful CI + if: ${{ !(contains(needs.*.result, 'failure')) }} + run: exit 0 + - name: Failing CI + if: ${{ contains(needs.*.result, 'failure') }} + run: exit 1 From 62888c885dc7ca7af449e776ff108be0a77cac82 Mon Sep 17 00:00:00 2001 From: Timothee Guerin Date: Thu, 26 Mar 2026 11:10:10 -0700 Subject: [PATCH 09/10] Update CI workflow with permissions and cleanup Added permissions for reading contents and removed CI status checks. --- .github/workflows/core-ci.yml | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/.github/workflows/core-ci.yml b/.github/workflows/core-ci.yml index 4a241dcb270..96da0d7841f 100644 --- a/.github/workflows/core-ci.yml +++ b/.github/workflows/core-ci.yml @@ -1,5 +1,8 @@ name: Core CI +permissions: + contents: read + on: push: branches: @@ -179,15 +182,3 @@ jobs: - name: Build Docker image run: docker build -f ./docker/Dockerfile . - # This allows us to have a branch protection rule for tests and deploys with matrix - ci-status: - runs-on: ubuntu-latest - needs: [build, website, e2e, docker] - if: always() - steps: - - name: Successful CI - if: ${{ !(contains(needs.*.result, 'failure')) }} - run: exit 0 - - name: Failing CI - if: ${{ contains(needs.*.result, 'failure') }} - run: exit 1 From 1c0cddb4df683ff0b511a94974b954e3bcfbaa3a Mon Sep 17 00:00:00 2001 From: Timothee Guerin Date: Thu, 26 Mar 2026 15:07:54 -0400 Subject: [PATCH 10/10] format --- .github/workflows/core-ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/core-ci.yml b/.github/workflows/core-ci.yml index 96da0d7841f..f8e1751cd83 100644 --- a/.github/workflows/core-ci.yml +++ b/.github/workflows/core-ci.yml @@ -181,4 +181,3 @@ jobs: - name: Build Docker image run: docker build -f ./docker/Dockerfile . -