Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Setup
description: pnpm + node + install, with optional Turbo cache. Run after checkout.
inputs:
node-version:
description: Override node version; empty uses .nvmrc
default: ''
registry-url:
description: npm registry URL (release jobs only)
default: ''
turbo-cache:
description: Restore/save the .turbo cache (build jobs only)
default: 'false'
runs:
using: composite
steps:
- uses: pnpm/action-setup@v6

- uses: actions/setup-node@v6
with:
node-version: ${{ inputs.node-version }}
node-version-file: ${{ inputs.node-version == '' && '.nvmrc' || '' }}
registry-url: ${{ inputs.registry-url }}
cache: pnpm

- name: Install
run: pnpm install --frozen-lockfile
shell: bash

- name: Cache turbo
if: ${{ inputs.turbo-cache == 'true' }}
uses: actions/cache@v5
with:
path: .turbo
key: ${{ runner.os }}-turbo-${{ github.sha }}
restore-keys: |
${{ runner.os }}-turbo-
15 changes: 2 additions & 13 deletions .github/workflows/bundle-size.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ on:
branches:
- main

env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}

concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true
Expand All @@ -22,16 +18,9 @@ jobs:
- name: Checkout repo
uses: actions/checkout@v6

- name: Setup pnpm
uses: pnpm/action-setup@v6

- uses: actions/setup-node@v6
- uses: ./.github/actions/setup
with:
node-version-file: '.nvmrc'
cache: 'pnpm'

- name: Install
run: pnpm install --frozen-lockfile
turbo-cache: 'true'

- name: Build packages
run: pnpm build --filter=!@react-spring/docs
Expand Down
16 changes: 1 addition & 15 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ on:
- 'main'
pull_request: {}

env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}

concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true
Expand All @@ -27,17 +23,7 @@ jobs:
- name: Checkout repo
uses: actions/checkout@v6

- name: Setup pnpm
uses: pnpm/action-setup@v6

- name: Setup node
uses: actions/setup-node@v6
with:
node-version-file: '.nvmrc'
cache: 'pnpm'

- name: Install
run: pnpm install --frozen-lockfile
- uses: ./.github/actions/setup

- name: Lint
run: pnpm lint
Expand Down
15 changes: 2 additions & 13 deletions .github/workflows/experimental.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ name: 'Experimental Releases'
on:
workflow_dispatch:

env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}

concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true
Expand All @@ -30,16 +26,9 @@ jobs:
- name: Setup npmrc
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> .npmrc

- name: Setup pnpm
uses: pnpm/action-setup@v6

- uses: actions/setup-node@v6
- uses: ./.github/actions/setup
with:
node-version-file: '.nvmrc'
cache: 'pnpm'

- name: Install
run: pnpm install --frozen-lockfile
turbo-cache: 'true'

- name: Build
run: pnpm build-ci
Expand Down
17 changes: 2 additions & 15 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ on:
schedule:
- cron: '0 0 * * *'

env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}

concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true
Expand Down Expand Up @@ -53,19 +49,10 @@ jobs:
exit 0
fi

- name: Setup pnpm
if: steps.version.outputs.NEXT_VERSION
uses: pnpm/action-setup@v6

- uses: actions/setup-node@v6
- uses: ./.github/actions/setup
if: steps.version.outputs.NEXT_VERSION
with:
node-version-file: '.nvmrc'
cache: 'pnpm'

- name: Install
if: steps.version.outputs.NEXT_VERSION
run: pnpm install --frozen-lockfile
turbo-cache: 'true'

- name: Build
if: steps.version.outputs.NEXT_VERSION
Expand Down
16 changes: 2 additions & 14 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ on:
- 'next'
workflow_dispatch:

env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}

concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: false
Expand All @@ -31,23 +27,15 @@ jobs:
with:
fetch-depth: 0

- name: Setup pnpm
uses: pnpm/action-setup@v6

- name: Setup node
uses: actions/setup-node@v6
- uses: ./.github/actions/setup
with:
node-version-file: '.nvmrc'
cache: 'pnpm'
registry-url: 'https://registry.npmjs.org'
turbo-cache: 'true'

