forked from jsanchezv/z80cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (56 loc) · 1.64 KB
/
code-quality.yml
File metadata and controls
68 lines (56 loc) · 1.64 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
name: Code Quality
on: [push, pull_request]
jobs:
formatting:
name: Check Code Formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install clang-format
run: sudo apt-get install -y clang-format
- name: Check formatting
run: |
files=$(find include tests -type f \( -name "*.cpp" -o -name "*.h" -o -name "*.tpp" \))
for file in $files; do
clang-format --dry-run -Werror "$file" || exit 1
done
echo "All files are properly formatted!"
static-analysis:
name: Static Analysis with clang-tidy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y clang-tidy cmake build-essential
- name: Build with compile_commands.json
run: |
mkdir -p build
cd build
cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON ..
make
- name: Run clang-tidy
run: |
cd build
files=$(find ../tests -type f -name "*.cpp")
clang-tidy -p . $files
build:
name: Build Project
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y cmake build-essential
- name: Build
run: |
mkdir -p build
cd build
cmake ..
make -j4
- name: Run tests
run: |
cd build
ctest --output-on-failure