Skip to content

Commit ce1ed33

Browse files
authored
Add GitHub Action scripts for automated testing (#6)
This commit adds two jobs for GitHub Actions: - fibdrv-check: It will execute `make` and `make check` to ensure that the kernel module can be successfully built, loaded and used. - coding-style: It will check the coding-style using clang-format.
1 parent a6b1320 commit ce1ed33

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

.ci/check-format.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/env bash
2+
3+
SOURCES=$(find $(git rev-parse --show-toplevel) | egrep "\.(cpp|h)\$")
4+
5+
set -x
6+
7+
for file in ${SOURCES};
8+
do
9+
clang-format-14 ${file} > expected-format
10+
diff -u -p --label="${file}" --label="expected coding style" ${file} expected-format
11+
done
12+
exit $(clang-format-14 --output-replacements-xml ${SOURCES} | egrep -c "</replacement>")

.github/workflows/main.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: CI
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
fibdrv-check:
7+
runs-on: ubuntu-22.04
8+
steps:
9+
- uses: actions/[email protected]
10+
- name: install-dependencies
11+
run: |
12+
sudo apt-get update
13+
sudo apt-get -q -y install build-essential cppcheck
14+
sudo apt-get -q -y install linux-headers-`uname -r`
15+
- name: make
16+
run: |
17+
make
18+
- name: make check
19+
run: |
20+
make check
21+
22+
coding-style:
23+
runs-on: ubuntu-22.04
24+
steps:
25+
- uses: actions/[email protected]
26+
- name: coding convention
27+
run: |
28+
sudo apt-get install -q -y clang-format-14
29+
sh .ci/check-format.sh
30+
shell: bash

0 commit comments

Comments
 (0)