Add support for mingw (-pc-windows-gnu) targets #1049
Workflow file for this run
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: Windows | |
on: | |
push: | |
pull_request: | |
schedule: | |
- cron: "35 7 * * *" # UTC | |
jobs: | |
build: | |
runs-on: windows-latest | |
strategy: | |
matrix: | |
config: | |
- { | |
target: "x86_64-pc-windows-msvc", | |
VCPKG_DEFAULT_TRIPLET: "x64-windows-static", | |
RUSTFLAGS: "-Ctarget-feature=+crt-static", | |
features: "curl", | |
} | |
- { | |
target: "x86_64-pc-windows-msvc", | |
VCPKG_DEFAULT_TRIPLET: "x64-windows-static-md", | |
features: "curl", | |
} | |
- { | |
target: "x86_64-pc-windows-msvc", | |
VCPKG_DEFAULT_TRIPLET: "x64-windows", | |
VCPKGRS_DYNAMIC: 1, | |
features: "curl", | |
} | |
- { | |
target: "i686-pc-windows-msvc", | |
VCPKG_DEFAULT_TRIPLET: "x86-windows-static", | |
RUSTFLAGS: "-Ctarget-feature=+crt-static", | |
features: "curl", | |
} | |
- { | |
target: "i686-pc-windows-msvc", | |
VCPKG_DEFAULT_TRIPLET: "x86-windows-static-md", | |
features: "curl", | |
} | |
- { | |
target: "i686-pc-windows-msvc", | |
VCPKG_DEFAULT_TRIPLET: "x86-windows", | |
VCPKGRS_DYNAMIC: 1, | |
features: "curl", | |
} | |
- { | |
target: "x86_64-pc-windows-gnu", | |
VCPKG_DEFAULT_TRIPLET: "x64-mingw-static", | |
} | |
- { | |
target: "x86_64-pc-windows-gnu", | |
VCPKG_DEFAULT_TRIPLET: "x64-mingw-dynamic", | |
VCPKGRS_DYNAMIC: 1, | |
} | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Dump GitHub context | |
env: | |
GITHUB_CONTEXT: ${{ toJson(github) }} | |
run: echo "$Env:GITHUB_CONTEXT" | |
- name: Dump job context | |
env: | |
JOB_CONTEXT: ${{ toJson(job) }} | |
run: echo "$JOB_CONTEXT" | |
- name: Dump steps context | |
env: | |
STEPS_CONTEXT: ${{ toJson(steps) }} | |
run: echo "$STEPS_CONTEXT" | |
- name: Dump runner context | |
env: | |
RUNNER_CONTEXT: ${{ toJson(runner) }} | |
run: echo "$RUNNER_CONTEXT" | |
- name: Dump strategy context | |
env: | |
STRATEGY_CONTEXT: ${{ toJson(strategy) }} | |
run: echo "$STRATEGY_CONTEXT" | |
- name: Dump matrix context | |
env: | |
MATRIX_CONTEXT: ${{ toJson(matrix) }} | |
run: echo "$MATRIX_CONTEXT" | |
- name: Install the target | |
run: rustup target add ${{ matrix.config.target }} | |
- name: Run build | |
run: cargo build --target ${{ matrix.config.target }} --verbose | |
- name: Run unit tests | |
run: cargo test --target ${{ matrix.config.target }} --verbose | |
- name: Install vcpkg | |
run: | | |
git clone https://github.com/Microsoft/vcpkg.git vcp | |
vcp\bootstrap-vcpkg.bat | |
- name: Set env | |
shell: bash | |
run: | | |
echo "VCPKG_ROOT=${{ github.workspace }}\vcp" >> $GITHUB_ENV | |
- name: Run integration tests | |
env: | |
RUST_BACKTRACE: 1 | |
RUST_TEST_THREADS: 1 | |
VCPKG_DEFAULT_TRIPLET: "${{ matrix.config.VCPKG_DEFAULT_TRIPLET }}" | |
RUSTFLAGS: ${{ matrix.config.RUSTFLAGS }} | |
shell: bash | |
run: | | |
set -ex | |
rustc --version | |
cargo --version | |
echo VCPKG_ROOT=${VCPKG_ROOT} | |
echo dyn=${{ matrix.config.VCPKGRS_DYNAMIC }} | |
if [ '${{ matrix.config.VCPKGRS_DYNAMIC }}' != '' ] ; then export VCPKGRS_DYNAMIC=1 ; fi | |
${VCPKG_ROOT}/vcpkg.exe install zlib openssl | |
if [[ '${{ matrix.config.features }}' =~ 'curl' ]]; then | |
${VCPKG_ROOT}/vcpkg.exe install curl | |
fi | |
cargo build --target ${{ matrix.config.target }} --all | |
cargo test --target ${{ matrix.config.target }} --all | |
cargo run --target ${{ matrix.config.target }} --manifest-path vcpkg_cli/Cargo.toml -- --target ${{ matrix.config.target }} probe zlib | |
cargo run --target ${{ matrix.config.target }} --manifest-path systest/Cargo.toml --features '${{ matrix.config.features }}' |