@@ -3,19 +3,34 @@ name: build
33on :
44 pull_request :
55 branches : ['master', 'release/**']
6- paths-ignore : ['**.md', '**.toml', '**.yaml', 'docs/**']
76 push :
87 branches : ['master', 'release/**']
9- paths-ignore : ['**.md', '**.toml', '**.yaml', 'docs/**']
108
119jobs :
10+ path-filter :
11+ runs-on : ubuntu-latest
12+ outputs :
13+ should_build : ${{ steps.filter.outputs.code }}
14+ steps :
15+ - uses : actions/checkout@v6
16+ - uses : dorny/paths-filter@v3
17+ id : filter
18+ with :
19+ filters : |
20+ code:
21+ - '!**.md'
22+ - '!**.toml'
23+ - '!**.yaml'
24+ - '!docs/**'
25+
1226 build-on-ubuntu-24 :
27+ needs : path-filter
28+ if : ${{ needs.path-filter.outputs.should_build == 'true' }}
1329 name : build on ${{ matrix.os }} with Qt6
1430 runs-on : ${{ matrix.os }}
1531 strategy :
1632 matrix :
1733 os : ['ubuntu-24.04', 'ubuntu-24.04-arm']
18-
1934 steps :
2035 - name : Checkout code
2136 uses : actions/checkout@v6
@@ -43,10 +58,11 @@ jobs:
4358 run : cmake --build build --parallel
4459
4560 - name : Run tests
46- run : |
47- cmake --build build --target test
61+ run : cmake --build build --target test
4862
4963 build-on-ubuntu-22 :
64+ needs : path-filter
65+ if : ${{ needs.path-filter.outputs.should_build == 'true' }}
5066 name : build on ${{ matrix.os }} with Qt5
5167 runs-on : ${{ matrix.os }}
5268 strategy :
7995
8096 - name : Build
8197 run : cmake --build build --parallel
98+
99+ build-status :
100+ name : Final build Status
101+ needs : [path-filter, build-on-ubuntu-24, build-on-ubuntu-22]
102+ if : always()
103+ runs-on : ubuntu-latest
104+ steps :
105+ - name : Decide status
106+ run : |
107+ if [[ "${{ needs.build-on-ubuntu-24.result }}" == "failure" || "${{ needs.build-on-ubuntu-22.result }}" == "failure" ]]; then
108+ exit 1
109+ fi
110+ exit 0
0 commit comments