Skip to content

Commit f1d0ae9

Browse files
committed
Fix CI
1 parent 0ce1103 commit f1d0ae9

File tree

1 file changed

+58
-10
lines changed

1 file changed

+58
-10
lines changed

.github/workflows/ci.yml

Lines changed: 58 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,63 @@ on:
99
- main
1010

1111
jobs:
12-
13-
14-
build-qt5:
12+
install-qt5:
1513
runs-on: ubuntu-latest
1614
steps:
1715
- name: Checkout repository
1816
uses: actions/checkout@v3
1917

18+
- name: Cache Qt5 installations
19+
id: cache-qt5
20+
uses: actions/cache@v3
21+
with:
22+
path: |
23+
/usr/local/Qt/5*
24+
/opt/Qt/5*
25+
key: ${{ runner.os }}-qt5-deps-${{ hashFiles('CMakeLists.txt') }}
26+
2027
- name: Install Qt5 dependencies
28+
if: steps.cache-qt5.outputs.cache-hit != 'true'
2129
run: |
2230
sudo apt-get update
2331
sudo apt-get install -y build-essential cmake qtcreator qtbase5-dev libqt5serialport5 libqt5serialport5-dev
2432
33+
install-qt6:
34+
runs-on: ubuntu-latest
35+
steps:
36+
- name: Checkout repository
37+
uses: actions/checkout@v3
38+
39+
- name: Cache Qt6 installations
40+
id: cache-qt6
41+
uses: actions/cache@v3
42+
with:
43+
path: |
44+
/usr/local/Qt/6*
45+
/opt/Qt/6*
46+
key: ${{ runner.os }}-qt6-deps-${{ hashFiles('CMakeLists.txt') }}
47+
48+
- name: Install Qt6 dependencies
49+
if: steps.cache-qt6.outputs.cache-hit != 'true'
50+
run: |
51+
sudo apt-get update
52+
sudo apt-get install -y build-essential cmake qtcreator qt6-base-dev qt6-declarative-dev qt6-serialport-dev
53+
54+
build-qt5:
55+
runs-on: ubuntu-latest
56+
needs: install-qt5
57+
steps:
58+
- name: Checkout repository
59+
uses: actions/checkout@v3
60+
61+
- name: Restore Qt5 installations from cache
62+
uses: actions/cache@v3
63+
with:
64+
path: |
65+
/usr/local/Qt/5*
66+
/opt/Qt/5*
67+
key: ${{ runner.os }}-qt5-deps-${{ hashFiles('CMakeLists.txt') }}
68+
2569
- name: Configure CMake for Qt5
2670
run: cmake -B build_qt5 -DQT_VERSION=5
2771

@@ -57,7 +101,7 @@ jobs:
57101
sudo apt-get install -y libqt5core5a libqt5gui5 libqt5network5 libqt5serialport5 libqt5widgets5 python3
58102
59103
- name: Download Qt5 build artifacts
60-
uses: actions/download-artifact@v3
104+
uses: actions/download-artifact@v4
61105
with:
62106
name: qt5-build-artifacts
63107

@@ -87,14 +131,18 @@ jobs:
87131

88132
build-qt6:
89133
runs-on: ubuntu-latest
134+
needs: install-qt6
90135
steps:
91136
- name: Checkout repository
92137
uses: actions/checkout@v3
93138

94-
- name: Install Qt6 dependencies
95-
run: |
96-
sudo apt-get update
97-
sudo apt-get install -y build-essential cmake qtcreator qt6-base-dev qt6-declarative-dev qt6-serialport-dev
139+
- name: Restore Qt6 installations from cache
140+
uses: actions/cache@v3
141+
with:
142+
path: |
143+
/usr/local/Qt/6*
144+
/opt/Qt/6*
145+
key: ${{ runner.os }}-qt6-deps-${{ hashFiles('CMakeLists.txt') }}
98146

99147
- name: Configure CMake for Qt6
100148
run: cmake -B build_qt6 -DQT_VERSION=6
@@ -131,7 +179,7 @@ jobs:
131179
sudo apt-get install -y libqt6core6 libqt6gui6 libqt6network6 libqt6serialport6 libqt6widgets6 python3
132180
133181
- name: Download Qt6 build artifacts
134-
uses: actions/download-artifact@v3
182+
uses: actions/download-artifact@v4
135183
with:
136184
name: qt6-build-artifacts
137185

@@ -157,4 +205,4 @@ jobs:
157205
sleep 2 # Give the server time to start
158206
python3 test_tcp.py
159207
killall qCommTest || true
160-
working-directory: ${{ github.workspace }}
208+
working-directory: ${{ github.workspace }}

0 commit comments

Comments
 (0)