85 lines
2.7 KiB
YAML
85 lines
2.7 KiB
YAML
name: PR
|
|
|
|
on:
|
|
pull_request:
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
env:
|
|
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
|
|
|
|
permissions: {}
|
|
|
|
jobs:
|
|
test:
|
|
name: Test
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
pull-requests: write
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
fetch-depth: 0
|
|
persist-credentials: false
|
|
- name: Start Nx Agents
|
|
run: npx nx-cloud start-ci-run --distribute-on=".nx/workflows/dynamic-changesets.yaml"
|
|
- name: Setup Tools
|
|
uses: TanStack/config/.github/setup@e4b48f16568324f76f467aa4c2aac2f05db632c3
|
|
- name: Get base and head commits for `nx affected`
|
|
uses: nrwl/nx-set-shas@3e9ad7370203c1e93d109be57f3b72eb0eb511b1 # v4.4.0
|
|
with:
|
|
main-branch-name: main
|
|
- name: Run Checks
|
|
run: pnpm run test:pr
|
|
- name: Stop Nx Agents
|
|
if: ${{ always() }}
|
|
run: npx nx-cloud stop-all-agents
|
|
preview:
|
|
name: Preview
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
pull-requests: write
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
persist-credentials: false
|
|
- name: Setup Tools
|
|
uses: TanStack/config/.github/setup@e4b48f16568324f76f467aa4c2aac2f05db632c3
|
|
- name: Build Packages
|
|
run: pnpm run build:all
|
|
- name: Publish Previews
|
|
run: pnpx pkg-pr-new publish --pnpm --compact './packages/*' --template './examples/*/*'
|
|
- name: Determine commit SHA
|
|
id: determine-sha
|
|
run: echo "COMMIT_SHA=${COMMIT_SHA}" >> "$GITHUB_ENV"
|
|
env:
|
|
COMMIT_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
|
|
- name: Size Limit
|
|
uses: andresz1/size-limit-action@94bc357df29c36c8f8d50ea497c3e225c3c95d1d
|
|
with:
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
skip_step: install
|
|
build_script: build:all
|
|
version-preview:
|
|
name: Version Preview
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
pull-requests: write
|
|
issues: write
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
persist-credentials: false
|
|
- name: Setup Tools
|
|
uses: TanStack/config/.github/setup@e4b48f16568324f76f467aa4c2aac2f05db632c3
|
|
- name: Changeset Preview
|
|
uses: TanStack/config/.github/changeset-preview@e4b48f16568324f76f467aa4c2aac2f05db632c3
|