From 3ca400cff532f92aa627a9fc896ca3eb457884ef Mon Sep 17 00:00:00 2001 From: fullzer4 Date: Tue, 8 Sep 2026 22:54:11 -0300 Subject: [PATCH] fix(release): repair package smoke jobs --- .github/workflows/publish-test.yml | 12 +++++------- .github/workflows/release.yml | 2 +- bindings/python/Cargo.toml | 2 +- tests/package/ffi/smoke.ps1 | 13 +++++++++---- 4 files changed, 16 insertions(+), 13 deletions(-) diff --git a/.github/workflows/publish-test.yml b/.github/workflows/publish-test.yml index 72ad5bd..87edfd6 100644 --- a/.github/workflows/publish-test.yml +++ b/.github/workflows/publish-test.yml @@ -47,7 +47,7 @@ jobs: with: ref: ${{ env.PACKAGE_CHECKOUT_REF }} - name: Install Rust - run: rustup toolchain install stable --profile minimal + run: rustup toolchain install 1.87.0 --profile minimal - name: Build crate archives without publishing env: RUSTC_BOOTSTRAP: 1 @@ -74,7 +74,7 @@ jobs: name: release-crates path: artifacts/crates - name: Install Rust - run: rustup toolchain install stable --profile minimal + run: rustup toolchain install 1.87.0 --profile minimal - name: Consume the exact crate archives in a clean project run: tests/package/crates/smoke.sh artifacts/crates "${{ inputs['expected-version'] }}" @@ -107,8 +107,7 @@ jobs: - name: Install Rust target shell: bash run: | - rustup toolchain install stable --profile minimal --target "${{ matrix.target }}" - rustup default stable + rustup toolchain install 1.87.0 --profile minimal --target "${{ matrix.target }}" - name: Install Zig if: matrix.target == 'aarch64-unknown-linux-gnu' || contains(matrix.target, 'musl') uses: goto-bus-stop/setup-zig@abea47f85e598557f500fa1fd2ab7464fcb39406 # v2.2.1 @@ -352,7 +351,7 @@ jobs: with: python-version: '3.12' - name: Install Rust for the isolated sdist build - run: rustup toolchain install stable --profile minimal + run: rustup toolchain install 1.87.0 --profile minimal - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4 with: name: release-python-sdist @@ -382,8 +381,7 @@ jobs: - name: Install Rust target shell: bash run: | - rustup toolchain install stable --profile minimal --target "${{ matrix.target }}" - rustup default stable + rustup toolchain install 1.87.0 --profile minimal --target "${{ matrix.target }}" - name: Build both FFI library kinds run: cargo build --locked --release -p stdbr-ffi --target "${{ matrix.target }}" - name: Create an archive with every required library and the ABI snapshot diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8944c65..b5af530 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -147,7 +147,7 @@ jobs: name: release-crates path: artifacts/crates - name: Install Rust - run: rustup toolchain install stable --profile minimal + run: rustup toolchain install 1.87.0 --profile minimal - name: Publish packaged crates if absent env: CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} diff --git a/bindings/python/Cargo.toml b/bindings/python/Cargo.toml index 4cb0fd0..912acce 100644 --- a/bindings/python/Cargo.toml +++ b/bindings/python/Cargo.toml @@ -7,7 +7,7 @@ license.workspace = true description.workspace = true repository.workspace = true homepage.workspace = true -readme.workspace = true +readme = "README.md" keywords.workspace = true categories.workspace = true diff --git a/tests/package/ffi/smoke.ps1 b/tests/package/ffi/smoke.ps1 index d31cd8c..b2022c4 100644 --- a/tests/package/ffi/smoke.ps1 +++ b/tests/package/ffi/smoke.ps1 @@ -20,17 +20,22 @@ try { } $env:PATH = "$packageDirectory;$env:PATH" - Add-Type @' + $probe = @' +Add-Type @" using System.Runtime.InteropServices; public static class StdbrFfi { [DllImport("stdbr_ffi.dll", CallingConvention = CallingConvention.Cdecl)] [return: MarshalAs(UnmanagedType.I1)] public static extern bool stdbr_cpf_is_valid([MarshalAs(UnmanagedType.LPStr)] string value); } +"@ +if (-not [StdbrFfi]::stdbr_cpf_is_valid("52998224725")) { + throw "stdbr_cpf_is_valid rejected a valid CPF" +} '@ - if (-not [StdbrFfi]::stdbr_cpf_is_valid("52998224725")) { - throw "stdbr_cpf_is_valid rejected a valid CPF" - } + $encodedProbe = [Convert]::ToBase64String([Text.Encoding]::Unicode.GetBytes($probe)) + pwsh -NoLogo -NoProfile -NonInteractive -EncodedCommand $encodedProbe + if ($LASTEXITCODE -ne 0) { throw "FFI probe failed" } } finally { Remove-Item -Recurse -Force $temporaryDirectory }