diff --git a/.github/workflows/update-dictionaries.yml b/.github/workflows/update-dictionaries.yml index c6bca9c0093..320c7a03b5d 100644 --- a/.github/workflows/update-dictionaries.yml +++ b/.github/workflows/update-dictionaries.yml @@ -213,10 +213,88 @@ jobs: path: temp/*.diff retention-days: 1 + update-snapshots: + if: ${{ needs.check-dictionaries.outputs.patch }} + runs-on: ubuntu-latest + needs: + - build + - calc-ref + - check-dictionaries + + env: + REF_BRANCH: ${{ needs.calc-ref.outputs.ref }} + PATCH: ${{ needs.check-dictionaries.outputs.patch }} + + steps: + - name: Build Results + run: | + echo "key: ${{ needs.build.outputs.key }}" + echo "path: ${{ needs.build.outputs.path }}" + + - name: Checkout + uses: actions/checkout@v3 + with: + ref: ${{ env.REF_BRANCH }} + + - name: Setup pnpm + uses: pnpm/action-setup@v2.2.4 + + - name: Patch + run: | + echo "$PATCH" | git apply + + - name: Use Node.js ${{ env.NODE_VERSION }} + uses: actions/setup-node@v3 + with: + node-version: ${{ env.NODE_VERSION }} + cache: "pnpm" + + - run: pnpm -v + + - name: Cache Build + id: step-cache-build + uses: actions/cache@v3 + with: + key: ${{ needs.build.outputs.key }} + path: ${{ needs.build.outputs.path }} + + - name: Cached Results + run: | + echo Build Cache: ${{ steps.step-cache-build.outputs.cache-hit && 'Hit' || 'Miss' }} + + - name: Install + run: pnpm i + + - name: Has pnpm has failed? + if: ${{ failure() }} + run: | + ls -alF /home/runner/.pnpm/_logs/*.log + cat /home/runner/.pnpm/_logs/*.log + + - name: Check Build + if: ${{ !steps.step-cache-build.outputs.cache-hit }} + run: exit 1 + + - name: Update update-snapshots-only + run: | + pnpm run test:update-snapshots + + - name: Store Update Snapshot Diff + run: | + mkdir temp || echo temp already exists + git diff integration-tests/config integration-tests/repositories integration-tests/snapshots > temp/update_snapshot.diff + - name: store diff + uses: actions/upload-artifact@v3 + with: + name: diffs + path: temp/*.diff + retention-days: 1 + pr-setup: runs-on: ubuntu-latest needs: - integrations + - update-snapshots - calc-ref - check-dictionaries diff --git a/package.json b/package.json index 792f6bb11c1..e2ce9398054 100644 --- a/package.json +++ b/package.json @@ -39,6 +39,7 @@ "symlink": "node build_tools/bin/symlink.js packages test-packages", "test-watch": "pnpm -r run --parallel test-watch", "test": "pnpm -r run test && pnpm run test-schema", + "test:update-snapshots": "pnpm run -r test:update-snapshot", "test-bin": "pnpm run test-bin-spell && pnpm run test-bin-spell-cache-content && pnpm run test-bin-spell-cache-metadata && pnpm run test-bin-trace && pnpm run test-bin-check", "test-bin-check": "node ./bin.js check README.md", "test-bin-spell": "node ./bin.js -c cspellrc.json --no-progress --no-cache", diff --git a/packages/cspell-lib/package.json b/packages/cspell-lib/package.json index 489beb39e6d..285fd070e28 100644 --- a/packages/cspell-lib/package.json +++ b/packages/cspell-lib/package.json @@ -24,7 +24,7 @@ "test-watch": "jest --watch", "prepublishOnly": "pnpm run clean-build", "test": "jest", - "update-snapshot": "jest --updateSnapshot" + "test:update-snapshot": "jest --updateSnapshot" }, "repository": { "type": "git", diff --git a/packages/cspell/package.json b/packages/cspell/package.json index 34effcb603f..2108971fd6e 100644 --- a/packages/cspell/package.json +++ b/packages/cspell/package.json @@ -46,7 +46,7 @@ "test-watch": "jest --watch", "prepublishOnly": "pnpm run clean-build", "test": "jest", - "update-snapshot": "jest --updateSnapshot" + "test:update-snapshot": "jest --updateSnapshot" }, "repository": { "type": "git",