-
Notifications
You must be signed in to change notification settings - Fork 0
188 lines (165 loc) · 5.21 KB
/
gonnect.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
name: GOnnect Build
on:
workflow_dispatch: # can be manually dispatched under GitHub's "Actions" tab
# Run the build only, if the branch is main or a PR with main as target is used
# Also run only, if files were changed, which result in a changed build.
push:
branches: [ "main" ]
paths:
- 'CMakeList.txt'
- 'resources/**'
- 'media/**'
- 'migrate/**'
- 'i18n/*'
- 'scripts/**'
- 'specs/**'
- 'src/**'
# Use the main branch workflow/actions definitions rather the pull_request definitions
pull_request_target:
branches: [ "main" ]
paths:
- 'CMakeList.txt'
- 'resources/**'
- 'media/**'
- 'migrate/**'
- 'i18n/*'
- 'scripts/**'
- 'specs/**'
- 'src/**'
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
QT_VERSION: '6.8.1'
EXT_BASE: ${{github.workspace}}
jobs:
build:
runs-on: ubuntu-24.04
name: "Build GOnnect"
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Prepare
uses: ./.github/actions/prepare
with:
qt-version: ${{ env.QT_VERSION }}
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DBUILD_TESTING=ON -DBUILD_DEPENDENCIES=ON -DCMAKE_PREFIX_PATH="${{github.workspace}}/pjproject;${{github.workspace}}/qca/lib/cmake"
- name: Build
# Build your program with the given configuration
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --parallel $(nproc --all)
- name: Upload Test artifacts
uses: actions/upload-artifact@v4
with:
name: gonnect-tests
path: build/tests/contactsTest
retention-days: 1
format:
runs-on: ubuntu-24.04
name: "Code Formatting"
needs: build
steps:
- uses: actions/checkout@v4
- name: Run clang-format style check for C/C++/Protobuf programs.
uses: jidicula/[email protected]
with:
clang-format-version: '19'
check-path: 'src'
clang:
runs-on: ubuntu-24.04
needs: build
name: "Static Code Analyzer"
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Prepare
uses: ./.github/actions/prepare
with:
qt-version: ${{ env.QT_VERSION }}
- name: Run clang
shell: bash
run: |
pip install scan-build
export ANALYZE_ARGS="--exclude ${QT_ROOT_DIR} --exclude ${{github.workspace}}/external"
scripts/static-clang-analyzer.sh
- name: Save Report
uses: actions/upload-artifact@v4
with:
name: clang-report
path: /tmp/build.log
# clazy:
# runs-on: ubuntu-24.04
# #needs: build
# name: "Qt Semantics"
#
# steps:
# - uses: actions/checkout@v4
# with:
# submodules: 'recursive'
#
# - name: Prepare
# uses: ./.github/actions/prepare
# with:
# qt-version: ${{ env.QT_VERSION }}
# for-clazy: 'true'
#
# - name: Run clazy
# shell: bash
# run: |
# find ~/.local/clazy/lib
# LD_LIBRARY_PATH=~/.local/clazy/lib scripts/static-clazy-analyzer.sh
tests:
runs-on: ubuntu-24.04
name: "Unit Tests"
needs: build
steps:
- uses: actions/checkout@v4
- name: Prepare
uses: ./.github/actions/prepare
with:
qt-version: ${{ env.QT_VERSION }}
qt-only: 'true'
- name: Download Test artifacts
uses: actions/download-artifact@v4
with:
name: gonnect-tests
- name: Run Unit Tests
shell: bash
run: |
chmod +x contactsTest
LD_LIBRARY_PATH=${QT_ROOT_DIR}/lib ./contactsTest
semantic-release:
runs-on: ubuntu-24.04
name: Semantic Release
needs: ["tests", "format", "clang"]
# A release will only be triggered by a push to the main branch, not on pull requests.
if: github.ref == 'refs/heads/main'
permissions:
contents: write # to be able to publish a GitHub release
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests
steps:
- name: Get token
id: get_token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.RELEASE_APP_ID }}
private-key: ${{ secrets.RELEASE_APP_KEY }}
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ steps.get_token.outputs.token }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "lts/*"
- name: Install dependencies
run: |
sudo apt update
sudo apt install -y xmlstarlet jq
- name: Release
env:
GITHUB_TOKEN: ${{ steps.get_token.outputs.token }}
run: npx --package=semantic-release --package=@semantic-release/changelog --package=@semantic-release/git --package=@semantic-release/exec -- semantic-release