aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/ci.yml
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2022-01-17 01:49:37 +0800
committercrupest <crupest@outlook.com>2022-01-17 01:49:37 +0800
commit1d929ee2e71e8e18490ed1266175833e6ad5c609 (patch)
tree21ff8f4ff33b4bc570e3adc99f54a972bfa23dbd /.github/workflows/ci.yml
parent570e95f4551385a81eb2cf6f2e386e3b0cb291a8 (diff)
downloadcru-1d929ee2e71e8e18490ed1266175833e6ad5c609.tar.gz
cru-1d929ee2e71e8e18490ed1266175833e6ad5c609.tar.bz2
cru-1d929ee2e71e8e18490ed1266175833e6ad5c609.zip
...
Diffstat (limited to '.github/workflows/ci.yml')
-rw-r--r--.github/workflows/ci.yml69
1 files changed, 69 insertions, 0 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644
index 00000000..670a26ca
--- /dev/null
+++ b/.github/workflows/ci.yml
@@ -0,0 +1,69 @@
+name: CI
+
+on:
+ push:
+ branches: [main]
+ paths-ignore:
+ - "docs/**"
+ - "**/README.md"
+ pull_request:
+ branches: [main]
+ paths-ignore:
+ - "docs/**"
+ - "**/README.md"
+
+jobs:
+ macos-build:
+ name: Build
+ runs-on: macos-latest
+
+ steps:
+ - uses: actions/checkout@v2
+
+ - name: Restore Cache
+ uses: actions/cache@v2
+ with:
+ path: ~/.cache/vcpkg/archives
+ key: vcpkg-${{ runner.os }}
+
+ - name: Setup Ninja
+ uses: ashutoshvarma/setup-ninja@master
+ with:
+ version: 1.10.2
+
+ - name: Build
+ run: |
+ cmake -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_C_COMPILER:FILEPATH=/usr/bin/clang -DCMAKE_CXX_COMPILER:FILEPATH=/usr/bin/clang++ -H. -B./build -G Ninja
+ cmake --build ./build --config Debug --target all
+
+ - name: Test
+ working-directory: build
+ run: |
+ ctest -C Debug -T test --output-on-failure
+
+ windows-build:
+ name: Build
+ runs-on: windows-latest
+
+ steps:
+ - uses: actions/checkout@v2
+
+ - name: Restore Cache
+ uses: actions/cache@v2
+ with:
+ path: ~/AppData/Local/vcpkg/archives
+ key: vcpkg-${{ runner.os }}
+
+ - name: Setup Ninja
+ uses: ashutoshvarma/setup-ninja@master
+ with:
+ version: 1.10.2
+
+ - name: Run build script
+ shell: pwsh
+ run: |
+ . ./tools/Use-VC.ps1
+ Use-VC
+ mkdir build && cd build
+ cmake .. -G Ninja -DCMAKE_BUILD_TYPE:STRING=Debug
+ ninja all