Skip to content

Consolidate CI workflows #4

Consolidate CI workflows

Consolidate CI workflows #4

Workflow file for this run

name: CI
on:
pull_request:
push:
branches:
- main
permissions:
contents: read
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: CI Setup
uses: ./.github/actions/ci-setup
- name: Build packages
run: pnpm --filter "@radix-ui/*" build
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: build-output
path: packages/*/dist
retention-days: 1
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: CI Setup
uses: ./.github/actions/ci-setup
- name: Lint
run: pnpm --filter "@radix-ui/*" lint
format:
name: Check Formatting
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: CI Setup
uses: ./.github/actions/ci-setup
- name: Run formatter
run: pnpm format
- name: Check for changes
run: |
if [[ -n $(git status --porcelain) ]]; then
echo "::error::Files are not properly formatted. Please run 'pnpm format' locally and commit the changes."
echo ""
echo "The following files need formatting:"
git status --porcelain
echo ""
echo "Diff:"
git diff
exit 1
fi
test-vr:
name: 'Tests: Visual regression'
needs: build
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: CI Setup
uses: ./.github/actions/ci-setup
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: build-output
- name: Install Playwright Browsers
run: pnpm --filter "playground" exec playwright install --with-deps
- name: Run Visual Regression Tests
run: pnpm test:vr
- name: Upload test results
if: failure()
uses: actions/upload-artifact@v4
with:
name: playwright-report
path: apps/playground/test-results/
retention-days: 30