Build System Rework #616
This file contains 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: macOS | |
on: | |
push: | |
branches: | |
- main | |
- 'release-*' | |
paths: | |
- '.github/workflows/macos.yml' | |
- 'apis/**' | |
- 'libtiledbvcf/**' | |
pull_request: | |
paths: | |
- '.github/workflows/macos.yml' | |
- 'apis/**' | |
- 'libtiledbvcf/**' | |
workflow_dispatch: | |
env: | |
MACOSX_DEPLOYMENT_TARGET: "11" | |
jobs: | |
libtiledbvcf: | |
runs-on: macos-13 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup to build htslib from source | |
run: brew install autoconf automake | |
- name: Configure libtiledbvcf | |
run: | | |
cmake -S libtiledbvcf -B $(pwd)/libtiledbvcf/build \ | |
-D CMAKE_BUILD_TYPE=Debug \ | |
-D BUILD_SHARED_LIBS=ON \ | |
-D CMAKE_INSTALL_PREFIX=$(pwd)/dist \ | |
-D OVERRIDE_INSTALL_PREFIX=OFF \ | |
-D DOWNLOAD_TILEDB_PREBUILT=ON \ | |
-D TILEDBVCF_ENABLE_TESTS=ON \ | |
-D TILEDBVCF_SET_INSTALL_SUBPATH=OFF | |
- name: Build libtiledbvcf | |
run: cmake --build $(pwd)/libtiledbvcf/build -j 2 --config Debug | |
- name: Upload coredump as artifact if build failed | |
if: failure() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: coredump | |
path: libtiledbvcf/build/core | |
retention-days: 14 | |
if-no-files-found: error | |
- name: Install libtiledbvcf | |
run: cmake --install $(pwd)/libtiledbvcf/build --config Debug | |
- name: Upload libtiledbvcf as artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: libtiledbvcf | |
path: dist/* | |
retention-days: 14 | |
if-no-files-found: error | |
- name: Confirm linking | |
run: otool -L dist/lib/libtiledbvcf.dylib | |
- name: libtiledbvcf version | |
run: ./dist/bin/tiledbvcf version | |
- name: Install bcftools | |
run: brew install bcftools | |
- name: Unit tests | |
run: | | |
ctest --test-dir libtiledbvcf/build | |
- name: CLI tests (require bcftools) | |
run: | | |
# USAGE: run-cli-tests.sh <build-dir> <inputs-dir> | |
libtiledbvcf/test/run-cli-tests.sh libtiledbvcf/build libtiledbvcf/test/inputs | |
python: | |
runs-on: macos-13 | |
needs: libtiledbvcf | |
env: | |
DYLD_LIBRARY_PATH: "${{ github.workspace }}/dist/tiledbvcf/lib" | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # fetch everything for python setuptools_scm | |
- name: Download libtiledbvcf artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: libtiledbvcf | |
path: dist | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.11" | |
- name: Install libtiledb | |
uses: mamba-org/setup-micromamba@v1 | |
with: | |
environment-name: ci | |
create-args: tiledb | |
- name: Build tiledbvcf-py | |
env: | |
tiledbvcf_DIR: "${{ github.workspace }}/dist" | |
TileDB_DIR: "/Users/runner/micromamba/envs/ci/lib/cmake/TileDB" | |
run: | | |
python -m pip install -v --no-deps --config-settings=cmake.define.TILEDBVCF_ONLY_PYTHON_BINDINGS=ON .[test] | |
- name: Confirm linking | |
run: otool -L /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/tiledbvcf/libtiledbvcf.cpython-*-darwin.so | |
java: | |
runs-on: macos-13 | |
needs: libtiledbvcf | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Download libtiledbvcf artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: libtiledbvcf | |
path: dist | |
- name: Debug | |
run: | | |
ls -R dist | |
- name: Build dependencies | |
run: brew install autoconf automake | |
- name: Check format | |
run: cd apis/java && ./gradlew checkFormat | |
- name: Assemble | |
run: cd apis/java && ./gradlew assemble | |
- name: Test | |
run: cd apis/java && ./gradlew test | |
python-standalone: | |
runs-on: macos-13 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # fetch everything for python setuptools_scm | |
- name: Setup to build htslib from source | |
run: brew install autoconf automake | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.11" | |
- name: Build tiledbvcf-py | |
run: python -m pip install -v .[test] | |
- name: Confirm linking | |
run: | | |
otool -L /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/tiledbvcf/libtiledbvcf.cpython-*-darwin.so | |
otool -L /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/tiledbvcf/lib/libtiledb.dylib | |
- name: Version | |
run: python -c "import tiledbvcf; print(tiledbvcf.version)" | |
- name: Install bcftools (for tests) | |
run: brew install bcftools | |
- name: Test tiledbvcf-py | |
run: cd apis/python && pytest |