Skip to content

Commit a60e190

Browse files
committed
feat(ci): add multi-platform (Windows, Mac, ARM64) support for github action.
1 parent 4fcd3d8 commit a60e190

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

.github/workflows/build.yml

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,12 @@ jobs:
3636

3737
build-and-test:
3838
needs: generate-data
39-
runs-on: ubuntu-latest
4039
strategy:
4140
matrix:
41+
os: [ubuntu-latest, macos-latest, windows-latest, ubuntu-24.04-arm64]
4242
ujson_use_rapidjson: ["OFF", "ON"]
43-
name: build-test (RapidJSON=${{ matrix.ujson_use_rapidjson }})
43+
runs-on: ${{ matrix.os }}
44+
name: build-test (${{ matrix.os }}, RapidJSON=${{ matrix.ujson_use_rapidjson }})
4445
steps:
4546
- uses: actions/checkout@v3
4647
with:
@@ -52,19 +53,26 @@ jobs:
5253
name: models
5354
path: tests/models/
5455

55-
- name: Install build dependencies
56+
- name: Install build dependencies (Linux)
57+
if: runner.os == 'Linux'
5658
run: |
5759
sudo apt-get update
5860
sudo apt-get install -y cmake g++
5961
62+
- name: Configure
63+
run: |
64+
cmake -B build -DCMAKE_BUILD_TYPE=Release -DUJSON_USE_RAPIDJSON=${{ matrix.ujson_use_rapidjson }}
65+
6066
- name: Build
6167
run: |
62-
mkdir build
63-
cd build
64-
cmake .. -DCMAKE_BUILD_TYPE=Release -DUJSON_USE_RAPIDJSON=${{ matrix.ujson_use_rapidjson }}
65-
make -j$(nproc)
68+
cmake --build build --config Release -j 4
6669
6770
- name: Run Tests
71+
shell: bash
6872
run: |
6973
cd build
70-
./test_main
74+
if [[ "${{ runner.os }}" == "Windows" ]]; then
75+
./Release/test_main
76+
else
77+
./test_main
78+
fi

0 commit comments

Comments
 (0)