Check cosmetic drift #2
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: build-check | |
| # Safe, build-only dry run of the release SDK build. Mirrors the `publish_sdk` | |
| # job in release.yml but DOES NOT publish anything (no npm/PyPI/NuGet, no GH release). | |
| # Use it to confirm the SDK build + codegen are clean in CI before cutting a tag. | |
| on: | |
| push: | |
| branches: | |
| - jill/build-check | |
| jobs: | |
| build_sdk: | |
| name: Build SDKs | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Repo | |
| uses: actions/checkout@v4 | |
| - name: Unshallow clone for tags | |
| run: git fetch --prune --unshallow --tags | |
| - name: Install Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: ${{ matrix.goversion }} | |
| - name: Install pulumictl | |
| uses: jaxxstorm/action-install-gh-release@v1 | |
| with: | |
| repo: pulumi/pulumictl | |
| - name: Install pulumi | |
| uses: pulumi/actions@v5 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.nodeversion }} | |
| - name: Setup DotNet | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| # NOTE: keeps the same key as release.yml (which has a `dotnetverson` | |
| # typo) so this build behaves identically to the real release job. | |
| dotnet-version: ${{ matrix.dotnetverson }} | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.pythonversion }} | |
| - name: Build SDK | |
| run: make build_${{ matrix.language }} | |
| # Mirrors release.yml: codegen produces only KNOWN cosmetic diffs | |
| # (pulumi/pulumi#15979). Strip those known substitutions from the diff; if | |
| # anything else changed, fail — so real (non-cosmetic) drift is never masked. | |
| - name: Check worktree clean | |
| run: | | |
| git update-index -q --refresh | |
| drift=$(git diff | grep -E '^[+-]' | grep -vE '^[+-][+-]' \ | |
| | grep -vE '@pulumi/onepassword|@1[Pp]assword/pulumi-onepassword|secure_note|secureNote' || true) | |
| if [ -n "$drift" ]; then | |
| >&2 echo "error: unexpected non-cosmetic working tree changes:" | |
| git status | |
| echo "$drift" | |
| exit 1 | |
| fi | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| dotnetversion: | |
| - 3.1.301 | |
| goversion: | |
| - 1.21.x | |
| language: | |
| - nodejs | |
| - python | |
| - dotnet | |
| - go | |
| nodeversion: | |
| - 20.x | |
| pythonversion: | |
| - "3.9" |