diff --git a/.github/actions/pnpm-lockfile-check/action.yaml b/.github/actions/pnpm-lockfile-check/action.yaml new file mode 100644 index 00000000000..12342aa91a2 --- /dev/null +++ b/.github/actions/pnpm-lockfile-check/action.yaml @@ -0,0 +1,26 @@ +name: "Check PNPM Lockfile and Install Workspace Dependencies" +description: "Sets up pnpm and installs workspace dependencies with frozen lockfile check" +runs: + using: "composite" + steps: + - uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4 + - name: Install Workspace Dependencies (Frozen Lockfile) + shell: bash + run: | + if ! pnpm install --frozen-lockfile --ignore-scripts; then + echo "::error title=PNPM Lockfile Out of Date::The pnpm-lock.yaml file is out of sync with workspace package.json dependencies." + echo "" + echo "====================================================================================================" + echo "❌ PNPM Lockfile Out of Date (ERR_PNPM_OUTDATED_LOCKFILE)" + echo "" + echo "One or more package.json files have changed or were merged without updating pnpm-lock.yaml." + echo "" + echo "To resolve this failure, please update the lockfile locally and commit the result:" + echo " pnpm install --no-frozen-lockfile --ignore-scripts" + echo " git add pnpm-lock.yaml" + echo " git commit -m \"chore: update pnpm-lock.yaml\"" + echo " git push" + echo "====================================================================================================" + echo "" + exit 1 + fi diff --git a/.github/actions/run-unit-tests/action.yaml b/.github/actions/run-unit-tests/action.yaml index 8756c30c924..b9c32156528 100644 --- a/.github/actions/run-unit-tests/action.yaml +++ b/.github/actions/run-unit-tests/action.yaml @@ -17,27 +17,7 @@ runs: uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0 with: node-version: ${{ inputs.node-version }} - - uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4 - - name: Install Workspace Dependencies (Frozen Lockfile) - run: | - if ! pnpm install --frozen-lockfile --ignore-scripts; then - echo "::error title=PNPM Lockfile Out of Date::The pnpm-lock.yaml file is out of sync with workspace package.json dependencies." - echo "" - echo "====================================================================================================" - echo "❌ PNPM Lockfile Out of Date (ERR_PNPM_OUTDATED_LOCKFILE)" - echo "" - echo "One or more package.json files have changed or were merged without updating pnpm-lock.yaml." - echo "" - echo "To resolve this failure, please update the lockfile locally and commit the result:" - echo " pnpm install --no-frozen-lockfile" - echo " git add pnpm-lock.yaml" - echo " git commit -m \"chore: update pnpm-lock.yaml\"" - echo " git push" - echo "====================================================================================================" - echo "" - exit 1 - fi - shell: bash + - uses: ./.github/actions/pnpm-lockfile-check - name: Cache Turborepo uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 with: diff --git a/.github/workflows/bigtable-conformance.yaml b/.github/workflows/bigtable-conformance.yaml index a4adbc1fb04..0d4bf4ee29a 100644 --- a/.github/workflows/bigtable-conformance.yaml +++ b/.github/workflows/bigtable-conformance.yaml @@ -52,26 +52,7 @@ jobs: with: go-version: '>=1.20.2' - run: chmod +x .kokoro/conformance.sh - - uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4 - - name: Install Workspace Dependencies (Frozen Lockfile) - run: | - if ! pnpm install --frozen-lockfile --ignore-scripts; then - echo "::error title=PNPM Lockfile Out of Date::The pnpm-lock.yaml file is out of sync with workspace package.json dependencies." - echo "" - echo "====================================================================================================" - echo "❌ PNPM Lockfile Out of Date (ERR_PNPM_OUTDATED_LOCKFILE)" - echo "" - echo "One or more package.json files have changed or were merged without updating pnpm-lock.yaml." - echo "" - echo "To resolve this failure, please update the lockfile locally and commit the result:" - echo " pnpm install --no-frozen-lockfile" - echo " git add pnpm-lock.yaml" - echo " git commit -m \"chore: update pnpm-lock.yaml\"" - echo " git push" - echo "====================================================================================================" - echo "" - exit 1 - fi + - uses: ./.github/actions/pnpm-lockfile-check - run: pnpm --filter ...{handwritten/bigtable} run --if-present compile - run: go version - run: .kokoro/conformance.sh diff --git a/.github/workflows/continuous.yaml b/.github/workflows/continuous.yaml index 08d179d4fac..2c844e2e60f 100644 --- a/.github/workflows/continuous.yaml +++ b/.github/workflows/continuous.yaml @@ -20,26 +20,7 @@ jobs: uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0 with: node-version: ${{ matrix.node }} - - uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4 - - name: Install Workspace Dependencies (Frozen Lockfile) - run: | - if ! pnpm install --frozen-lockfile --ignore-scripts; then - echo "::error title=PNPM Lockfile Out of Date::The pnpm-lock.yaml file is out of sync with workspace package.json dependencies." - echo "" - echo "====================================================================================================" - echo "❌ PNPM Lockfile Out of Date (ERR_PNPM_OUTDATED_LOCKFILE)" - echo "" - echo "One or more package.json files have changed or were merged without updating pnpm-lock.yaml." - echo "" - echo "To resolve this failure, please update the lockfile locally and commit the result:" - echo " pnpm install --no-frozen-lockfile" - echo " git add pnpm-lock.yaml" - echo " git commit -m \"chore: update pnpm-lock.yaml\"" - echo " git push" - echo "====================================================================================================" - echo "" - exit 1 - fi + - uses: ./.github/actions/pnpm-lockfile-check - run: node --version - run: ci/run_conditional_tests.sh name: Run unit tests diff --git a/.github/workflows/mandatory-conformance.yaml b/.github/workflows/mandatory-conformance.yaml index 12c0ca9266c..d6caf0830a5 100644 --- a/.github/workflows/mandatory-conformance.yaml +++ b/.github/workflows/mandatory-conformance.yaml @@ -52,26 +52,7 @@ jobs: with: go-version: '>=1.20.2' - run: chmod +x .kokoro/mandatory-conformance.sh - - uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4 - - name: Install Workspace Dependencies (Frozen Lockfile) - run: | - if ! pnpm install --frozen-lockfile --ignore-scripts; then - echo "::error title=PNPM Lockfile Out of Date::The pnpm-lock.yaml file is out of sync with workspace package.json dependencies." - echo "" - echo "====================================================================================================" - echo "❌ PNPM Lockfile Out of Date (ERR_PNPM_OUTDATED_LOCKFILE)" - echo "" - echo "One or more package.json files have changed or were merged without updating pnpm-lock.yaml." - echo "" - echo "To resolve this failure, please update the lockfile locally and commit the result:" - echo " pnpm install --no-frozen-lockfile" - echo " git add pnpm-lock.yaml" - echo " git commit -m \"chore: update pnpm-lock.yaml\"" - echo " git push" - echo "====================================================================================================" - echo "" - exit 1 - fi + - uses: ./.github/actions/pnpm-lockfile-check - run: pnpm --filter ...{handwritten/bigtable} run --if-present compile - run: go version - run: .kokoro/mandatory-conformance.sh diff --git a/.github/workflows/presubmit-bun.yml b/.github/workflows/presubmit-bun.yml index 3543f8f6ab5..b5006cf8a93 100644 --- a/.github/workflows/presubmit-bun.yml +++ b/.github/workflows/presubmit-bun.yml @@ -36,26 +36,7 @@ jobs: uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0 with: node-version: ${{ matrix.node-version }} - - uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4 - - name: Install Workspace Dependencies (Frozen Lockfile) - run: | - if ! pnpm install --frozen-lockfile --ignore-scripts; then - echo "::error title=PNPM Lockfile Out of Date::The pnpm-lock.yaml file is out of sync with workspace package.json dependencies." - echo "" - echo "====================================================================================================" - echo "❌ PNPM Lockfile Out of Date (ERR_PNPM_OUTDATED_LOCKFILE)" - echo "" - echo "One or more package.json files have changed or were merged without updating pnpm-lock.yaml." - echo "" - echo "To resolve this failure, please update the lockfile locally and commit the result:" - echo " pnpm install --no-frozen-lockfile" - echo " git add pnpm-lock.yaml" - echo " git commit -m \"chore: update pnpm-lock.yaml\"" - echo " git push" - echo "====================================================================================================" - echo "" - exit 1 - fi + - uses: ./.github/actions/pnpm-lockfile-check - name: Cache Turborepo uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 with: diff --git a/.github/workflows/presubmit.yaml b/.github/workflows/presubmit.yaml index 4f44111d5ee..bcbc2ae0347 100644 --- a/.github/workflows/presubmit.yaml +++ b/.github/workflows/presubmit.yaml @@ -48,26 +48,7 @@ jobs: uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0 with: node-version: 24 - - uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4 - - name: Install Workspace Dependencies (Frozen Lockfile) - run: | - if ! pnpm install --frozen-lockfile --ignore-scripts; then - echo "::error title=PNPM Lockfile Out of Date::The pnpm-lock.yaml file is out of sync with workspace package.json dependencies." - echo "" - echo "====================================================================================================" - echo "❌ PNPM Lockfile Out of Date (ERR_PNPM_OUTDATED_LOCKFILE)" - echo "" - echo "One or more package.json files have changed or were merged without updating pnpm-lock.yaml." - echo "" - echo "To resolve this failure, please update the lockfile locally and commit the result:" - echo " pnpm install --no-frozen-lockfile" - echo " git add pnpm-lock.yaml" - echo " git commit -m \"chore: update pnpm-lock.yaml\"" - echo " git push" - echo "====================================================================================================" - echo "" - exit 1 - fi + - uses: ./.github/actions/pnpm-lockfile-check - name: Cache Turborepo uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 with: diff --git a/.github/workflows/storage-conformance.yaml b/.github/workflows/storage-conformance.yaml index 7e27fc24cc4..3a1fd0d5236 100644 --- a/.github/workflows/storage-conformance.yaml +++ b/.github/workflows/storage-conformance.yaml @@ -22,25 +22,6 @@ jobs: with: node-version: 22 - run: node --version - - uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4 - - name: Install Workspace Dependencies (Frozen Lockfile) - run: | - if ! pnpm install --frozen-lockfile --ignore-scripts; then - echo "::error title=PNPM Lockfile Out of Date::The pnpm-lock.yaml file is out of sync with workspace package.json dependencies." - echo "" - echo "====================================================================================================" - echo "❌ PNPM Lockfile Out of Date (ERR_PNPM_OUTDATED_LOCKFILE)" - echo "" - echo "One or more package.json files have changed or were merged without updating pnpm-lock.yaml." - echo "" - echo "To resolve this failure, please update the lockfile locally and commit the result:" - echo " pnpm install --no-frozen-lockfile" - echo " git add pnpm-lock.yaml" - echo " git commit -m \"chore: update pnpm-lock.yaml\"" - echo " git push" - echo "====================================================================================================" - echo "" - exit 1 - fi + - uses: ./.github/actions/pnpm-lockfile-check - run: pnpm --filter ...{handwritten/storage} run --if-present compile - run: cd handwritten/storage && pnpm run conformance-test