From bb36f080ea562a221d4b57213d5e3de365d9ef82 Mon Sep 17 00:00:00 2001 From: Anil Tuncel Date: Thu, 4 Apr 2024 12:24:42 +0200 Subject: [PATCH 1/4] add ci test on windows --- .github/workflows/rust.yml | 38 +++++++++++++++++++++++++++++++------- 1 file changed, 31 insertions(+), 7 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index fd205d7..ba8af4a 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -4,13 +4,13 @@ on: pull_request: push: branches: - - master + - master env: CARGO_TERM_COLOR: always jobs: - tests: + ubuntu-tests: runs-on: ubuntu-latest steps: @@ -19,11 +19,7 @@ jobs: - name: Cache APT Packages uses: awalsh128/cache-apt-pkgs-action@latest with: - packages: - build-essential - libgtk-3-dev - libhdf5-dev - librust-atk-dev + packages: build-essential libgtk-3-dev libhdf5-dev librust-atk-dev version: 1.0 - name: Install dependencies run: | @@ -38,3 +34,31 @@ jobs: run: cargo build --verbose - name: Run tests run: cargo test --verbose + + windows-tests: + runs-on: windows-latest + + steps: + - uses: actions/checkout@v3 + - name: Setup vcpkg + run: | + git clone https://github.com/Microsoft/vcpkg.git + .\vcpkg\bootstrap-vcpkg.bat + - name: Install HDF5 with vcpkg + run: | + .\vcpkg\vcpkg install hdf5:x64-windows + shell: cmd + - uses: Swatinem/rust-cache@v2 + - name: Install Rust dependencies + run: | + rustup component add clippy + - name: Check package & dependencies for errors + run: cargo check + - name: Lint + run: | + cargo fmt -- --check + cargo clippy -- -D warnings + - name: Build + run: cargo build --verbose + - name: Run tests + run: cargo test --verbose From 34af5dae9c8288a3cd0b25798b6fc4e113a3ba09 Mon Sep 17 00:00:00 2001 From: Anil Tuncel Date: Thu, 4 Apr 2024 12:38:28 +0200 Subject: [PATCH 2/4] Set environment variables for HDF5 --- .github/workflows/rust.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index ba8af4a..dd13fee 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -48,6 +48,14 @@ jobs: run: | .\vcpkg\vcpkg install hdf5:x64-windows shell: cmd + - name: Set environment variables for HDF5 + run: | + $vcpkg_installed_x64_windows = "$env:GITHUB_WORKSPACE\vcpkg\installed\x64-windows" + echo "HDF5_DIR=$vcpkg_installed_x64_windows" | Out-File -Append -Encoding utf8 $env:GITHUB_ENV + echo "VCPKG_ROOT=$env:GITHUB_WORKSPACE\vcpkg" | Out-File -Append -Encoding utf8 $env:GITHUB_ENV + $path = "$env:PATH;$vcpkg_installed_x64_windows\bin" + echo "PATH=$path" | Out-File -Append -Encoding utf8 $env:GITHUB_ENV + shell: pwsh - uses: Swatinem/rust-cache@v2 - name: Install Rust dependencies run: | From 531539b705d44a3ea64813b7a27bf86d17fd8ecd Mon Sep 17 00:00:00 2001 From: Anil Tuncel Date: Thu, 4 Apr 2024 13:02:14 +0200 Subject: [PATCH 3/4] checkout an older commit of vcpkg for hdf5 1.12.0 --- .github/workflows/rust.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index dd13fee..0b48d34 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -40,9 +40,10 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Setup vcpkg + - name: Setup vcpkg, checkout old commit for hdf5 1.12.0 run: | git clone https://github.com/Microsoft/vcpkg.git + git checkout 8534df4e72c7c003fdc26f67e014f27a834d7fb2 .\vcpkg\bootstrap-vcpkg.bat - name: Install HDF5 with vcpkg run: | From 1972799357de6a2c81efff5e05d03e9172fd0b93 Mon Sep 17 00:00:00 2001 From: Anil Tuncel Date: Thu, 4 Apr 2024 13:09:13 +0200 Subject: [PATCH 4/4] change directory for checking in in vcpkg --- .github/workflows/rust.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 0b48d34..872be2b 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -43,7 +43,9 @@ jobs: - name: Setup vcpkg, checkout old commit for hdf5 1.12.0 run: | git clone https://github.com/Microsoft/vcpkg.git + cd vcpkg git checkout 8534df4e72c7c003fdc26f67e014f27a834d7fb2 + cd .. .\vcpkg\bootstrap-vcpkg.bat - name: Install HDF5 with vcpkg run: |