feat(strapi-plugin-rewind): remember what a relation pointed at #334
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| # Kept for running CI against a branch by hand. It does NOT rescue a release | |
| # PR: branch protection only counts check runs from a workflow run attached to | |
| # the pull request, so a dispatched run lands its checks on the right commit | |
| # and the PR stays BLOCKED anyway. | |
| # | |
| # A PR opened by GITHUB_TOKEN never triggers workflows - GitHub blocks that to | |
| # avoid loops - so a release PR has no checks until someone approves the | |
| # pending run, from the PR page or with: | |
| # | |
| # gh api -X POST repos/qkix/strapi-plugins/actions/runs/<id>/approve | |
| # | |
| # That approval is the deliberate gate before anything reaches npm. Removing | |
| # it means giving "Release - prepare" a PAT or GitHub App token so the PR is | |
| # not bot-authored. | |
| workflow_dispatch: | |
| jobs: | |
| # Keep this job id as `build`: branch protection on main requires the | |
| # contexts "build (20)" and "build (22)", and renaming it silently makes | |
| # those checks unsatisfiable - every PR sits BLOCKED with a green CI. | |
| build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| # @strapi/sdk-plugin refuses Node 23+, so the matrix stops at 22. | |
| node-version: [20, 22] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| # nx affected compares against a base commit, which it cannot find in | |
| # a shallow clone - without this it either rebuilds everything or | |
| # nothing. | |
| fetch-depth: 0 | |
| - uses: pnpm/action-setup@v4 | |
| - name: Use Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: pnpm | |
| - name: Derive the base and head SHAs for nx affected | |
| uses: nrwl/nx-set-shas@v4 | |
| # Nx caches task results on disk. Carrying that cache between runs is what | |
| # makes a second push to the same PR skip everything it did not touch - | |
| # the local equivalent of the remote cache Nx Cloud sells, which this repo | |
| # deliberately does not use. | |
| - name: Restore the Nx task cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: .nx/cache | |
| key: nx-${{ runner.os }}-node${{ matrix.node-version }}-${{ github.sha }} | |
| restore-keys: | | |
| nx-${{ runner.os }}-node${{ matrix.node-version }}- | |
| - run: pnpm install --frozen-lockfile | |
| # Match the runner instead of guessing: more workers than cores makes the | |
| # run slower, not faster. The ceiling here is modest anyway - the critical | |
| # path is the plugin build followed by the example's admin build, and no | |
| # amount of parallelism shortens a chain. | |
| - run: pnpm exec nx affected -t lint,typecheck,test,build --parallel=$(nproc) |