@@ -2,26 +2,78 @@ name: Build UIBase
22
33on :
44 push :
5- branches : master
5+ branches : [master]
6+ tags :
7+ - " *"
68 pull_request :
79 types : [opened, synchronize, reopened]
810
11+ env :
12+ VCPKG_BINARY_SOURCES : clear;x-azblob,${{ vars.AZ_BLOB_VCPKG_URL }},${{ secrets.AZ_BLOB_SAS }},readwrite
13+
914jobs :
1015 build :
1116 runs-on : windows-2022
1217 steps :
13- - name : Build UI Base
14- id : build -uibase
18+ - name : Configure UIBase
19+ id : configure -uibase
1520 uses : ModOrganizer2/build-with-mob-action@master
1621 with :
17- mo2-third-parties : gtest spdlog boost
18- mo2-dependencies : cmake_common
19- mo2-cmake-command : -DUIBASE_TESTS=1 ..
22+ # skip build because we are going to build both Debug and RelWithDebInfo here
23+ mo2-skip-build : true
2024
21- - name : Build UI Base Tests
22- run : cmake --build vsbuild --config RelWithDebInfo -j4 --target uibase-tests
23- working-directory : ${{ steps.build-uibase.outputs.working-directory }}
25+ # build both Debug and RelWithDebInfo for package
26+ - name : Build UI Base
27+ working-directory : ${{ steps.configure-uibase.outputs.working-directory }}
28+ run : |
29+ cmake --build vsbuild --config Debug --target uibase-tests --verbose
30+ cmake --build vsbuild --config RelWithDebInfo --target uibase-tests --verbose
2431
2532 - name : Test UI Base
26- run : ctest --test-dir vsbuild -C RelWithDebInfo --output-on-failure
27- working-directory : ${{ steps.build-uibase.outputs.working-directory }}
33+ working-directory : ${{ steps.configure-uibase.outputs.working-directory }}
34+ run : |
35+ ctest --test-dir vsbuild -C Debug --output-on-failure
36+ ctest --test-dir vsbuild -C RelWithDebInfo --output-on-failure
37+
38+ - name : Install UI Base
39+ working-directory : ${{ steps.configure-uibase.outputs.working-directory }}
40+ run : |
41+ cmake --install vsbuild --config Debug
42+ cmake --install vsbuild --config RelWithDebInfo
43+
44+ # this tests that UI Base can be properly used as a CMake package
45+ - name : Test UI Base package
46+ run : |
47+ cmake -B build . "-DCMAKE_PREFIX_PATH=${env:QT_ROOT_DIR}\msvc2022_64;${{ github.workspace }}\install\lib\cmake\"
48+ cmake --build build --config Debug
49+ cmake --build build --config Release
50+ cmake --build build --config RelWithDebInfo
51+ working-directory : ${{ steps.configure-uibase.outputs.working-directory }}/tests/cmake
52+
53+ - name : Upload UI Base artifact
54+ uses : actions/upload-artifact@master
55+ with :
56+ name : uibase
57+ path : ./install
58+
59+ publish :
60+ if : github.ref_type == 'tag'
61+ needs : build
62+ runs-on : windows-2022
63+ permissions :
64+ contents : write
65+ steps :
66+ - name : Download Artifact
67+ uses : actions/download-artifact@master
68+ with :
69+ name : uibase
70+ path : ./install
71+
72+ - name : Create UI Base archive
73+ run : 7z a uibase_${{ github.ref_name }}.7z ./install/*
74+
75+ - name : Publish Release
76+ env :
77+ GH_TOKEN : ${{ github.token }}
78+ GH_REPO : ${{ github.repository }}
79+ run : gh release create --draft=false --notes="${{ github.ref_name }}" "${{ github.ref_name }}" ./uibase_${{ github.ref_name }}.7z
0 commit comments