diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index cbedb8d17e7..979bfdbe110 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -7,6 +7,7 @@ - Use `pnpm install` to install dependencies - Use `pnpm build` to build every package - Use `pnpm -r --filter "..." build` to build to a specific package `` +- Use `pnpm format` to format all files ## Describing changes diff --git a/.github/workflows/README.md b/.github/workflows/README.md new file mode 100644 index 00000000000..4595265e6fb --- /dev/null +++ b/.github/workflows/README.md @@ -0,0 +1,38 @@ +# TypeSpec Workflows + +This directory contains the GitHub workflows used for TypeSpec repository CI/CD processes. + +## Available Workflows + +| Workflow | Description | +| -------------------------- | ---------------------------------------------------------------------------------- | +| `consistency.yml` | Ensures code consistency, including changelog, spellcheck, formatting, and linting | +| `codeql.yml` | Runs CodeQL analysis for code security | +| `external-integration.yml` | Optional CI check that verifies compatibility with Azure/typespec-azure repository | + +## TypeSpec-Azure Integration Check + +The `external-integration.yml` workflow verifies that changes in the TypeSpec repository do not break compatibility with the Azure/typespec-azure repository, which depends on TypeSpec as a core dependency. + +### How It Works + +1. Clones the Azure/typespec-azure repository +2. Finds the "core" submodule that references microsoft/typespec +3. Updates that submodule to use the changes from the current PR +4. Runs the build and tests for the Azure/typespec-azure repository + +### When It Runs + +This check runs on: + +- Pull requests to the main branch +- Manual triggers via workflow_dispatch + +### What It Checks + +- Whether the Azure/typespec-azure repository can build successfully with the changes from the PR +- Whether all tests in the Azure/typespec-azure repository pass with the changes + +### Configuration + +This is an optional check that won't block PRs from being merged. It only runs on Linux with Node LTS (24.x) to minimize resource usage while still catching compatibility issues. diff --git a/.github/workflows/external-integration.yml b/.github/workflows/external-integration.yml new file mode 100644 index 00000000000..0371553b3f8 --- /dev/null +++ b/.github/workflows/external-integration.yml @@ -0,0 +1,67 @@ +name: Integration + +on: + pull_request: + branches: ["main"] + paths-ignore: + - "packages/http-client-csharp/**" + - "packages/http-client-java/**" + - "packages/http-client-python/**" + - "website/**" + # Allow manual triggering + workflow_dispatch: + +# This check is optional by default +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + azure-integration-check: + name: Azure/typespec-azure + runs-on: ubuntu-latest + # Only run if not from dependabot, publish, backmerge, or revert branches + if: | + !startsWith(github.head_ref, 'dependabot/') && + !startsWith(github.head_ref, 'publish/') && + !startsWith(github.head_ref, 'backmerge/') && + !startsWith(github.head_ref, 'revert-') + + steps: + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 24.x # Using current LTS + + - name: Checkout Azure/typespec-azure repo + uses: actions/checkout@v4 + with: + repository: Azure/typespec-azure + submodules: true + + - name: Install pnpm + uses: pnpm/action-setup@v3 + + - name: Update core submodule to PR commit + run: | + # Configure git to use the PR's repository as a remote for the submodule + cd core + git remote add pr https://github.com/${{ github.repository }}.git + git fetch pr ${{ github.event.pull_request.head.sha }} + # Update the submodule to point to the PR commit + git checkout ${{ github.event.pull_request.head.sha }} + + - name: Install + run: pnpm install + + - name: Install Playwright + run: pnpm exec playwright install + + - name: Build + run: pnpm build + + - name: Test + run: pnpm test + + - name: E2E Test + run: pnpm test:e2e