@@ -5,9 +5,9 @@ on: [ push, workflow_dispatch, pull_request, merge_group ]
55jobs :
66 build :
77 name : ${{ matrix.config.name }}
8- runs-on : ${{ matrix.config.os }}
98 # Avoid duplicate builds on PR from the same repository
109 if : github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository
10+ runs-on : ${{ matrix.config.os }}
1111 strategy :
1212 fail-fast : false
1313 matrix :
@@ -56,28 +56,29 @@ jobs:
5656 steps :
5757 - uses : actions/checkout@v4
5858
59- - name : Cache Qt
60- # Cache only when not installed by os package manager
61- if : matrix.config.qt_version != 'native'
62- id : cache-qt
63- uses : actions/cache@v2
59+ - name : Ccache
60+ uses : hendrikmuhs/ccache-action@v1
6461 with :
65- path : ${{ github.workspace }}/Qt
66- key : ${{ runner.os }}-${{ matrix.config.qt_version }}-Qt
62+ key : ${{ github.ref_name }}-${{ matrix.config.name }}
6763
6864 - name : Install specified Qt version
6965 if : matrix.config.qt_version != 'native'
70- uses : jurplel/install-qt-action@v3
66+ uses : jurplel/install-qt-action@v4
7167 with :
7268 version : ${{ matrix.config.qt_version }}
73- cached : ${{ steps.cache-qt.outputs.cache-hit }}
69+ cache : true
70+ cache-key-prefix : ${{ runner.os }}-${{ matrix.config.qt_version }}-Qt
7471 arch : ${{ matrix.config.qt_arch }}
7572 dir : ${{ github.workspace }}/Qt
7673
7774 - name : Install native Qt by package manager
7875 if : matrix.config.qt_version == 'native'
7976 run : ${{ matrix.config.qt_install_command }}
8077
78+ - name : Setup Ninja
79+ if : matrix.config.build_system == 'Ninja'
80+ uses : seanmiddleditch/gha-setup-ninja@v6
81+
8182 - name : Create Build Environment
8283 run : cmake -E make_directory ${{ github.workspace }}/build
8384
@@ -88,12 +89,20 @@ jobs:
8889 -DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }}
8990 -DCMAKE_C_COMPILER=${{ matrix.config.cc }}
9091 -DCMAKE_CXX_COMPILER=${{ matrix.config.cxx }}
92+ -DCMAKE_C_COMPILER_LAUNCHER=ccache
93+ -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
9194 -DFORCE_COLORED_OUTPUT=true
9295 -G \" ${{ matrix.config.build_system }}\" "
9396
9497 - name : Build
9598 working-directory : ${{ github.workspace }}/build
96- run : cmake --build . -j3
99+ run : cmake --build . -j4
100+
101+ - name : Deploy on Windows
102+ if : runner.os == 'Windows'
103+ working-directory : ${{ github.workspace }}/build/target
104+ shell : bash
105+ run : " windeployqt \" ${{ github.workspace }}/build/target/qtrvsim_gui.exe\" "
97106
98107 - name : Test
99108 working-directory : ${{ github.workspace }}/build
@@ -108,8 +117,9 @@ jobs:
108117
109118 build-emscripten :
110119 name : ${{ matrix.config.name }}
111- runs-on : ${{ matrix.config.os }}
120+ # Avoid duplicate builds on PR from the same repository
112121 if : github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository
122+ runs-on : ${{ matrix.config.os }}
113123 strategy :
114124 fail-fast : false
115125 matrix :
@@ -125,12 +135,10 @@ jobs:
125135 steps :
126136 - uses : actions/checkout@v4
127137
128- - name : Cache Qt
129- id : cache-qt
130- uses : actions/cache@v2
138+ - name : Ccache
139+ uses :
hendrikmuhs/[email protected] # https://github.com/hendrikmuhs/ccache-action/issues/181 131140 with :
132- path : ${{ github.workspace }}/Qt
133- key : ${{ runner.os }}-${{ matrix.config.qt_version }}-wasm-Qt
141+ key : ${{ github.ref_name }}-${{ matrix.config.name }}
134142
135143 - name : Setup EMSDK cache
136144 id : cache-system-libraries
@@ -149,7 +157,8 @@ jobs:
149157 uses : jurplel/install-qt-action@v3
150158 with :
151159 version : ${{ matrix.config.qt_version }}
152- cached : ${{ steps.cache-qt.outputs.cache-hit }}
160+ cache : true
161+ cache-key-prefix : ' wasm-qt'
153162 arch : ${{ matrix.config.qt_arch }}
154163 dir : ${{ github.workspace }}/Qt
155164
@@ -162,12 +171,14 @@ jobs:
162171 -DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }}
163172 -DCMAKE_PREFIX_PATH=$Qt5_DIR
164173 -DCMAKE_FIND_ROOT_PATH=$Qt5_DIR
174+ -DCMAKE_C_COMPILER_LAUNCHER=ccache
175+ -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
165176 -DFORCE_COLORED_OUTPUT=true
166177 -Wno-dev"
167178
168179 - name : Build
169180 working-directory : ${{ github.workspace }}/build
170- run : cmake --build . -j3
181+ run : cmake --build . -j4
171182
172183 - name : Store created artifacts
173184 uses : actions/upload-artifact@v4
0 commit comments