summaryrefslogtreecommitdiffstats
path: root/.github/workflows/windows.yml
blob: 10bf0b82d1597c940c764d14a3a5d957dd898ac7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: Windows

on:
  push:
    branches: [ "trunk" ]
    paths-ignore:
      - 'docs/**'
      - STATUS
      - CHANGES
      - changes-entries/*
  pull_request:
    branches: [ "trunk" ]
    paths-ignore:
      - 'docs/**'
      - STATUS
      - CHANGES
      - changes-entries/*

jobs:
  build:
    strategy:
      fail-fast: false
      matrix:
        include:
          - name: Default
            triplet: x64-windows
            arch: x64
            build-type: Debug
            generator: "Ninja"

    runs-on: windows-latest
    timeout-minutes: 30
    name: ${{ matrix.name }}
    env: 
      VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
    steps:
      - name: Export GitHub Actions cache environment variables
        uses: actions/github-script@v7
        with:
          script: |
              core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
              core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');

      - name: Install dependencies
        run: vcpkg install --triplet ${{ matrix.triplet }} apr[private-headers] apr-util pcre2

      - uses: actions/checkout@v3

      - name: Configure CMake
        shell: cmd
        run: |
            call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=${{ matrix.arch }}
            cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} ^
                -G "${{ matrix.generator }}" ^
                -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake ^ 
                -DAPR_INCLUDE_DIR=C:/vcpkg/installed/${{ matrix.triplet }}/include ^
                "-DAPR_LIBRARIES=C:/vcpkg/installed/${{ matrix.triplet }}/lib/libapr-1.lib;C:/vcpkg/installed/${{ matrix.triplet }}/lib/libaprutil-1.lib"

      - name: Build
        shell: cmd
        run: |
            call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=${{ matrix.arch }}
            cmake --build ${{github.workspace}}/build --config ${{ matrix.build-type }}