Skip to content

Commit

Permalink
Add Clang format and Continuous Integration
Browse files Browse the repository at this point in the history
  • Loading branch information
srvasude committed May 29, 2024
1 parent 0f24c85 commit 017888e
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 56 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/clang_format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Clang Format
on:
push:
pull_request:
jobs:
clang-format:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
timeout-minutes: 1
if: |
contains(github.event.pull_request.body, 'FORCE_TEST_ACTIONS')
steps:
- name: Checking out repository
uses: actions/checkout@v4
- name: Install dependencies
run : |
sudo apt-get update && sudo apt-get install -yq clang clang-format
- name: Run clang-format # Use pipx to get version that apt doesn't have by default
run: clang-format --dry-run -Werror --verbose \
$(git diff --name-only origin/main HEAD -- '*.cc' '*.hh' '*.hpp'
23 changes: 23 additions & 0 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# This workflow will run tests.

name: Tests
on:
push:
pull_request:
jobs:
run_tests:
name: Run tests
runs-on: ubunut-latest
timeout-minutes: 5
steps:
- name: Checking out repository
uses: actions/checkout@v4
- name: Install dependencies
run : |
sudo apt-get update && sudo apt-get install -yq clang clang-format
- name: Build everything
run: |
bazel build //...
- name: Test C++
run: |
bazel test //...
30 changes: 0 additions & 30 deletions .github/workflows/python-package.yml

This file was deleted.

2 changes: 1 addition & 1 deletion check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ root=$(cd -- "$(dirname -- "$0")" && pwd)
if [ $# -eq 0 ]; then
# (Default) Run tests/
./pythenv.sh "$PYTHON" -m pytest --pyargs hirm
cd cxx && make tests
cd cxx && bazel test :all
elif [ ${1} = 'coverage' ]; then
# Generate coverage report.
./pythenv.sh coverage run --source=build/ -m pytest --pyargs hirm
Expand Down
25 changes: 0 additions & 25 deletions cxx/tests/test_util_math.cc

This file was deleted.

0 comments on commit 017888e

Please sign in to comment.