From 968b0fc6f4e8f5cf9688b506dcd4ff25a15fb44d Mon Sep 17 00:00:00 2001 From: Andrew Stein Date: Sun, 22 Sep 2024 00:10:12 -0400 Subject: [PATCH] Add windows build for `perspective-rs` Signed-off-by: Andrew Stein --- .github/workflows/build.yaml | 37 ++++++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index da0f30b13c..6f17aa4a46 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -240,9 +240,15 @@ jobs: matrix: os: - ubuntu-22.04 + - windows-2022 arch: - x86_64 node-version: [20.x] + is-release: + - ${{ startsWith(github.ref, 'refs/tags/v') }} + exclude: + - os: windows-2022 + is-release: false steps: - name: Checkout uses: actions/checkout@v4 @@ -260,24 +266,51 @@ jobs: manylinux: "false" skip_cache: ${{ steps.config-step.outputs.SKIP_CACHE }} + - run: echo "${{ steps.init-step.outputs.VCPKG_INSTALLATION_ROOT }}" >> $env:GITHUB_PATH + if: ${{ runner.os == 'Windows' }} + - name: Rust Build run: pnpm run build + if: ${{ !contains(matrix.os, 'windows') }} env: PACKAGE: "perspective-rs" PSP_ROOT_DIR: ${{ github.workspace }} + - name: Python Build (Windows) + run: | + New-Item -ItemType Directory -Path $env:CARGO_TARGET_DIR -Force + pnpm run build + if: ${{ contains(matrix.os, 'windows') }} + env: + CARGO_TARGET_DIR: D:\psp-rust + PSP_ROOT_DIR: ${{ github.workspace }} + VCPKG_ROOT: ${{ steps.init-step.outputs.VCPKG_INSTALLATION_ROOT }} + PACKAGE: "perspective-rs" + - name: Rust Test + if: ${{ !contains(matrix.os, 'windows') }} run: pnpm run test env: PACKAGE: "perspective-rs" PSP_ROOT_DIR: ${{ github.workspace }} + - name: Rust Test (Windows) + run: | + New-Item -ItemType Directory -Path $env:CARGO_TARGET_DIR -Force + pnpm run test + if: ${{ contains(matrix.os, 'windows') }} + env: + CARGO_TARGET_DIR: D:\psp-rust + PSP_ROOT_DIR: ${{ github.workspace }} + VCPKG_ROOT: ${{ steps.init-step.outputs.VCPKG_INSTALLATION_ROOT }} + PACKAGE: "perspective-rs" + - name: Package - if: ${{ startsWith(github.ref, 'refs/tags/v') }} + if: ${{ startsWith(github.ref, 'refs/tags/v') && !contains(matrix.os, 'windows') }} run: cargo package --allow-dirty -p perspective -p perspective-viewer -p perspective-js -p perspective-client -p perspective-server -p perspective-python - uses: actions/upload-artifact@v4 - if: ${{ startsWith(github.ref, 'refs/tags/v') }} + if: ${{ startsWith(github.ref, 'refs/tags/v') && !contains(matrix.os, 'windows') }} with: name: perspective-rust path: rust/target/package/*.crate