Skip to content

ci: add multi-platform (Windows, Mac, ARM64) support for GHA #8

ci: add multi-platform (Windows, Mac, ARM64) support for GHA

ci: add multi-platform (Windows, Mac, ARM64) support for GHA #8

Workflow file for this run

name: Build and Test
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
generate-data:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies
run: |
pip install modelscope transformers
- name: Generate Tests Data
run: |
cd tests
python generate_assets.py
- name: Upload models
uses: actions/upload-artifact@v4
with:
name: models
path: tests/models/
build-and-test:
needs: generate-data
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest, ubuntu-24.04-arm64]
ujson_use_rapidjson: ["OFF", "ON"]
runs-on: ${{ matrix.os }}
name: build-test (${{ matrix.os }}, RapidJSON=${{ matrix.ujson_use_rapidjson }})
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Download models
uses: actions/download-artifact@v4
with:
name: models
path: tests/models/
- name: Install build dependencies (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y cmake g++
- name: Configure
run: |
cmake -B build -DCMAKE_BUILD_TYPE=Release -DUJSON_USE_RAPIDJSON=${{ matrix.ujson_use_rapidjson }}
- name: Build
run: |
cmake --build build --config Release -j 4
- name: Run Tests
shell: bash
run: |
cd build
if [[ "${{ runner.os }}" == "Windows" ]]; then
./Release/test_main
else
./test_main
fi