Test Windows CI with recent Rust toolchain #56
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build & test | |
permissions: | |
contents: write | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
test-bindings-c-cpp-linux: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
- name: Run C bindings tests on Linux | |
working-directory: bindings/C/tests/linux-gcc-g++/ | |
run: make CC=gcc | |
- name: Run C bindings tests on Linux | |
working-directory: bindings/C/tests/linux-gcc-g++/ | |
run: make CC=g++ | |
test-bindings-c-cpp-windows: | |
strategy: | |
matrix: | |
version: [Debug-c, Release-c, Debug-cpp, Release-cpp] | |
target: [x86_64-pc-windows-msvc, i686-pc-windows-msvc] | |
include: | |
- version: Debug-c | |
cargo_arg: "" | |
- version: Release-c | |
cargo_arg: --release | |
- version: Debug-cpp | |
cargo_arg: "" | |
- version: Release-cpp | |
cargo_arg: --release | |
- target: i686-pc-windows-msvc | |
msvc_platform: Win32 | |
- target: x86_64-pc-windows-msvc | |
msvc_platform: x64 | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
# Avoid a regression of Cargo, breaking at link time | |
toolchain: 1.79 | |
default: true | |
target: ${{ matrix.target }} | |
- name: "Display necessary libs" | |
working-directory: bindings/C | |
run: cargo rustc -- --print=native-static-libs | |
- uses: microsoft/[email protected] | |
- name: Compile C/CPP bindings test program for Windows | |
working-directory: bindings/C/tests/windows-msvc/ | |
run: msbuild mla-bindings-test.sln /p:Platform=${{ matrix.msvc_platform }} /p:Configuration=${{ matrix.version }} | |
- name: Run C/CPP bindings test program on Windows | |
working-directory: bindings/C/tests/windows-msvc/ | |
run: ./${{ matrix.msvc_platform }}/${{ matrix.version }}/mla-bindings-test.exe | |