From 0eb7679e9fc81f4b3c92ca5adcd615dfc31ff194 Mon Sep 17 00:00:00 2001 From: Martin Ling Date: Mon, 8 Jan 2024 16:12:26 +0000 Subject: [PATCH] Add Windows to CI matrix. --- .github/workflows/rust.yml | 24 ++++++++++++++++++++++-- vcpkg.json | 3 +++ 2 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 vcpkg.json diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index e3a57339..5e2106f5 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -43,7 +43,7 @@ jobs: strategy: fail-fast: false matrix: - os: ['macos-latest', 'ubuntu-22.04'] + os: ['macos-latest', 'ubuntu-22.04', 'windows-latest'] rust: ['stable', '1.57'] runs-on: ${{ matrix.os }} @@ -63,7 +63,27 @@ jobs: run: brew install gtk4 pkg-config if: matrix.os == 'macos-latest' - - uses: Swatinem/rust-cache@v2 + - name: Install dependencies (Windows) + uses: lukka/run-vcpkg@v11 + with: + vcpkgGitCommitId: c8696863d371ab7f46e213d8f5ca923c4aef2a00 + runVcpkgInstall: true + doNotCache: false + if: matrix.os == 'windows-latest' + + - name: Set PKG_CONFIG (Windows) + run: echo ('PKG_CONFIG=' + $env:VCPKG_ROOT + '\installed\x64-windows\tools\pkgconf\pkgconf.exe') >> $env:GITHUB_ENV + if: matrix.os == 'windows-latest' + + - name: Set PKG_CONFIG_PATH (Windows) + run: echo ('PKG_CONFIG_PATH=' + $env:VCPKG_ROOT + '\installed\x64-windows\lib\pkgconfig') >> $env:GITHUB_ENV + if: matrix.os == 'windows-latest' + + - name: Set PATH (Windows) + run: echo ('PATH=' + $env:PATH + ';' + $env:VCPKG_ROOT + '\installed\x64-windows\bin') >> $env:GITHUB_ENV + if: matrix.os == 'windows-latest' + + - uses: mxschmitt/action-tmate@v3 - name: Build uses: actions-rs/cargo@v1 diff --git a/vcpkg.json b/vcpkg.json new file mode 100644 index 00000000..8e4b6b62 --- /dev/null +++ b/vcpkg.json @@ -0,0 +1,3 @@ +{ + "dependencies": ["gtk", "pkgconf"] +}