on: [push, pull_request]
name: Continuous Integration
jobs:
test:
name: Test
runs-on: windows-latest
strategy:
matrix:
version:
- stable
- 1.51.0
arch:
- x86_64
- i686
env:
- msvc
- gnu
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.version }}-${{ matrix.arch }}-pc-windows-${{ matrix.env }}
override: true
- run: |
mkdir -p target/debug/deps &&
cp webview2-sys/Microsoft.Web.WebView2.*/build/native/${{ fromJson('{ "x86_64": "x64", "i686": "x86" }')[matrix.arch] }}/WebView2Loader.dll target/debug/deps &&
mkdir -p webview2-sys/target/debug/deps &&
cp webview2-sys/Microsoft.Web.WebView2.*/build/native/${{ fromJson('{ "x86_64": "x64", "i686": "x86" }')[matrix.arch] }}/WebView2Loader.dll webview2-sys/target/debug/deps
if: ${{ matrix.env == 'gnu' }}
- uses: actions-rs/cargo@v1
with:
command: check
- uses: actions-rs/cargo@v1
with:
command: test
- run: |
echo '[workspace]' >> Cargo.toml &&
cargo test --tests
working-directory: webview2-sys
test-minimal-versions:
name: Test (Minimal versions)
runs-on: windows-latest
strategy:
matrix:
toolchain:
- nightly-x86_64-pc-windows-msvc
- nightly-i686-pc-windows-gnu
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.toolchain }}
override: true
- run: |
mkdir -p target/debug/deps &&
cp webview2-sys/Microsoft.Web.WebView2.*/build/native/x86/WebView2Loader.dll target/debug/deps
if: ${{ endsWith(matrix.toolchain, 'gnu') }}
- uses: actions-rs/cargo@v1
with:
command: test
args: -Z minimal-versions
fmt:
name: Rustfmt
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.51.0
override: true
- run: rustup component add rustfmt
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
clippy:
name: Clippy
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.51.0
override: true
- run: rustup component add clippy
- uses: actions-rs/cargo@v1
with:
command: clippy
args: --all --all-targets -- -D warnings
- uses: actions-rs/cargo@v1
with:
command: clippy
args: --no-default-features --all --all-targets -- -D warnings
check-generated-code:
name: Check Generated Code (make sure they are up to date)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.51.0
override: true
- run: rustup component add rustfmt
- run: cargo run < ../Microsoft.Web.WebView2.*/WebView2.idl > ../src/lib.rs && rustfmt ../src/lib.rs
working-directory: webview2-sys/idl2rs
- run: cargo run -- interface_wrappers < ../Microsoft.Web.WebView2.*/WebView2.idl > ../../src/interfaces.rs && rustfmt ../../src/interfaces.rs
working-directory: webview2-sys/idl2rs
- run: git diff --exit-code