14
14
15
15
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
16
16
jobs :
17
- # This workflow contains a single job called "build"
18
17
build :
19
18
strategy :
20
19
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-20.04
25
+ vcpkg-triplet : x86-linux
26
+ preset : ci-linux
22
27
target : [client, server]
23
28
24
29
# 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 }}'
26
36
27
37
# Steps represent a sequence of tasks that will be executed as part of the job
28
38
steps :
@@ -32,30 +42,46 @@ jobs:
32
42
submodules : recursive
33
43
fetch-depth : 0 # Required for automatic versioning
34
44
35
- - name : Set up Python
36
- uses : actions/setup-python@v5
37
- with :
38
- python-version : 3.8
39
-
40
45
- name : Install Ubuntu packages
41
- if : matrix.runs-on == 'ubuntu-20.04'
46
+ if : matrix.os. runs-on == 'ubuntu-20.04'
42
47
run : |
43
48
sudo dpkg --add-architecture i386
44
49
sudo apt update || true
45
50
sudo apt install -y libc6:i386 ninja-build gcc-9-multilib g++-9-multilib libssl1.1:i386 libssl-dev:i386 zlib1g-dev:i386
46
51
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 ${{ matrix.target }} test_${{ matrix.target }}']"
70
+ testPreset : ' ${{ matrix.os.preset }}'
71
+ testPresetAdditionalArgs : " ['-R ${{ matrix.target }}']"
72
+ env :
73
+ VCPKG_FORCE_SYSTEM_BINARIES : 1
51
74
52
- - name : Run tests
75
+ # Install
76
+ - name : Install with CMake
53
77
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 }}
56
80
81
+ # Upload result
57
82
- name : Upload build result
58
83
uses : actions/upload-artifact@v4
59
84
with :
60
- name : ${{ steps.build.outputs.artifact_name }}
61
- path : ./_build_out/BugfixedHL-*.zip
85
+ name : bhl-cmake-install
86
+ path : ${{github.workspace}}/_build/ci-install
87
+
0 commit comments