CI #11481
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read # for checkout | |
| jobs: | |
| knip: | |
| runs-on: ubuntu-latest | |
| name: Knip | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: pnpm/action-setup@v6 | |
| - uses: actions/setup-node@v7 | |
| with: | |
| node-version: lts/* | |
| - run: pnpm install | |
| - run: pnpm knip --reporter github-actions | |
| build: | |
| runs-on: ubuntu-latest | |
| name: Lint & Build | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: pnpm/action-setup@v6 | |
| - uses: actions/setup-node@v7 | |
| with: | |
| node-version: lts/* | |
| - run: pnpm install | |
| - run: pnpm lint --deny-warnings --format github | |
| - run: pnpm build | |
| - run: pnpm typecheck | |
| playground: | |
| runs-on: ubuntu-latest | |
| name: Playground builds | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: pnpm/action-setup@v6 | |
| - uses: actions/setup-node@v7 | |
| with: | |
| node-version: lts/* | |
| - run: pnpm install | |
| - run: pnpm build | |
| - run: pnpm playground:typecheck | |
| - run: pnpm playground:build | |
| env: | |
| NODE_OPTIONS: --max_old_space_size=8192 | |
| css-playground: | |
| runs-on: ubuntu-latest | |
| name: CSS Playground smoke tests | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: pnpm/action-setup@v6 | |
| - uses: actions/setup-node@v7 | |
| with: | |
| node-version: lts/* | |
| - uses: denoland/setup-deno@v2 | |
| with: | |
| deno-version: 2.9.6 | |
| - uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - run: pnpm install | |
| # Build the packages (so the `pkg` CLI is available) and the producer package. | |
| - run: pnpm build | |
| - run: pnpm --filter sanity-css-vanilla-extract-test build | |
| # Run each consumer's smoke command (build/test/run). Serialized to keep memory in check across | |
| # the heavier framework builds. The goal is only to assert nothing crashes on the | |
| # self-referential `bundle.css` import - CSS correctness is verified downstream. | |
| - run: pnpm --workspace-concurrency=1 --filter "./css-playground/**" test | |
| env: | |
| NODE_OPTIONS: --max_old_space_size=8192 | |
| integration: | |
| runs-on: ubuntu-latest | |
| name: Sanity Studio integration tests | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: pnpm/action-setup@v6 | |
| - uses: actions/setup-node@v7 | |
| with: | |
| node-version: lts/* | |
| - run: pnpm install | |
| - run: pnpm integration:typecheck | |
| # Runs the studio fixture through `sanity dev` / `sanity build` / `sanity schema extract` | |
| # with @sanity/vanilla-extract-vite-plugin and with @vanilla-extract/vite-plugin as the | |
| # reference, comparing output across the identifier/cssMinify/cssTarget matrix. | |
| - run: pnpm integration:test | |
| env: | |
| NODE_OPTIONS: --max_old_space_size=8192 | |
| test: | |
| runs-on: ${{ matrix.platform }} | |
| name: Node.js ${{ matrix.node-version }} / ${{ matrix.platform }} | |
| strategy: | |
| # A test failing on windows doesn't mean it'll fail on macos. It's useful to let all tests run to its completion to get the full picture | |
| fail-fast: false | |
| matrix: | |
| # Run the testing suite on each major OS with the latest LTS release of Node.js | |
| platform: [macos-latest, ubuntu-latest, windows-latest] | |
| node-version: [lts/*] | |
| # It makes sense to also test latest version of Node.js, on ubuntu-only since it's the fastest CI runner | |
| # @TODO re-enable after the nightly is stable | |
| # include: | |
| # - platform: ubuntu-latest | |
| # Test the actively developed version that will become the latest LTS release next October | |
| # node-version: current | |
| steps: | |
| - name: Set git to use LF | |
| if: matrix.platform == 'windows-latest' | |
| run: | | |
| git config --global core.autocrlf false | |
| git config --global core.eol lf | |
| - uses: actions/checkout@v7 | |
| - uses: pnpm/action-setup@v6 | |
| - uses: actions/setup-node@v7 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| - run: pnpm install | |
| - run: pnpm build | |
| - run: pnpm test |