-
Notifications
You must be signed in to change notification settings - Fork 1
156 lines (130 loc) · 4.18 KB
/
Copy pathci.yml
File metadata and controls
156 lines (130 loc) · 4.18 KB
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
name: CI/CD Pipeline
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
install-dependencies:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install Qt5 dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential cmake qtcreator qtbase5-dev libqt5serialport5 libqt5serialport5-dev
- name: Install Qt6 dependencies
run: |
sudo apt-get update
sudo apt-get install -y qt6-base-dev qt6-declarative-dev qt6-serialport-dev
build-qt5:
runs-on: ubuntu-latest
needs: install-dependencies
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Configure CMake for Qt5
run: cmake -B build_qt5 -DQT_VERSION=5
- name: Build project with Qt5
run: cmake --build build_qt5
- name: Compile C test client
run: gcc -o test/test_tcp test/test_tcp.c
- name: Compile C++ test client
run: g++ -std=c++17 -o test/test_tcp_cpp test/test_tcp.cpp
- name: Upload Qt5 build artifacts
uses: actions/upload-artifact@v4
with:
name: qt5-build-artifacts
path: |
build_qt5/qCommTest
test/test_tcp
test/test_tcp_cpp
test/test_tcp.py
test-qt5:
runs-on: ubuntu-latest
needs: build-qt5
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Download Qt5 build artifacts
uses: actions/download-artifact@v3
with:
name: qt5-build-artifacts
- name: Run Qt5 application and C test
run: |
QT_QPA_PLATFORM=offscreen ./qCommTest -p 6666 &
sleep 2 # Give the server time to start
./test_tcp
killall qCommTest || true # Kill the application, '|| true' to prevent failure if not found
working-directory: ${{ github.workspace }}
- name: Run Qt5 application and C++ test
run: |
QT_QPA_PLATFORM=offscreen ./qCommTest -p 6666 &
sleep 2 # Give the server time to start
./test_tcp_cpp
killall qCommTest || true
working-directory: ${{ github.workspace }}
- name: Run Qt5 application and Python test
run: |
QT_QPA_PLATFORM=offscreen ./qCommTest -p 6666 &
sleep 2 # Give the server time to start
python3 test_tcp.py
killall qCommTest || true
working-directory: ${{ github.workspace }}
build-qt6:
runs-on: ubuntu-latest
needs: install-dependencies
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Configure CMake for Qt6
run: cmake -B build_qt6 -DQT_VERSION=6
- name: Build project with Qt6
run: cmake --build build_qt6
- name: Compile C test client
run: gcc -o test/test_tcp test/test_tcp.c
- name: Compile C++ test client
run: g++ -std=c++17 -o test/test_tcp_cpp test/test_tcp.cpp
- name: Upload Qt6 build artifacts
uses: actions/upload-artifact@v4
with:
name: qt6-build-artifacts
path: |
build_qt6/qCommTest
test/test_tcp
test/test_tcp_cpp
test/test_tcp.py
test-qt6:
runs-on: ubuntu-latest
needs: build-qt6
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Download Qt6 build artifacts
uses: actions/download-artifact@v3
with:
name: qt6-build-artifacts
- name: Run Qt6 application and C test
run: |
QT_QPA_PLATFORM=offscreen ./qCommTest -p 6666 &
sleep 2 # Give the server time to start
./test_tcp
killall qCommTest || true
working-directory: ${{ github.workspace }}
- name: Run Qt6 application and C++ test
run: |
QT_QPA_PLATFORM=offscreen ./qCommTest -p 6666 &
sleep 2 # Give the server time to start
./test_tcp_cpp
killall qCommTest || true
working-directory: ${{ github.workspace }}
- name: Run Qt6 application and Python test
run: |
QT_QPA_PLATFORM=offscreen ./qCommTest -p 6666 &
sleep 2 # Give the server time to start
python3 test_tcp.py
killall qCommTest || true
working-directory: ${{ github.workspace }}