File tree Expand file tree Collapse file tree 2 files changed +104
-3
lines changed
Expand file tree Collapse file tree 2 files changed +104
-3
lines changed Original file line number Diff line number Diff line change @@ -24,10 +24,21 @@ jobs:
2424
2525 apt update
2626
27- apt install curl build-essential -y
27+ apt install curl -y
28+
29+ apt install build-essential -y
2830
2931 apt install linux-headers-${KERNEL_VERSION} -y
3032
33+ apt install python3 python3-pip -y
34+
35+ # cmake dependency which needs extra terminal input, annoying
36+ # see more at https://blog.csdn.net/jiangjiang_jian/article/details/100731400/
37+ DEBIAN_FRONTEND=noninteractive apt install tzdata -y
38+
39+ # conan needs cmake and pip
40+ apt install cmake -y
41+
3142 - name : Install XMake
3243 run : |
3344
@@ -40,15 +51,23 @@ jobs:
4051 # keep xmake up to date
4152 xmake update -s dev
4253
54+ # conan needs pip(by apt) and cmake(by snap recommended)
55+ - name : Install Conan
56+ run : |
57+
58+ pip install conan==2.6.0
59+
60+ conan profile detect
61+
4362 - name : Configure XMake
4463 working-directory : ${{github.workspace}}
4564 run : |
4665
4766 alias xmake="~/.local/bin/xmake"
4867 export XMAKE_ROOT=y
4968
50- xmake f -m release --linux-headers=/usr/src/linux-headers-${KERNEL_VERSION}/
51-
69+ xmake f -m release --linux-headers=/usr/src/linux-headers-${KERNEL_VERSION}/ -y
70+
5271 - name : Build Targets
5372 working-directory : ${{github.workspace}}
5473 run : |
Original file line number Diff line number Diff line change 1+ name : Run Unit Test
2+
3+ on :
4+ push :
5+ branches :
6+ - " **"
7+ workflow_dispatch :
8+
9+ jobs :
10+ unit-test :
11+ runs-on : ubuntu-latest
12+ container :
13+ image : ubuntu:20.04
14+ env :
15+ # change your own kernel version here.
16+ KERNEL_VERSION : " 5.4.0-208-generic"
17+
18+ steps :
19+ - uses : actions/checkout@v4
20+
21+ - name : Install Dependencies
22+ run : |
23+
24+ apt update
25+
26+ apt install curl -y
27+
28+ apt install build-essential -y
29+
30+ apt install linux-headers-${KERNEL_VERSION} -y
31+
32+ apt install python3 python3-pip -y
33+
34+ DEBIAN_FRONTEND=noninteractive apt install tzdata -y
35+
36+ apt install cmake -y
37+
38+ - name : Install XMake
39+ run : |
40+
41+ curl -fsSL https://xmake.io/shget.text | bash
42+
43+ # use xmake as root
44+ alias xmake="~/.local/bin/xmake"
45+ export XMAKE_ROOT=y
46+
47+ # keep xmake up to date
48+ xmake update -s dev
49+
50+ - name : Install Conan
51+ run : |
52+
53+ pip install conan==2.6.0
54+
55+ conan profile detect
56+
57+ - name : Configure XMake
58+ working-directory : ${{github.workspace}}
59+ run : |
60+
61+ alias xmake="~/.local/bin/xmake"
62+ export XMAKE_ROOT=y
63+
64+ xmake f -m release --linux-headers=/usr/src/linux-headers-${KERNEL_VERSION}/ --with-gtest=true -y
65+
66+ - name : Build Targets
67+ working-directory : ${{github.workspace}}
68+ run : |
69+
70+ alias xmake="~/.local/bin/xmake"
71+ export XMAKE_ROOT=y
72+
73+ xmake build tests
74+
75+ - name : Run Unit Test
76+ working-directory : ${{github.workspace}}
77+ run : |
78+
79+ alias xmake="~/.local/bin/xmake"
80+ export XMAKE_ROOT=y
81+
82+ xmake run tests
You can’t perform that action at this time.
0 commit comments