# npm Trusted Publishing requires npm >= 11.5.1; Node 22 LTS still ships npm 10.x
- name: Upgrade npm
run: npm install -g npm@latest

- name: Install
run: pnpm install --frozen-lockfile

- name: Build
run: pnpm build-ci

Expand Down
60 changes: 9 additions & 51 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ on:
- 'main'
pull_request: {}

env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}

concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true
Expand All @@ -35,6 +31,7 @@ jobs:
- 'vitest.config.ts'
- '.github/publish-ci/**/package-lock.json'
- '.github/workflows/*.yml'
- '.github/actions/**'
- 'package.json'
build:
needs: changes
Expand All @@ -46,17 +43,9 @@ jobs:
- name: Checkout repo
uses: actions/checkout@v6

- name: Setup pnpm
uses: pnpm/action-setup@v6

- name: Setup node
uses: actions/setup-node@v6
- uses: ./.github/actions/setup
with:
node-version-file: '.nvmrc'
cache: 'pnpm'

- name: Install
run: pnpm install --frozen-lockfile
turbo-cache: 'true'

- name: Build
run: pnpm build-ci --filter=!@react-spring/docs
Expand Down Expand Up @@ -96,7 +85,7 @@ jobs:

test-unit:
name: 'Test:unit'
needs: [build]
needs: [changes]
if: ${{ needs.changes.outputs.packages == 'true' }}
runs-on: ubuntu-latest
strategy:
Expand All @@ -107,20 +96,9 @@ jobs:
- name: Checkout repo
uses: actions/checkout@v6

- name: Setup pnpm
uses: pnpm/action-setup@v6

- name: Setup node ${{ matrix.node }}
uses: actions/setup-node@v6
- uses: ./.github/actions/setup
with:
node-version: ${{ matrix.node }}
cache: 'pnpm'

- name: Install
run: pnpm install --frozen-lockfile

- name: Build
run: pnpm build-ci

- name: Cache Playwright browsers
uses: actions/cache@v5
Expand All @@ -136,7 +114,7 @@ jobs:

test-types:
name: 'Test:types with TS ${{ matrix.ts }}'
needs: [build]
needs: [changes]
if: ${{ needs.changes.outputs.packages == 'true' }}
runs-on: ubuntu-latest
strategy:
Expand All @@ -147,17 +125,7 @@ jobs:
- name: Checkout repo
uses: actions/checkout@v6

- name: Setup pnpm
uses: pnpm/action-setup@v6

- name: Setup node
uses: actions/setup-node@v6
with:
node-version-file: '.nvmrc'
cache: 'pnpm'

- name: Install
run: pnpm install --frozen-lockfile
- uses: ./.github/actions/setup

- name: Install TypeScript ${{ matrix.ts }}
run: pnpm add -w typescript@${{ matrix.ts }}
Expand All @@ -171,7 +139,7 @@ jobs:
pnpm test:ts

test-e2e:
needs: [build]
needs: [changes]
if: ${{ needs.changes.outputs.packages == 'true' }}
name: 'Test:E2E'
runs-on: ubuntu-latest
Expand All @@ -180,17 +148,7 @@ jobs:
- name: Checkout repo
uses: actions/checkout@v6

- name: Setup pnpm
uses: pnpm/action-setup@v6

- name: Setup node
uses: actions/setup-node@v6
with:
node-version: '24.16.0'
cache: 'pnpm'

- name: Install
run: pnpm install --frozen-lockfile
- uses: ./.github/actions/setup

- name: Cache Playwright browsers
uses: actions/cache@v5
Expand Down
2 changes: 1 addition & 1 deletion turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"build": {
"outputs": ["dist/**", "public/build/**", "api/**"],
"dependsOn": ["^build"],
"inputs": ["src/**/*.tsx", "src/**/*.ts", "../../tsup.config.base.ts"]
"inputs": ["src/**/*.tsx", "src/**/*.ts", "../../tsdown.config.base.mjs"]
},
"pack": {}
}
Expand Down
Loading