Skip to content

Commit

Permalink
add CI msvc
Browse files Browse the repository at this point in the history
  • Loading branch information
Vincent PRELAT authored and lapoigne committed Mar 12, 2021
1 parent b74dd9b commit b665fd3
Show file tree
Hide file tree
Showing 2 changed files with 88 additions and 0 deletions.
87 changes: 87 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
- proj-sys-ubuntu
- proj-macos
- proj-sys-macos
- proj-sys-windows
steps:
- name: Mark the job as a success
if: success()
Expand Down Expand Up @@ -119,3 +120,89 @@ jobs:
uses: actions/checkout@v2
- run: brew install proj
- run: cargo test ${{ matrix.features }}

proj-sys-windows:
name: proj-sys windows
if: "!contains(github.event.head_commit.message, '[skip ci]')"
runs-on: windows-latest
env:
_PROJ_SYS_TEST_EXPECT_BUILD_FROM_SRC: 0
strategy:
fail-fast: false
matrix:
config:
- {
target: "x86_64-pc-windows-msvc",
VCPKG_DEFAULT_TRIPLET: "x64-windows-static",
RUSTFLAGS: "-Ctarget-feature=+crt-static",
features: "",
}
- {
target: "x86_64-pc-windows-msvc",
VCPKG_DEFAULT_TRIPLET: "x64-windows-static-md",
features: "",
}
- {
target: "x86_64-pc-windows-msvc",
VCPKG_DEFAULT_TRIPLET: "x64-windows",
VCPKGRS_DYNAMIC: 1,
# "cargo test --doc" broken with dynamic lib on CI machine (missing dll)
features: "--all-targets",
}
# - {
# target: "i686-pc-windows-msvc",
# VCPKG_DEFAULT_TRIPLET: "x86-windows-static",
# RUSTFLAGS: "-Ctarget-feature=+crt-static",
# features: "",
# }
# - {
# target: "i686-pc-windows-msvc",
# VCPKG_DEFAULT_TRIPLET: "x86-windows-static-md",
# features: "",
# }
# - {
# target: "i686-pc-windows-msvc",
# VCPKG_DEFAULT_TRIPLET: "x86-windows",
# VCPKGRS_DYNAMIC: 1,
# features: "--all-targets",
# }
steps:
- uses: actions/checkout@v2
- name: Install vcpkg
run: |
git clone https://github.com/Microsoft/vcpkg.git vcp
# PROJ version 7.2.1 - https://github.com/microsoft/vcpkg/search?q=proj4&type=commits
git -C vcp checkout 8fe4184c6a17e237d8b864b6d10e0b520334a093
vcp\bootstrap-vcpkg.bat -disableMetrics
- name: Set env
shell: bash
run: echo "VCPKG_ROOT=${{ github.workspace }}\vcp" >> $GITHUB_ENV
- name: Install LLVM and Clang
uses: KyleMayes/install-llvm-action@v1
with:
version: "10.0"
directory: ${{ runner.temp }}/llvm
- name: Set LIBCLANG_PATH
run: echo "LIBCLANG_PATH=$((gcm clang).source -replace "clang.exe")" >> $env:GITHUB_ENV
- name: install proj lib
env:
VCPKG_DEFAULT_TRIPLET: "${{ matrix.config.VCPKG_DEFAULT_TRIPLET }}"
shell: bash
run: |
set -ex
echo VCPKG_ROOT=${VCPKG_ROOT}
${VCPKG_ROOT}/vcpkg install proj
- name: Run integration tests
env:
VCPKG_DEFAULT_TRIPLET: "${{ matrix.config.VCPKG_DEFAULT_TRIPLET }}"
RUSTFLAGS: ${{ matrix.config.RUSTFLAGS }}
shell: bash
run: |
set -ex
rustup target add ${{ matrix.config.target }}
rustc --version
cargo --version
echo dyn=${{ matrix.config.VCPKGRS_DYNAMIC }}
if [ '${{ matrix.config.VCPKGRS_DYNAMIC }}' != '' ] ; then export VCPKGRS_DYNAMIC=1 ; fi
cargo build --target ${{ matrix.config.target }} ${{ matrix.config.features }}
cargo test --target ${{ matrix.config.target }} ${{ matrix.config.features }}
1 change: 1 addition & 0 deletions proj-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ fn try_vcpkg() -> Result<std::path::PathBuf, Box<dyn std::error::Error>> {
.find_package("proj");

if let Err(_e) = lib {
eprintln!("vcpkg proj library not found, trying pkg_config");
return try_pkg_config()
}

Expand Down

0 comments on commit b665fd3

Please sign in to comment.