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