name: 'Set up Nx planner' description: 'Restores only the locked Nx runtime needed for affected-project selection.' runs: using: 'composite' steps: - name: Compute planner cache key id: dependencies shell: bash run: | node scripts/dependency-hash-key.js >> "$GITHUB_OUTPUT" if [ -x node_modules/.bin/nx ]; then echo 'installed=true' >> "$GITHUB_OUTPUT"; fi - name: Restore Nx runtime id: cache uses: actions/cache@v6.1.0 with: path: ${{ runner.temp }}/nx-planner key: nx-planner-v1-${{ steps.dependencies.outputs.hash }}-${{ runner.os }}-${{ runner.arch }} # A miss uses the regular install; develop also seeds this cache from its existing install. - name: Install dependencies on cache miss if: steps.cache.outputs.cache-hit != 'true' && steps.dependencies.outputs.installed != 'true' uses: ./.github/actions/install-dependencies - name: Package Nx runtime if: steps.cache.outputs.cache-hit != 'true' shell: bash run: node "$GITHUB_ACTION_PATH/package-runtime.mjs" "$RUNNER_TEMP/nx-planner" - name: Use cached Nx runtime if: steps.cache.outputs.cache-hit == 'true' && steps.dependencies.outputs.installed != 'true' shell: bash run: ln -s "$RUNNER_TEMP/nx-planner/node_modules" node_modules