|
| 1 | +name: CI/CD Pipeline |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + pull_request: |
| 8 | + branches: |
| 9 | + - main |
| 10 | + |
| 11 | +jobs: |
| 12 | + build-and-test: |
| 13 | + runs-on: ubuntu-latest |
| 14 | + |
| 15 | + steps: |
| 16 | + - name: Checkout repository |
| 17 | + uses: actions/checkout@v3 |
| 18 | + |
| 19 | + - name: Install Qt5 dependencies |
| 20 | + run: | |
| 21 | + sudo apt-get update |
| 22 | + sudo apt-get install -y build-essential cmake qtcreator qtbase5-dev qtserialport5-dev libqt5network5-dev |
| 23 | +
|
| 24 | + - name: Install Qt6 dependencies |
| 25 | + run: | |
| 26 | + sudo apt-get update |
| 27 | + sudo apt-get install -y qt6-base-dev qt6-serialport-dev libqt6network6-dev |
| 28 | +
|
| 29 | + - name: Configure CMake for Qt5 |
| 30 | + run: cmake -B build_qt5 -DQT_VERSION=5 |
| 31 | + |
| 32 | + - name: Build project with Qt5 |
| 33 | + run: cmake --build build_qt5 |
| 34 | + |
| 35 | + - name: Configure CMake for Qt6 |
| 36 | + run: cmake -B build_qt6 -DQT_VERSION=6 |
| 37 | + |
| 38 | + - name: Build project with Qt6 |
| 39 | + run: cmake --build build_qt6 |
| 40 | + |
| 41 | + - name: Compile C test client |
| 42 | + run: gcc -o test/test_tcp test/test_tcp.c |
| 43 | + |
| 44 | + - name: Compile C++ test client |
| 45 | + run: g++ -std=c++17 -o test/test_tcp_cpp test/test_tcp.cpp |
| 46 | + |
| 47 | + - name: Run Qt5 application and C test |
| 48 | + run: | |
| 49 | + ./build_qt5/qCommTest -p 6666 & |
| 50 | + sleep 2 # Give the server time to start |
| 51 | + ./test/test_tcp |
| 52 | + working-directory: ${{ github.workspace }} |
| 53 | + |
| 54 | + - name: Run Qt5 application and C++ test |
| 55 | + run: | |
| 56 | + ./build_qt5/qCommTest -p 6666 & |
| 57 | + sleep 2 # Give the server time to start |
| 58 | + ./test/test_tcp_cpp |
| 59 | + working-directory: ${{ github.workspace }} |
| 60 | + |
| 61 | + - name: Run Qt5 application and Python test |
| 62 | + run: | |
| 63 | + ./build_qt5/qCommTest -p 6666 & |
| 64 | + sleep 2 # Give the server time to start |
| 65 | + python3 test/test_tcp.py |
| 66 | + working-directory: ${{ github.workspace }} |
| 67 | + |
| 68 | + - name: Run Qt6 application and C test |
| 69 | + run: | |
| 70 | + ./build_qt6/qCommTest -p 6666 & |
| 71 | + sleep 2 # Give the server time to start |
| 72 | + ./test/test_tcp |
| 73 | + working-directory: ${{ github.workspace }} |
| 74 | + |
| 75 | + - name: Run Qt6 application and C++ test |
| 76 | + run: | |
| 77 | + ./build_qt6/qCommTest -p 6666 & |
| 78 | + sleep 2 # Give the server time to start |
| 79 | + ./test/test_tcp_cpp |
| 80 | + working-directory: ${{ github.workspace }} |
| 81 | + |
| 82 | + - name: Run Qt6 application and Python test |
| 83 | + run: | |
| 84 | + ./build_qt6/qCommTest -p 6666 & |
| 85 | + sleep 2 # Give the server time to start |
| 86 | + python3 test/test_tcp.py |
| 87 | + working-directory: ${{ github.workspace }} |
0 commit comments