Skip to content

Commit

Permalink
[feat] add win workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
shenjunjiekoda committed Sep 4, 2024
1 parent 4692786 commit 9c27013
Showing 1 changed file with 72 additions and 0 deletions.
72 changes: 72 additions & 0 deletions .github/workflows/build-win.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Build on Windows
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build-win:
runs-on: windows-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4

- name: Install LLVM and Clang
uses: KyleMayes/install-llvm-action@v2
with:
version: "18.1.8"
directory: ${{ runner.temp }}/llvm

- name: Add LLVM to PATH
run: echo "${{ runner.temp }}/llvm/bin" >> $GITHUB_PATH

- name: Install Python
uses: actions/setup-python@v4
with:
python-version: 3.9

- name: Test LLVM
run: |
which clang
clang --version
clang-tidy --version
clang-format --version
- name: Spell Check
uses: crate-ci/[email protected]

- name: Clang Format
run: |
chmod +x scripts/run-clang-format
scripts/run-clang-format
- name: Install GMP
run: |
choco install gmp
echo "C:\Program Files\GMP\include" >> $GITHUB_PATH
- name: Build Repo
run: |
cmake -DCMAKE_BUILD_TYPE:STRING=Release \
-DLINK_LLVM_DYLIB=ON -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE \
-DLLVM_BUILD_DIR=${{ runner.temp }}/llvm \
-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/

0 comments on commit 9c27013

Please sign in to comment.