Skip to content

Commit 017888e

Browse files
committed
Add Clang format and Continuous Integration
1 parent 0f24c85 commit 017888e

File tree

5 files changed

+46
-56
lines changed

5 files changed

+46
-56
lines changed

.github/workflows/clang_format.yml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Clang Format
2+
on:
3+
push:
4+
pull_request:
5+
jobs:
6+
clang-format:
7+
runs-on: ubuntu-latest
8+
defaults:
9+
run:
10+
shell: bash
11+
timeout-minutes: 1
12+
if: |
13+
contains(github.event.pull_request.body, 'FORCE_TEST_ACTIONS')
14+
steps:
15+
- name: Checking out repository
16+
uses: actions/checkout@v4
17+
- name: Install dependencies
18+
run : |
19+
sudo apt-get update && sudo apt-get install -yq clang clang-format
20+
- name: Run clang-format # Use pipx to get version that apt doesn't have by default
21+
run: clang-format --dry-run -Werror --verbose \
22+
$(git diff --name-only origin/main HEAD -- '*.cc' '*.hh' '*.hpp'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# This workflow will run tests.
2+
3+
name: Tests
4+
on:
5+
push:
6+
pull_request:
7+
jobs:
8+
run_tests:
9+
name: Run tests
10+
runs-on: ubunut-latest
11+
timeout-minutes: 5
12+
steps:
13+
- name: Checking out repository
14+
uses: actions/checkout@v4
15+
- name: Install dependencies
16+
run : |
17+
sudo apt-get update && sudo apt-get install -yq clang clang-format
18+
- name: Build everything
19+
run: |
20+
bazel build //...
21+
- name: Test C++
22+
run: |
23+
bazel test //...

.github/workflows/python-package.yml

-30
This file was deleted.

check.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ root=$(cd -- "$(dirname -- "$0")" && pwd)
1717
if [ $# -eq 0 ]; then
1818
# (Default) Run tests/
1919
./pythenv.sh "$PYTHON" -m pytest --pyargs hirm
20-
cd cxx && make tests
20+
cd cxx && bazel test :all
2121
elif [ ${1} = 'coverage' ]; then
2222
# Generate coverage report.
2323
./pythenv.sh coverage run --source=build/ -m pytest --pyargs hirm

cxx/tests/test_util_math.cc

-25
This file was deleted.

0 commit comments

Comments
 (0)