Skip to content

Commit

Permalink
[feat] add macos workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
shenjunjiekoda committed Sep 4, 2024
1 parent 921b62e commit 79dbddb
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 1 deletion.
59 changes: 59 additions & 0 deletions .github/workflows/build-macos.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Build on Mac OS
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build-mac:
runs-on: macos-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4

- name: Install Dependencies
run: |
brew update
brew install \
cmake gmp \
llvm@18
- name: Test LLVM
run: |
echo "/opt/homebrew/opt/llvm@18/bin" >> $GITHUB_PATH
clang --version
llvm-config --bindir
- name: Spell Check
uses: crate-ci/[email protected]

- name: Clang Format
run: |
chmod +x scripts/run-clang-format
scripts/run-clang-format
- name: Build Repo
run: |
cmake -DCMAKE_BUILD_TYPE:STRING=Release \
-DLINK_LLVM_DYLIB=ON -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE \
-DCMAKE_INSTALL_PREFIX="/opt/knight" -DLLVM_BUILD_DIR="/opt/homebrew/opt/llvm@18" \
-B build
cmake --build build -j16
echo $(pwd)/build/bin >> $GITHUB_PATH
- name: Clang Tidy
run: |
chmod +x scripts/run-clang-tidy
scripts/run-clang-tidy -j16
- name: Test Binary
run: |
knight --help
- name: Unit Tests
run: |
pwd
chmod +x scripts/unittest
scripts/unittest run test/testcase/

1 change: 0 additions & 1 deletion .github/workflows/build-ubuntu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ jobs:
run: |
cmake -DCMAKE_BUILD_TYPE:STRING=Release -DLINK_LLVM_DYLIB=ON -DCMAKE_C_COMPILER:STRING=/usr/bin/gcc -DCMAKE_CXX_COMPILER:STRING=/usr/bin/g++ -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -DCMAKE_INSTALL_PREFIX="/opt/knight" -DLLVM_BUILD_DIR="/usr/lib/llvm-18" -B build
cmake --build build -j16
cmake --install build
echo $(pwd)/build/bin >> $GITHUB_PATH
- name: Clang Tidy
Expand Down

0 comments on commit 79dbddb

Please sign in to comment.