-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (57 loc) · 1.69 KB
/
unit-test.yml
File metadata and controls
84 lines (57 loc) · 1.69 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
name: Unit Test
on:
push:
branches:
- "**"
tags:
- "v*"
workflow_dispatch:
jobs:
unit-test:
runs-on: ubuntu-latest
container:
image: ubuntu:20.04
env:
# change your own kernel version here.
KERNEL_VERSION: "5.4.0-208-generic"
steps:
- uses: actions/checkout@v4
- name: Install Dependencies
run: |
apt update
apt install curl -y
apt install build-essential -y
apt install linux-headers-${KERNEL_VERSION} -y
apt install python3 python3-pip -y
DEBIAN_FRONTEND=noninteractive apt install tzdata -y
apt install cmake -y
- name: Install XMake
run: |
curl -fsSL https://xmake.io/shget.text | bash
# use xmake as root
alias xmake="~/.local/bin/xmake"
export XMAKE_ROOT=y
# keep xmake up to date
xmake update -s dev
- name: Install Conan
run: |
pip install conan==2.6.0
conan profile detect
- name: Configure XMake
working-directory: ${{github.workspace}}
run: |
alias xmake="~/.local/bin/xmake"
export XMAKE_ROOT=y
xmake f -m release --linux-headers=/usr/src/linux-headers-${KERNEL_VERSION}/ --with-gtest=true -y
- name: Build Targets
working-directory: ${{github.workspace}}
run: |
alias xmake="~/.local/bin/xmake"
export XMAKE_ROOT=y
xmake build tests
- name: Run Unit Test
working-directory: ${{github.workspace}}
run: |
alias xmake="~/.local/bin/xmake"
export XMAKE_ROOT=y
xmake run tests