1414
1515# A workflow run is made up of one or more jobs that can run sequentially or in parallel
1616jobs :
17- # This workflow contains a single job called "build"
1817 build :
1918 strategy :
2019 matrix :
21- runs-on : [windows-2019, ubuntu-20.04]
20+ os :
21+ - runs-on : windows-2019
22+ vcpkg-triplet : x86-windows-static
23+ preset : ci-windows
24+ - runs-on : ubuntu-22.04
25+ vcpkg-triplet : x86-linux
26+ preset : ci-linux
2227 target : [client, server]
2328
2429 # The type of runner that the job will run on
25- runs-on : ${{ matrix.runs-on }}
30+ runs-on : ${{ matrix.os.runs-on }}
31+
32+ env :
33+ VCPKG_ROOT : ' ${{github.workspace}}/vcpkg'
34+ VCPKG_DEFAULT_TRIPLET : ' ${{ matrix.os.vcpkg-triplet }}'
35+ VCPKG_DEFAULT_HOST_TRIPLET : ' ${{ matrix.os.vcpkg-triplet }}'
2636
2737 # Steps represent a sequence of tasks that will be executed as part of the job
2838 steps :
@@ -32,30 +42,46 @@ jobs:
3242 submodules : recursive
3343 fetch-depth : 0 # Required for automatic versioning
3444
35- - name : Set up Python
36- uses : actions/setup-python@v5
37- with :
38- python-version : 3.8
39-
4045 - name : Install Ubuntu packages
41- if : matrix.runs-on == 'ubuntu-20 .04'
46+ if : matrix.os. runs-on == 'ubuntu-22 .04'
4247 run : |
4348 sudo dpkg --add-architecture i386
4449 sudo apt update || true
45- sudo apt install -y libc6:i386 ninja-build gcc-9- multilib g++-9- multilib libssl1.1:i386 libssl-dev:i386 zlib1g-dev:i386
50+ sudo apt install -y libc6:i386 linux-libc-dev:i386 ninja-build gcc-multilib g++-multilib
4651
47- - name : Build release
48- id : build
49- run : |
50- python ./scripts/BuildRelease.py --target ${{ matrix.target }} --build-type release --vs 2019 --toolset v141_xp --linux-compiler gcc-9 --out-dir ./_build_out --cmake-args="-DWARNINGS_ARE_ERRORS=ON" --github-actions
52+ # Restore artifacts, or setup vcpkg for building artifacts
53+ - name : Set up vcpkg
54+ uses : lukka/run-vcpkg@v11
55+ id : runvcpkg
56+ with :
57+ vcpkgJsonGlob : ' vcpkg.json'
58+ vcpkgDirectory : ' ${{env.VCPKG_ROOT}}'
59+ vcpkgGitCommitId : ' ef7dbf94b9198bc58f45951adcf1f041fcbc5ea0'
60+ runVcpkgInstall : false
61+
62+ # Run CMake+vcpkg+Ninja+CTest to generate/build/test.
63+ - name : Build and Test with CMake
64+ uses : lukka/run-cmake@v10
65+ id : runcmake
66+ with :
67+ configurePreset : ' ${{ matrix.os.preset }}'
68+ buildPreset : ' ${{ matrix.os.preset }}'
69+ buildPresetAdditionalArgs : " ['--target', 'ci-${{ matrix.target }}']"
70+ testPreset : ' ${{ matrix.os.preset }}'
71+ testPresetAdditionalArgs : " ['-R', '${{ matrix.target }}']"
72+ env :
73+ VCPKG_FORCE_SYSTEM_BINARIES : 1
5174
52- - name : Run tests
75+ # Install
76+ - name : Install with CMake
5377 run : |
54- cd ./_build_out/build
55- ctest -R ${{ matrix.target }} --build-config RelWithDebInfo --output-on-failure
78+ cd ${{github.workspace}}/_build/${{ matrix.os.preset }}
79+ cmake --install . --prefix ${{github.workspace}}/_build/ci-install --component ${{ matrix.target }}
5680
81+ # Upload result
5782 - name : Upload build result
5883 uses : actions/upload-artifact@v4
5984 with :
60- name : ${{ steps.build.outputs.artifact_name }}
61- path : ./_build_out/BugfixedHL-*.zip
85+ name : bhl-cmake-install-${{ matrix.target }}-${{ matrix.os.preset }}
86+ path : ${{github.workspace}}/_build/ci-install
87+
0 commit comments