-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add GitHub Actions workflows for build and Clang format checks
- Loading branch information
Showing
2 changed files
with
72 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: Build | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
check-format: | ||
name: Check Formatting 🔍 | ||
uses: ./.github/workflows/clang-format-check.yaml | ||
permissions: | ||
contents: read | ||
|
||
build: | ||
|
||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
build_type: [Release, Debug] | ||
|
||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up CMake | ||
uses: jwlawson/actions-setup-cmake@v2 | ||
|
||
- name: Set up dependencies | ||
run: | | ||
if [ "${{ matrix.os }}" == "ubuntu-latest" ]; then | ||
sudo apt-get update | ||
sudo apt-get install -y cmake g++ wget | ||
elif [ "${{ matrix.os }}" == "macos-latest" ]; then | ||
brew update | ||
brew install cmake | ||
elif [ "${{ matrix.os }}" == "windows-latest" ]; then | ||
choco install cmake --installargs 'ADD_CMAKE_TO_PATH=System' | ||
fi | ||
- name: Configure CMake | ||
run: cmake -B build -S . -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} | ||
|
||
- name: Build | ||
run: cmake --build build --config ${{ matrix.build_type }} | ||
|
||
- name: Install | ||
run: cmake --install build --prefix dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: Clang Format Check | ||
|
||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
clang-format-check: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Clang | ||
run: sudo apt-get install -y clang-format | ||
|
||
- name: Run Clang Format | ||
run: | | ||
clang-format --version | ||
find ./src -name '*.cpp' -o -name '*.hpp' | xargs clang-format -i | ||
git diff --exit-code |