Skip to content

Commit

Permalink
cicd improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
BlaiseMuhirwa committed Nov 3, 2024
1 parent c992e51 commit 809e790
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 16 deletions.
48 changes: 33 additions & 15 deletions .github/workflows/cicd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,37 @@ env:
POETRY_VERSION: "1.6.1"

jobs:
test-clang-format:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
with:
submodules: 'recursive'

- name: Install clang-format and make
run: |
sudo apt-get update
sudo apt-get install -y clang-format make
- name: Check C++ Formatting
run: |
# Run the format-cpp Make target
make format-cpp
# Check if there are any changes after formatting
if ! git diff --exit-code; then
echo "Some files are not formatted correctly. Please run 'make format-cpp' and commit the changes."
exit 1
fi
test-python-library:
strategy:
# Ensure that failure for one test does not cancel other actions
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ['3.9', '3.10', '3.11']
os: [ubuntu-latest, macos-latest]
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Repository
Expand Down Expand Up @@ -52,7 +76,7 @@ jobs:
fail-fast: false
matrix:
# TODO: Would love to add macos here.
os: [ubuntu-latest]
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Repository
Expand All @@ -62,16 +86,10 @@ jobs:

- name: Install dependencies
run: |
# Install CMake and clang
./bin/install_clang_and_libomp.sh
./bin/install_cmake.sh
- name: Build flatnav
run: |
# Build flatnav as well as all tests and examples
./bin/build.sh -e -t
- name: Run Unit Tests
# Install CMake, Clang and LibOMP
make setup-clang-cmake-libomp
- name: Build and Run C++ Unit Tests
run: |
./build/test_distances
./build/test_serialization
set -ex
make run-cpp-unit-tests
10 changes: 9 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,12 @@ build-cpp:
./bin/build.sh -e -t

cmake-format:
cmake-format -i CMakeLists.txt
cmake-format -i CMakeLists.txt

run-cpp-unit-tests: build-cpp
./build/test_distances
./build/test_serialization

setup-clang-cmake-libomp:
./bin/install_clang_and_libomp.sh
./bin/install_cmake.sh

0 comments on commit 809e790

Please sign in to comment.