Migrate third_party/ to git submodules. #383
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI for general build | |
on: | |
push: | |
branches: [ master ] | |
tags: | |
- 'v*' | |
pull_request: | |
branches: [ master ] | |
permissions: | |
contents: read | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ ubuntu-latest, ubuntu-24.04-arm, windows-latest, windows-11-arm, macos-latest ] | |
runs-on: ${{ matrix.os }} | |
permissions: | |
contents: write # svenstaro/upload-release-action | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: 'recursive' | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.x' | |
# architecture: ${{runner.arch}} | |
- name: Config for Windows (x64) | |
if: runner.os == 'Windows' && runner.arch == 'X64' | |
run: | | |
cmake -A x64 -B ${{github.workspace}}/build -DSPM_BUILD_TEST=ON -DBUILD_SHARED_LIBS=OFF -DSPM_ENABLE_SHARED=OFF -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/build/root | |
- name: Config for Windows (x64) | |
if: runner.os == 'Windows' && runner.arch == 'ARM64' | |
run: | | |
cmake -A arm64 -B ${{github.workspace}}/build -DSPM_BUILD_TEST=ON -DBUILD_SHARED_LIBS=OFF -DSPM_ENABLE_SHARED=OFF -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/build/root | |
- name: Config for Unix | |
if: runner.os != 'Windows' | |
run: cmake -B ${{github.workspace}}/build -DSPM_BUILD_TEST=ON -DBUILD_SHARED_LIBS=OFF -DSPM_ENABLE_SHARED=OFF -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/build/root | |
- name: Build | |
run: cmake --build ${{github.workspace}}/build --config Release --target install --parallel 8 | |
- name: Test | |
working-directory: ${{github.workspace}}/build | |
run: ctest -C Release --output-on-failure | |
env: | |
TEST_SRCDIR: ${{github.workspace}}/data | |
- name: Package | |
working-directory: ${{github.workspace}}/build | |
run: cpack | |
- name: Build Python wrapper | |
# Current the `wheel` pip package is not avaiable for windows arm, so skip. | |
if: runner.os != 'Windows' || runner.arch != 'ARM64' | |
working-directory: ${{github.workspace}}/python | |
run: | | |
python -m pip install --require-hashes --no-dependencies -r ../.github/workflows/requirements/base.txt | |
python setup.py build | |
python setup.py bdist_wheel | |
ls dist/*.whl | |
pip install $(ls dist/*.whl) | |
pushd test | |
python -m pytest | |
env: | |
GITHUB_REF_NAME: "${{github.ref_name}}" | |
- name: Upload artifcacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: "build-python-wrapper-artifacts-${{runner.os}}-${{runner.arch}}" | |
path: ./build/*.7z | |
- name: Upload Release Assets | |
if: startsWith(github.ref, 'refs/tags/') | |
uses: svenstaro/upload-release-action@04733e069f2d7f7f0b4aebc4fbdbce8613b03ccd # v2.9.0 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: ./build/*.7z | |
tag: ${{ github.ref }} | |
overwrite: true | |
prerelease: true | |
file_glob: true | |
body: "This is my release text" |