|
| 1 | +name: Node.js CI |
| 2 | +on: |
| 3 | + push: |
| 4 | + branches: |
| 5 | + - main |
| 6 | + - legacy |
| 7 | + - dev |
| 8 | + pull_request: |
| 9 | + branches: |
| 10 | + - main |
| 11 | + - legacy |
| 12 | + - dev |
| 13 | + |
| 14 | +#env: |
| 15 | + #NX_CLOUD_DISTRIBUTED_EXECUTION: true |
| 16 | + #NX_CLOUD_ACCESS_TOKEN: '${{ secrets.NX_CLOUD_ACCESS_TOKEN }}' |
| 17 | + #NX_BRANCH: '${{github.event.pull_request.number || github.ref_name}}' |
| 18 | + |
| 19 | +jobs: |
| 20 | + |
| 21 | + main: |
| 22 | + runs-on: ubuntu-latest |
| 23 | + if: ${{ github.event_name != 'pull_request' }} |
| 24 | + steps: |
| 25 | + - uses: actions/checkout@v3 |
| 26 | + name: Checkout [main] |
| 27 | + with: |
| 28 | + fetch-depth: 0 |
| 29 | + #- name: Derive appropriate SHAs for base and head for `nx affected` commands |
| 30 | + # uses: nrwl/nx-set-shas@v3 |
| 31 | + - uses: actions/setup-node@v3 |
| 32 | + with: |
| 33 | + node-version: '16' |
| 34 | + |
| 35 | + name: Install pnpm |
| 36 | + id: pnpm-install |
| 37 | + with: |
| 38 | + version: 8 |
| 39 | + run_install: false |
| 40 | + - name: Get pnpm version |
| 41 | + id: pnpm-version |
| 42 | + run: | |
| 43 | + echo "$(pnpm --version)" |
| 44 | +
|
| 45 | + - name: Get pnpm store directory |
| 46 | + id: pnpm-cache |
| 47 | + run: | |
| 48 | + echo "::set-output name=pnpm_cache_dir::$(pnpm store path)" |
| 49 | +
|
| 50 | + - uses: actions/cache@v3 |
| 51 | + name: Setup pnpm cache |
| 52 | + with: |
| 53 | + path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }} |
| 54 | + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} |
| 55 | + restore-keys: | |
| 56 | + ${{ runner.os }}-pnpm-store- |
| 57 | + - run: pnpm install --no-frozen-lockfile |
| 58 | + #- run: npx nx-cloud start-ci-run |
| 59 | + #- run: pnpm run prettify:ci:readme |
| 60 | + - run: npx lerna run build:ci #--concurrency 3 |
| 61 | + #- run: npx nx-cloud stop-all-agents |
| 62 | + pr: |
| 63 | + runs-on: ubuntu-latest |
| 64 | + if: ${{ github.event_name == 'pull_request' }} |
| 65 | + steps: |
| 66 | + - uses: actions/checkout@v3 |
| 67 | + with: |
| 68 | + ref: ${{ github.event.pull_request.head.ref }} |
| 69 | + repository: ${{ github.event.pull_request.head.repo.full_name }} |
| 70 | + fetch-depth: 0 |
| 71 | + #- name: Derive appropriate SHAs for base and head for `nx affected` commands |
| 72 | + # uses: nrwl/nx-set-shas@v3 |
| 73 | + - uses: actions/setup-node@v3 |
| 74 | + with: |
| 75 | + node-version: '16' |
| 76 | + |
| 77 | + name: Install pnpm |
| 78 | + id: pnpm-install |
| 79 | + with: |
| 80 | + version: 8 |
| 81 | + run_install: false |
| 82 | + - name: Get pnpm version |
| 83 | + id: pnpm-version |
| 84 | + run: | |
| 85 | + echo "$(pnpm --version)" |
| 86 | +
|
| 87 | + - name: Get pnpm store directory |
| 88 | + id: pnpm-cache |
| 89 | + run: | |
| 90 | + echo "::set-output name=pnpm_cache_dir::$(pnpm store path)" |
| 91 | +
|
| 92 | + - uses: actions/cache@v3 |
| 93 | + name: Setup pnpm cache |
| 94 | + with: |
| 95 | + path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }} |
| 96 | + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} |
| 97 | + restore-keys: | |
| 98 | + ${{ runner.os }}-pnpm-store- |
| 99 | + - run: pnpm install --no-frozen-lockfile |
| 100 | + #- run: npx nx-cloud start-ci-run |
| 101 | + #- run: pnpm run prettify:ci:readme |
| 102 | + - run: npx lerna run build:ci #--concurrency 3 |
| 103 | + #- run: npx nx-cloud stop-all-agents |
| 104 | + - run: echo ${{ github.repository_owner }} |
| 105 | + - run: echo ${{ github.actor }} |
| 106 | + |
| 107 | +# agents: |
| 108 | +# runs-on: ubuntu-latest |
| 109 | +# name: Nx Agent |
| 110 | +# timeout-minutes: 60 |
| 111 | +# strategy: |
| 112 | +# matrix: |
| 113 | +# agent: [ 1, 2, 3 ] |
| 114 | +# steps: |
| 115 | +# - uses: actions/checkout@v3 |
| 116 | +# - uses: actions/setup-node@v3 |
| 117 | +# with: |
| 118 | +# node-version: '16' |
| 119 | + |
| 120 | +# name: Install pnpm |
| 121 | +# id: pnpm-install |
| 122 | +# with: |
| 123 | +# version: 8 |
| 124 | +# run_install: false |
| 125 | +# - name: Get pnpm version |
| 126 | +# id: pnpm-version |
| 127 | +# run: | |
| 128 | +# echo "$(pnpm --version)" |
| 129 | +# |
| 130 | +# - name: Get pnpm store directory |
| 131 | +# id: pnpm-cache |
| 132 | +# run: | |
| 133 | +# echo "::set-output name=pnpm_cache_dir::$(pnpm store path)" |
| 134 | +# |
| 135 | +# - uses: actions/cache@v3 |
| 136 | +# name: Setup pnpm cache |
| 137 | +# with: |
| 138 | +# path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }} |
| 139 | +# key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} |
| 140 | +# restore-keys: | |
| 141 | +# ${{ runner.os }}-pnpm-store- |
| 142 | +# - run: pnpm install --no-frozen-lockfile |
| 143 | +# - name: Start Nx Agent ${{ matrix.agent }} |
| 144 | +# run: npx nx-cloud start-agent |
0 commit comments