diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml
index ba28e44a..4f3b3a81 100644
--- a/.github/workflows/pr.yml
+++ b/.github/workflows/pr.yml
@@ -9,7 +9,7 @@ env:
jobs:
- prepare-env:
+ setup:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
@@ -28,18 +28,41 @@ jobs:
if: steps.cache.outputs.cache-hit != 'true'
run: yarn install
- pr:
- needs: prepare-env
+ - name: Derive appropriate SHAs for base and head for `nx affected` commands
+ uses: ./actions/set-shas
+ with:
+ main-branch-name: master
+
+ - name: Plan
+ id: plan
+ uses: ./actions/plan
+ with:
+ targets: |
+ test
+ build
+ e2e
+
+ testMaxJobs: 1
+
+ buildMaxJobs: 2
+
+ e2eMaxJobs: 2
+
+ distributed-task:
+ name: Distributed ${{ matrix.target }} ${{ matrix.index }}/${{ matrix.count }}
+ needs:
+ - setup
runs-on: ubuntu-latest
+ if: needs.setup.outputs.hasPlan == 'true'
strategy:
fail-fast: false
- matrix:
- target: [ 'build', 'e2e' , 'test']
+ matrix: ${{ fromJSON(needs.setup.outputs.matrix) }}
+
steps:
- - name: Use Node.js ${{ matrix.node-version }}
+ - name: Set up Node
uses: actions/setup-node@v4
with:
- node-version: 20.x
+ node-version: 20.10
- uses: actions/checkout@v4
with:
@@ -73,4 +96,28 @@ jobs:
uses: ./actions/run-many
with:
target: ${{ matrix.target }}
- parallel: 1
+ index: ${{ matrix.index }}
+ count: ${{ matrix.count }}
+ tag: ${{ matrix.tag }}
+ parallel: ${{ matrix.parallel }}
+
+ # So we can add branch protection that this one is required
+ distributed-check:
+ name: Distributed check
+ runs-on: ubuntu-latest
+ needs:
+ - distributed-task
+ if: |
+ !cancelled()
+ steps:
+ - name: Check
+ if: |
+ !contains(needs.*.result, 'failure') &&
+ !contains(needs.*.result, 'cancelled')
+ run: echo "Ok"
+
+ - name: Fail
+ if: |
+ contains(needs.*.result, 'failure') ||
+ contains(needs.*.result, 'cancelled')
+ run: exit 1
diff --git a/actions/plan/dist/nx.darwin-arm64.node b/actions/plan/dist/nx.darwin-arm64.node
deleted file mode 100644
index 693ea74c..00000000
Binary files a/actions/plan/dist/nx.darwin-arm64.node and /dev/null differ
diff --git a/actions/plan/dist/register.js b/actions/plan/dist/register.js
deleted file mode 100644
index 4f68e67d..00000000
--- a/actions/plan/dist/register.js
+++ /dev/null
@@ -1 +0,0 @@
-require('./').install();
diff --git a/actions/plan/dist/src/plan.d.ts b/actions/plan/dist/src/plan.d.ts
deleted file mode 100644
index cb0ff5c3..00000000
--- a/actions/plan/dist/src/plan.d.ts
+++ /dev/null
@@ -1 +0,0 @@
-export {};
diff --git a/actions/plan/dist/src/utils/exec.d.ts b/actions/plan/dist/src/utils/exec.d.ts
deleted file mode 100644
index 1d4d0991..00000000
--- a/actions/plan/dist/src/utils/exec.d.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-///
-import { ChildProcess } from 'child_process';
-import type { ExecOptions, ShellString } from 'shelljs';
-export interface Options extends ExecOptions {
- asString?: boolean;
- asJSON?: boolean;
-}
-export { ShellString, ChildProcess };
-export type Result