Skip to content

Commit

Permalink
Merge branch 'master' into releases/june
Browse files Browse the repository at this point in the history
  • Loading branch information
aliemir committed May 18, 2024
2 parents a18b36f + 2e0c498 commit 1926944
Show file tree
Hide file tree
Showing 244 changed files with 17,038 additions and 56,234 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-example-chunks.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const BASE_REF = process.env.BASE_REF ? process.env.BASE_REF : "master";
const BUILD_ALL_EXAMPLES = process.env.BUILD_ALL_EXAMPLES === "true";

const getChangedPackages = () => {
const p = require.resolve("lerna/cli.js");
const p = require.resolve("lerna/dist/cli.js");

const output = execSync(`node ${p} ls --since origin/${BASE_REF} --json`, {
stdio: "pipe",
Expand Down
333 changes: 333 additions & 0 deletions .github/workflows/build-examples.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,333 @@
name: Build All Examples

on:
pull_request:
paths:
- "packages/**"
- "examples/**"
types:
- labeled
- synchronize
- opened
- reopened
- ready_for_review
push:
branches:
- master
schedule:
- cron: "0 6 * * *"
workflow_dispatch:
inputs:
environment:
description: "Environment to run tests against"
type: environment
required: false

jobs:
chunks:
runs-on: ubuntu-latest
concurrency:
group: ${{ github.ref }}-build-examples
cancel-in-progress: true
strategy:
matrix:
node-version: [18.x]

name: Create Example Chunks

if: "${{ !github.event.pull_request.draft }}"

outputs:
CHUNK_1: ${{ steps.chunkstep.outputs.CHUNK_1 }}
CHUNK_2: ${{ steps.chunkstep.outputs.CHUNK_2 }}
CHUNK_3: ${{ steps.chunkstep.outputs.CHUNK_3 }}
CHUNK_4: ${{ steps.chunkstep.outputs.CHUNK_4 }}
CHUNK_5: ${{ steps.chunkstep.outputs.CHUNK_5 }}
CHUNK_6: ${{ steps.chunkstep.outputs.CHUNK_6 }}

steps:
- name: Get PR labels
id: pr-labels
uses: joerick/[email protected]
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
with:
version: 9
run_install: |
- recursive: false
args: [--ignore-scripts]
- name: Fetch commits
run: git fetch origin ${{ github.base_ref || 'master' }} --depth=1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "pnpm"

- name: Split Into Chunks
id: chunkstep
run: CHUNKS=6 BASE_REF=${{ github.base_ref }} BUILD_ALL_EXAMPLES=${{ (contains(steps.pr-labels.outputs.labels, ' build-examples ') || github.event_name == 'schedule' ) && 'true' || 'false' }} node ./.github/workflows/build-example-chunks.js

build-chunk-1:
runs-on: ubuntu-latest
if: "${{ needs.chunks.outputs.CHUNK_1 != '' }}"
concurrency:
group: ${{ github.ref }}-build-examples-chunk-1
cancel-in-progress: true
strategy:
matrix:
node-version: [18.x]

name: Build All Examples (Chunk 1)

needs: chunks

steps:
- name: Get PR labels
id: pr-labels
uses: joerick/[email protected]
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
with:
version: 9

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "pnpm"

- name: Install Dependencies
run: |
pnpm install --ignore-scripts
pnpm cypress install
- name: Build
run: REFINE_NO_TELEMETRY=true pnpm build --no-bail --scope={${{ needs.chunks.outputs.CHUNK_1 }}}

- name: Get short SHA
id: slug
run: echo "::set-output name=sha7::$(echo ${GITHUB_SHA} | cut -c1-7)"

- name: Run E2E Tests
run: BASE_REF=${{ github.base_ref }} EXAMPLES=${{ needs.chunks.outputs.CHUNK_1 }} CYPRESS_PROJECT_ID=${{ secrets.CYPRESS_PROJECT_ID }} CYPRESS_RECORD_KEY=${{ secrets.CYPRESS_RECORD_KEY }} CI_BUILD_ID=refine-${{ github.ref_name }}-${{ steps.slug.outputs.sha7 }}-chunk-1-${{ github.run_attempt }} node ./.github/workflows/e2e-examples.js

build-chunk-2:
runs-on: ubuntu-latest
if: "${{ needs.chunks.outputs.CHUNK_2 != '' }}"
concurrency:
group: ${{ github.ref }}-build-examples-chunk-2
cancel-in-progress: true
strategy:
matrix:
node-version: [18.x]

name: Build All Examples (Chunk 2)

needs: chunks

steps:
- name: Get PR labels
id: pr-labels
uses: joerick/[email protected]
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
with:
version: 9

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "pnpm"

- name: Install Dependencies
run: |
pnpm install --ignore-scripts
pnpm cypress install
- name: Build
run: REFINE_NO_TELEMETRY=true pnpm build --no-bail --scope={${{ needs.chunks.outputs.CHUNK_2 }}}

- name: Get short SHA
id: slug
run: echo "::set-output name=sha7::$(echo ${GITHUB_SHA} | cut -c1-7)"

- name: Run E2E Tests
run: REFINE_NO_TELEMETRY=true BASE_REF=${{ github.base_ref }} EXAMPLES=${{ needs.chunks.outputs.CHUNK_2 }} CYPRESS_PROJECT_ID=${{ secrets.CYPRESS_PROJECT_ID }} CYPRESS_RECORD_KEY=${{ secrets.CYPRESS_RECORD_KEY }} CI_BUILD_ID=refine-${{ github.ref_name }}-${{ steps.slug.outputs.sha7 }}-chunk-2-${{ github.run_attempt }} node ./.github/workflows/e2e-examples.js

build-chunk-3:
runs-on: ubuntu-latest
if: "${{ needs.chunks.outputs.CHUNK_3 != '' }}"
concurrency:
group: ${{ github.ref }}-build-examples-chunk-3
cancel-in-progress: true
strategy:
matrix:
node-version: [18.x]

name: Build All Examples (Chunk 3)

needs: chunks

steps:
- name: Get PR labels
id: pr-labels
uses: joerick/[email protected]
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
with:
version: 9

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "pnpm"

- name: Install Dependencies
run: |
pnpm install --ignore-scripts
pnpm cypress install
- name: Build
run: REFINE_NO_TELEMETRY=true pnpm build --no-bail --scope={${{ needs.chunks.outputs.CHUNK_3 }}}

- name: Get short SHA
id: slug
run: echo "::set-output name=sha7::$(echo ${GITHUB_SHA} | cut -c1-7)"

- name: Run E2E Tests
run: BASE_REF=${{ github.base_ref }} EXAMPLES=${{ needs.chunks.outputs.CHUNK_3 }} CYPRESS_PROJECT_ID=${{ secrets.CYPRESS_PROJECT_ID }} CYPRESS_RECORD_KEY=${{ secrets.CYPRESS_RECORD_KEY }} CI_BUILD_ID=refine-${{ github.ref_name }}-${{ steps.slug.outputs.sha7 }}-chunk-3-${{ github.run_attempt }} node ./.github/workflows/e2e-examples.js

build-chunk-4:
runs-on: ubuntu-latest
if: "${{ needs.chunks.outputs.CHUNK_4 != '' }}"
concurrency:
group: ${{ github.ref }}-build-examples-chunk-4
cancel-in-progress: true
strategy:
matrix:
node-version: [18.x]

name: Build All Examples (Chunk 4)

needs: chunks

steps:
- name: Get PR labels
id: pr-labels
uses: joerick/[email protected]
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
with:
version: 9

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "pnpm"

- name: Install Dependencies
run: |
pnpm install --ignore-scripts
pnpm cypress install
- name: Build
run: REFINE_NO_TELEMETRY=true pnpm build --no-bail --scope={${{ needs.chunks.outputs.CHUNK_4 }}}

- name: Get short SHA
id: slug
run: echo "::set-output name=sha7::$(echo ${GITHUB_SHA} | cut -c1-7)"

- name: Run E2E Tests
run: BASE_REF=${{ github.base_ref }} EXAMPLES=${{ needs.chunks.outputs.CHUNK_4 }} CYPRESS_PROJECT_ID=${{ secrets.CYPRESS_PROJECT_ID }} CYPRESS_RECORD_KEY=${{ secrets.CYPRESS_RECORD_KEY }} CI_BUILD_ID=refine-${{ github.ref_name }}-${{ steps.slug.outputs.sha7 }}-chunk-4-${{ github.run_attempt }}-4 node ./.github/workflows/e2e-examples.js

build-chunk-5:
runs-on: ubuntu-latest
if: "${{ needs.chunks.outputs.CHUNK_5 != '' }}"
concurrency:
group: ${{ github.ref }}-build-examples-chunk-5
cancel-in-progress: true
strategy:
matrix:
node-version: [18.x]

name: Build All Examples (Chunk 5)

needs: chunks

steps:
- name: Get PR labels
id: pr-labels
uses: joerick/[email protected]
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
with:
version: 9

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "pnpm"

- name: Install Dependencies
run: |
pnpm install --ignore-scripts
pnpm cypress install
- name: Build
run: REFINE_NO_TELEMETRY=true pnpm build --no-bail --scope={${{ needs.chunks.outputs.CHUNK_5 }}}

- name: Get short SHA
id: slug
run: echo "::set-output name=sha7::$(echo ${GITHUB_SHA} | cut -c1-7)"

- name: Run E2E Tests
run: BASE_REF=${{ github.base_ref }} EXAMPLES=${{ needs.chunks.outputs.CHUNK_5 }} CYPRESS_PROJECT_ID=${{ secrets.CYPRESS_PROJECT_ID }} CYPRESS_RECORD_KEY=${{ secrets.CYPRESS_RECORD_KEY }} CI_BUILD_ID=refine-${{ github.ref_name }}-${{ steps.slug.outputs.sha7 }}-chunk-5-${{ github.run_attempt }} node ./.github/workflows/e2e-examples.js

build-chunk-6:
runs-on: ubuntu-latest
if: "${{ needs.chunks.outputs.CHUNK_6 != '' }}"
concurrency:
group: ${{ github.ref }}-build-examples-chunk-6
cancel-in-progress: true
strategy:
matrix:
node-version: [18.x]

name: Build All Examples (Chunk 6)

needs: chunks

steps:
- name: Get PR labels
id: pr-labels
uses: joerick/[email protected]
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
with:
version: 9

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "pnpm"

- name: Install Dependencies
run: |
pnpm install --ignore-scripts
pnpm cypress install
- name: Build
run: REFINE_NO_TELEMETRY=true pnpm build --no-bail --scope={${{ needs.chunks.outputs.CHUNK_6 }}}

- name: Get short SHA
id: slug
run: echo "::set-output name=sha7::$(echo ${GITHUB_SHA} | cut -c1-7)"

- name: Run E2E Tests
run: BASE_REF=${{ github.base_ref }} EXAMPLES=${{ needs.chunks.outputs.CHUNK_6 }} CYPRESS_PROJECT_ID=${{ secrets.CYPRESS_PROJECT_ID }} CYPRESS_RECORD_KEY=${{ secrets.CYPRESS_RECORD_KEY }} CI_BUILD_ID=refine-${{ github.ref_name }}-${{ steps.slug.outputs.sha7 }}-chunk-6-${{ github.run_attempt }} node ./.github/workflows/e2e-examples.js
Loading

0 comments on commit 1926944

Please sign in to comment.