-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
64e2efb
commit 4efe1a4
Showing
4 changed files
with
196 additions
and
207 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
name: 'Common' | ||
description: 'Run the common steps' | ||
inputs: | ||
node-version: | ||
description: 'Node.js version' | ||
required: true | ||
type: string | ||
runner: | ||
description: 'Runner' | ||
required: true | ||
type: string | ||
isBuild: | ||
description: 'Whether to build the project' | ||
required: false | ||
default: 'false' | ||
type: boolean | ||
runs: | ||
using: 'composite' | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: pnpm/action-setup@v4 | ||
|
||
- name: Use Node.js ${{ inputs.node-version }} | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ inputs.node-version }} | ||
cache: 'pnpm' | ||
|
||
# Cargo already skips downloading dependencies if they already exist | ||
- name: Cache cargo | ||
uses: actions/cache@v4 | ||
with: | ||
path: | | ||
~/.cargo/bin/ | ||
~/.cargo/registry/index/ | ||
~/.cargo/registry/cache/ | ||
~/.cargo/git/db/ | ||
target/ | ||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | ||
|
||
# Cache the `oxide` Rust build | ||
- name: Cache oxide build | ||
uses: actions/cache@v4 | ||
with: | ||
path: | | ||
./target/ | ||
./crates/node/*.node | ||
./crates/node/index.js | ||
./crates/node/index.d.ts | ||
key: ${{ runner.os }}-oxide-${{ hashFiles('./crates/**/*') }} | ||
|
||
- name: Install dependencies | ||
run: pnpm install | ||
|
||
- name: Build | ||
run: pnpm run build | ||
if: ${{ inputs.isBuild == 'true' }} | ||
|
||
- name: Upload build artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: build-artifacts-${{ inputs.runner }}-${{ inputs.node-version }} | ||
path: | | ||
target/ | ||
crates/ | ||
dist/ | ||
packages/**/dist/ | ||
if: ${{ inputs.isBuild == 'true' }} | ||
|
||
|
||
- name: Download build artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: build-artifacts-${{ inputs.runner }}-${{ inputs.node-version }} | ||
if: ${{ inputs.isBuild == 'false' }} |
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,110 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: [next] | ||
pull_request: | ||
workflow_call: | ||
inputs: | ||
node-version: | ||
description: 'Node.js version' | ||
required: true | ||
default: '20' | ||
type: string | ||
runner: | ||
description: 'Runner' | ||
required: true | ||
default: 'ubuntu-latest' | ||
type: string | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
version-matrix: | ||
build: | ||
runs-on: ${{ inputs.runner }} | ||
steps: | ||
- name: Common | ||
uses: ./.github/actions/common | ||
with: | ||
runner: ${{ inputs.runner }} | ||
node-version: ${{ inputs.node-version }} | ||
isBuild: true | ||
|
||
lint: | ||
# Only lint on linux to avoid \r\n line ending errors | ||
if: inputs.runner == 'ubuntu-latest' | ||
needs: build | ||
runs-on: ${{ inputs.runner }} | ||
steps: | ||
- name: Common | ||
uses: ./.github/actions/common | ||
with: | ||
runner: ${{ inputs.runner }} | ||
node-version: ${{ inputs.node-version }} | ||
|
||
- name: Lint | ||
run: pnpm run lint | ||
|
||
test: | ||
needs: build | ||
runs-on: ${{ inputs.runner }} | ||
steps: | ||
- name: Common | ||
uses: ./.github/actions/common | ||
with: | ||
runner: ${{ inputs.runner }} | ||
node-version: ${{ inputs.node-version }} | ||
|
||
- name: Test | ||
run: pnpm run test | ||
|
||
integration-tests: | ||
needs: build | ||
runs-on: ${{ inputs.runner }} | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
node-version: [20] | ||
runner: [ubuntu-latest, windows-latest, macos-14] | ||
uses: ./.github/workflows/ci-common.yml | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
runner: ${{ matrix.runner }} | ||
secrets: inherit | ||
integration: | ||
- cli/index | ||
- cli/config | ||
- cli/plugins | ||
- cli/upgrade | ||
- postcss/index | ||
- postcss/config | ||
- postcss/core-as-postcss-plugin | ||
- postcss/next | ||
- vite/index | ||
- vite/config | ||
- vite/astro | ||
- vite/vue | ||
- vite/nuxt | ||
- vite/css-modules | ||
|
||
steps: | ||
- name: Common | ||
uses: ./.github/actions/common | ||
with: | ||
runner: ${{ inputs.runner }} | ||
node-version: ${{ inputs.node-version }} | ||
|
||
# https://github.com/actions/download-artifact/issues/14 | ||
- name: Fix permissions for executable files in packages/@tailwindcss-standalone/dist/ | ||
run: chmod +x packages/@tailwindcss-standalone/dist/* | ||
|
||
- name: Integration Tests | ||
run: pnpm run test:integrations ${{ matrix.integration }} | ||
|
||
playwright: | ||
needs: build | ||
runs-on: ${{ inputs.runner }} | ||
steps: | ||
- name: Common | ||
uses: ./.github/actions/common | ||
with: | ||
runner: ${{ inputs.runner }} | ||
node-version: ${{ inputs.node-version }} | ||
|
||
- name: Install Playwright Browsers | ||
run: npx playwright install --with-deps | ||
|
||
- name: Run Playwright tests | ||
run: npm run test:ui |
Oops, something went wrong.