forked from k2-fsa/k2
-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (52 loc) · 1.59 KB
/
style_check.yml
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
# Copyright (c) 2020 Fangjun Kuang (csukuangfj@gmail.com)
# See ../../LICENSE for clarification regarding multiple authors
name: style_check
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.5, 3.6, 3.7, 3.8]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 2
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install Python dependencies
run: |
python3 -m pip install --upgrade pip
pip install cpplint==1.4.5
- name: Install cppcheck
run: |
cd /tmp
git clone --depth 1 https://github.com/danmar/cppcheck.git
cd cppcheck
mkdir build
cd build
cmake ..
make -j
sudo make install
- name: Create Build Directory
run: cmake -E make_directory ${{runner.workspace}}/build
- name: Configure CMake
shell: bash
working-directory: ${{runner.workspace}}/build
run: cmake -DCMAKE_CXX_CPPLINT=cpplint $GITHUB_WORKSPACE
- name: Check style with cpplint
shell: bash
working-directory: ${{github.workspace}}
run: ./scripts/check_style_cpplint.sh ${{runner.workspace}}/build 1
- name: Run cppcheck
shell: bash
working-directory: ${{github.workspace}}
run: ./scripts/run_cppcheck.sh ${{runner.workspace}}/build