|
6 | 6 | pull_request: |
7 | 7 |
|
8 | 8 | env: |
9 | | - NX_CLOUD_DISTRIBUTED_EXECUTION: ${{ !contains(github.event.pull_request.user.login, 'dependabot') }} |
10 | 9 | NX_CLOUD_AUTH_TOKEN: ${{ secrets.NX_CLOUD_TOKEN }} |
11 | 10 |
|
12 | 11 | jobs: |
13 | 12 | main: |
14 | 13 | runs-on: ubuntu-latest |
15 | | - if: ${{ github.event_name != 'pull_request' }} |
16 | 14 | steps: |
17 | | - - uses: actions/checkout@v2 |
| 15 | + - uses: actions/checkout@v6 |
18 | 16 | name: Checkout [main] |
19 | 17 | with: |
20 | 18 | fetch-depth: 0 |
21 | | - - name: Derive appropriate SHAs for base and head for `nx affected` commands |
22 | | - uses: nrwl/nx-set-shas@v1 |
| 19 | + - name: Derive SHAs for base and head for `nx affected` commands |
| 20 | + uses: nrwl/nx-set-shas@v4 |
| 21 | + |
| 22 | + - name: Set SHAs |
| 23 | + shell: bash |
| 24 | + run: | |
| 25 | + echo "BASE: ${{ env.NX_BASE }}" |
| 26 | + echo "HEAD: ${{ env.NX_HEAD }}" |
| 27 | +
|
23 | 28 | - uses: actions/setup-node@v1 |
24 | 29 | with: |
25 | | - node-version: 18.x |
| 30 | + node-version: 24.x |
26 | 31 | - name: Install pnpm |
27 | 32 | run: npm i -g pnpm |
28 | 33 | - name: Install deps |
29 | 34 | run: pnpm i --frozen-lockfile=false |
30 | 35 | - name: Build Projects |
31 | | - run: pnpm nx affected --target=build --parallel --max-parallel=3 |
| 36 | + run: pnpm nx affected --target=build --base=${{ env.NX_BASE }} --head=${{ env.NX_HEAD }} |
32 | 37 | - name: Test Projects |
33 | | - run: pnpm nx affected --target=test --parallel --max-parallel=2 |
34 | | - - run: pnpm nx-cloud stop-all-agents |
| 38 | + run: pnpm nx affected --target=test --base=${{ env.NX_BASE }} --head=${{ env.NX_HEAD }} |
35 | 39 | - name: Tag main branch if all jobs succeed |
36 | 40 | uses: nrwl/nx-tag-successful-ci-run@v1 |
37 | | - pr: |
38 | | - runs-on: ubuntu-latest |
39 | | - if: ${{ github.event_name == 'pull_request' }} |
40 | | - steps: |
41 | | - - uses: actions/checkout@v2 |
42 | | - with: |
43 | | - ref: ${{ github.event.pull_request.head.ref }} |
44 | | - fetch-depth: 0 |
45 | | - - name: Derive appropriate SHAs for base and head for `nx affected` commands |
46 | | - uses: nrwl/nx-set-shas@v1 |
47 | | - - uses: actions/setup-node@v1 |
48 | | - with: |
49 | | - node-version: 18.x |
50 | | - - name: Install pnpm |
51 | | - run: npm i -g pnpm |
52 | | - - name: Install deps |
53 | | - run: pnpm i --frozen-lockfile=false |
54 | | - - name: Build Projects |
55 | | - run: pnpm nx affected --target=build --parallel --max-parallel=3 |
56 | | - - name: Test Projects |
57 | | - run: pnpm nx affected --target=test --parallel --max-parallel=2 |
58 | | - - run: pnpm nx-cloud stop-all-agents |
59 | | - agents: |
60 | | - runs-on: ubuntu-latest |
61 | | - name: Agent 1 |
62 | | - timeout-minutes: 60 |
63 | | - strategy: |
64 | | - matrix: |
65 | | - agent: [ 1, 2, 3 ] |
66 | | - steps: |
67 | | - - uses: actions/checkout@v2 |
68 | | - - uses: actions/setup-node@v1 |
69 | | - with: |
70 | | - node-version: 18.x |
71 | | - - name: Install pnpm |
72 | | - run: npm i -g pnpm |
73 | | - - name: Install deps |
74 | | - run: pnpm i --frozen-lockfile=false |
75 | | - - name: Start Nx Agent ${{ matrix.agent }} |
76 | | - run: pnpm nx-cloud start-agent |
| 41 | + # pr: |
| 42 | + # runs-on: ubuntu-latest |
| 43 | + # if: ${{ github.event_name == 'pull_request' }} |
| 44 | + # steps: |
| 45 | + # - uses: actions/checkout@v6 |
| 46 | + # name: Checkout [pr] |
| 47 | + # with: |
| 48 | + # repository: ${{ github.event.pull_request.head.repo }} |
| 49 | + # ref: ${{ github.event.pull_request.head.ref }} |
| 50 | + # fetch-depth: 0 |
| 51 | + # - name: Derive SHAs for base and head for `nx affected` commands |
| 52 | + # uses: nrwl/nx-set-shas@v4 |
| 53 | + |
| 54 | + # - name: Set SHAs |
| 55 | + # shell: bash |
| 56 | + # run: | |
| 57 | + # echo "BASE: ${{ env.NX_BASE }}" |
| 58 | + # echo "HEAD: ${{ env.NX_HEAD }}" |
| 59 | + |
| 60 | + # - uses: actions/setup-node@v1 |
| 61 | + # with: |
| 62 | + # node-version: 24.x |
| 63 | + # - name: Install pnpm |
| 64 | + # run: npm i -g pnpm |
| 65 | + # - name: Install deps |
| 66 | + # run: pnpm i --frozen-lockfile=false |
| 67 | + # - name: Build Projects |
| 68 | + # run: pnpm nx affected --target=build --parallel --max-parallel=3 |
| 69 | + # - name: Test Projects |
| 70 | + # run: pnpm nx affected --target=test --parallel --max-parallel=2 |
| 71 | + # - run: pnpm nx-cloud stop-all-agents |
0 commit comments