|
1 | 1 | name: Node.js CI
|
2 |
| - |
3 | 2 | on:
|
4 | 3 | push:
|
5 | 4 | branches:
|
6 | 5 | - main
|
7 | 6 | pull_request:
|
| 7 | + branches: |
| 8 | + - main |
8 | 9 |
|
9 | 10 | jobs:
|
10 | 11 | main:
|
11 |
| - name: Nx Cloud - Main Job |
12 |
| - uses: nrwl/ci/.github/workflows/[email protected] |
13 |
| - with: |
14 |
| - number-of-agents: 3 |
15 |
| - init-commands: | |
16 |
| - pnpm exec nx-cloud start-ci-run --stop-agents-after="build" --agent-count=3 |
17 |
| - parallel-commands-on-agents: | |
18 |
| - pnpm exec nx affected --target=build --parallel=3 |
| 12 | + runs-on: ubuntu-latest |
| 13 | + if: ${{ github.event_name != 'pull_request' }} |
| 14 | + steps: |
| 15 | + - uses: actions/checkout@v3 |
| 16 | + name: Checkout [main] |
| 17 | + with: |
| 18 | + fetch-depth: 0 |
| 19 | + - uses: actions/setup-node@v3 |
| 20 | + with: |
| 21 | + node-version: "16" |
| 22 | + |
| 23 | + name: Install pnpm |
| 24 | + id: pnpm-install |
| 25 | + with: |
| 26 | + version: 8 |
| 27 | + run_install: false |
| 28 | + - name: Get pnpm version |
| 29 | + id: pnpm-version |
| 30 | + run: | |
| 31 | + echo "$(pnpm --version)" |
| 32 | +
|
| 33 | + - name: Get pnpm store directory |
| 34 | + id: pnpm-cache |
| 35 | + run: | |
| 36 | + echo "::set-output name=pnpm_cache_dir::$(pnpm store path)" |
| 37 | +
|
| 38 | + - uses: actions/cache@v3 |
| 39 | + name: Setup pnpm cache |
| 40 | + with: |
| 41 | + path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }} |
| 42 | + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} |
| 43 | + restore-keys: | |
| 44 | + ${{ runner.os }}-pnpm-store- |
| 45 | + - run: pnpm install --no-frozen-lockfile |
| 46 | + - run: pnpm run build |
| 47 | + pr: |
| 48 | + runs-on: ubuntu-latest |
| 49 | + if: ${{ github.event_name == 'pull_request' }} |
| 50 | + steps: |
| 51 | + - uses: actions/checkout@v3 |
| 52 | + with: |
| 53 | + ref: ${{ github.event.pull_request.head.ref }} |
| 54 | + repository: ${{ github.event.pull_request.head.repo.full_name }} |
| 55 | + fetch-depth: 0 |
| 56 | + - uses: actions/setup-node@v3 |
| 57 | + with: |
| 58 | + node-version: "16" |
| 59 | + |
| 60 | + name: Install pnpm |
| 61 | + id: pnpm-install |
| 62 | + with: |
| 63 | + version: 8 |
| 64 | + run_install: false |
| 65 | + - name: Get pnpm version |
| 66 | + id: pnpm-version |
| 67 | + run: | |
| 68 | + echo "$(pnpm --version)" |
| 69 | +
|
| 70 | + - name: Get pnpm store directory |
| 71 | + id: pnpm-cache |
| 72 | + run: | |
| 73 | + echo "::set-output name=pnpm_cache_dir::$(pnpm store path)" |
19 | 74 |
|
20 |
| - agents: |
21 |
| - name: Nx Cloud - Agents |
22 |
| - uses: nrwl/ci/.github/workflows/[email protected] |
23 |
| - with: |
24 |
| - number-of-agents: 3 |
| 75 | + - uses: actions/cache@v3 |
| 76 | + name: Setup pnpm cache |
| 77 | + with: |
| 78 | + path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }} |
| 79 | + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} |
| 80 | + restore-keys: | |
| 81 | + ${{ runner.os }}-pnpm-store- |
| 82 | + - run: pnpm install --no-frozen-lockfile |
| 83 | + - run: pnpm run build |
0 commit comments