-
Notifications
You must be signed in to change notification settings - Fork 6
73 lines (59 loc) · 1.79 KB
/
main.yaml
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
name: CI
on: [push, pull_request]
jobs:
build-and-run-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v3
- name: Install libraries
run: |
sudo apt update
sudo apt install python3 python3-docutils meson clang libaio-dev rustc cargo
python3 -m pip install pytest
- name: Build
run: |
src_dir="${{ github.workspace }}"
build_dir="$src_dir/build"
CC=clang meson setup $build_dir $src_dir
pushd $build_dir
ninja
popd
- name: Run Tests
run: |
python3 -m pytest ${{ github.workspace }}/tests/test_libvhost.py -rsv --junitxml result.xml
- name: Collect test results
uses: mikepenz/action-junit-report@v3
if: always()
with:
report_paths: result.xml
build-with-cmake:
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v3
- name: Install libraries
run: |
sudo apt update
sudo apt install cmake ninja-build clang
- name: Build
run: |
src_dir="${{ github.workspace }}"
build_dir="$src_dir/build"
cmake -S $src_dir -B $build_dir -G Ninja -DCMAKE_C_COMPILER=clang
ninja -C $build_dir
lint-python-scripts:
runs-on: ubuntu-latest
strategy:
fail-fast: true
steps:
- uses: actions/checkout@v3
- name: Install flake8 & mypy
run: |
sudo apt update
sudo apt install python3 python3-pip
pip install flake8 mypy pytest
- name: Run flake8
run: flake8 tests/*.py
- name: Run mypy
run: mypy --disallow-incomplete-defs --no-implicit-optional tests/*.py