Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add ci test on windows #40

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 42 additions & 7 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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: |
Expand All @@ -38,3 +34,42 @@ 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, 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: |
.\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: |
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
Loading