Skip to content

Commit 8a2e4d1

Browse files
committed
Enable GitHub Actions
1 parent 9fcb94e commit 8a2e4d1

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-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 "\.(c|cxx|cpp|h|hpp)\$")
4+
5+
set -x
6+
7+
for file in ${SOURCES};
8+
do
9+
clang-format-12 ${file} > expected-format
10+
diff -u -p --label="${file}" --label="expected coding style" ${file} expected-format
11+
done
12+
exit $(clang-format-12 --output-replacements-xml ${SOURCES} | egrep -c "</replacement>")

.github/workflows/main.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: CI
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
nstack:
7+
runs-on: ubuntu-22.04
8+
steps:
9+
- uses: actions/checkout@v3.1.0
10+
- name: default build
11+
run: make
12+
coding_style:
13+
runs-on: ubuntu-22.04
14+
steps:
15+
- uses: actions/checkout@v3.1.0
16+
- name: coding convention
17+
run: |
18+
sudo apt-get install -q -y clang-format-12
19+
sh .ci/check-format.sh
20+
shell: bash

0 commit comments

Comments
 (0)