|
1 | 1 | on: |
2 | 2 | push: |
3 | 3 | branches: |
4 | | - - master |
| 4 | + - main |
5 | 5 | tags: |
6 | 6 | - 'v*' |
7 | 7 | pull_request: |
8 | 8 | branches: |
9 | | - - master |
| 9 | + - main |
10 | 10 |
|
11 | 11 | name: ci |
12 | 12 |
|
13 | 13 | jobs: |
14 | 14 | build_opengl_backend: |
15 | 15 | name: OpenGL |
16 | | - runs-on: ${{ matrix.os }} |
17 | | - env: |
18 | | - FREEIMAGE_VER: 3.18.0 |
19 | | - FREEIMAGE_VER_STR: 3180 |
20 | 16 | strategy: |
21 | 17 | fail-fast: false |
22 | 18 | matrix: |
23 | 19 | window_toolkit: [glfw3, sdl2] |
24 | 20 | os: [windows-latest] |
| 21 | + runs-on: ${{ matrix.os }} |
25 | 22 | steps: |
26 | 23 | - name: Checkout Repository |
27 | 24 | uses: actions/checkout@master |
28 | 25 |
|
29 | | - - name: FreeImage Cache |
30 | | - uses: actions/cache@v1 |
31 | | - id: freeimage-cache |
32 | | - with: |
33 | | - path: freeimage |
34 | | - key: freeimage-${{ env.FREEIMAGE_VER }} |
35 | | - |
36 | | - - name: FreeImage Download |
37 | | - if: steps.freeimage-cache.outputs.cache-hit != 'true' |
38 | | - run: | |
39 | | - $url = 'https://nchc.dl.sourceforge.net/project/freeimage/Binary%20Distribution/{0}/FreeImage{1}Win32Win64.zip' -f $env:FREEIMAGE_VER, $env:FREEIMAGE_VER_STR |
40 | | - Invoke-WebRequest -Uri $url -OutFile freeimage.zip |
41 | | - Expand-Archive .\freeimage.zip -DestinationPath .\ |
42 | | - Remove-Item -Path .\freeimage.zip |
43 | | -
|
44 | | - - name: Install Common Dependencies |
45 | | - run: | |
46 | | - $vcpkg_triplet_path = $env:GITHUB_WORKSPACE + "/CMakeModules/ForgeFreetypeVCPKGTriplet.cmake" |
47 | | - Copy-Item -Path $vcpkg_triplet_path -Destination C:/vcpkg/triplets/x64-windows.cmake |
48 | | - vcpkg install --triplet x64-windows boost-functional freetype opencl |
49 | | -
|
50 | | - - name: Install GLFW3 |
51 | | - if: matrix.window_toolkit == 'glfw3' |
52 | | - run: vcpkg install glfw3:x64-windows |
53 | | - |
54 | | - - name: Install SDL2 |
55 | | - if: matrix.window_toolkit == 'sdl2' |
56 | | - run: vcpkg install sdl2:x64-windows |
| 26 | + - name: Setup vcpkg |
| 27 | + uses: lukka/run-vcpkg@v11 |
57 | 28 |
|
58 | 29 | - name: Configure and Build |
59 | 30 | env: |
60 | 31 | FG_TOOLKIT: ${{ matrix.window_toolkit }} |
61 | 32 | run: | |
62 | 33 | mkdir build && cd build |
63 | 34 | cmake ` |
64 | | - -DCMAKE_TOOLCHAIN_FILE:FILEPATH=C:\vcpkg\scripts\buildsystems\vcpkg.cmake ` |
65 | | - -DFreeImage_ROOT:PATH=..\freeimage\Dist\x64 ` |
| 35 | + -DCMAKE_TOOLCHAIN_FILE:FILEPATH="${{ github.workspace }}\vcpkg\scripts\buildsystems\vcpkg.cmake" ` |
66 | 36 | -DFG_USE_WINDOW_TOOLKIT:STRING=$Env:FG_TOOLKIT .. |
67 | 37 | cmake --build . --parallel --target ALL_BUILD --config Release |
68 | 38 | cmake --build . --parallel --target INSTALL --config Release |
|
0 commit comments