|
| 1 | +name: macOS |
| 2 | +on: |
| 3 | + push: |
| 4 | + paths: |
| 5 | + - '.github/workflows/macos.yml' |
| 6 | + - 'apis/**' |
| 7 | + - 'libtiledbvcf/**' |
| 8 | + pull_request: |
| 9 | + paths: |
| 10 | + - '.github/workflows/macos.yml' |
| 11 | + - 'apis/**' |
| 12 | + - 'libtiledbvcf/**' |
| 13 | + workflow_dispatch: |
| 14 | +env: |
| 15 | + MACOSX_DEPLOYMENT_TARGET: "11" |
| 16 | +jobs: |
| 17 | + libtiledbvcf: |
| 18 | + # Stuck on macos-11 because of the htslib dependency. The htslib |
| 19 | + # configuration step fails on macos-12 and macos-13 |
| 20 | + runs-on: macos-11 |
| 21 | + steps: |
| 22 | + - uses: actions/checkout@v3 |
| 23 | + - name: Configure libtiledbvcf |
| 24 | + run: | |
| 25 | + cmake -S libtiledbvcf -B $(pwd)/libtiledbvcf/build \ |
| 26 | + -D CMAKE_BUILD_TYPE=Debug \ |
| 27 | + -D CMAKE_INSTALL_PREFIX=$(pwd)/dist \ |
| 28 | + -D OVERRIDE_INSTALL_PREFIX=OFF \ |
| 29 | + -D DOWNLOAD_TILEDB_PREBUILT=ON |
| 30 | + - name: Build libtiledbvcf |
| 31 | + run: cmake --build $(pwd)/libtiledbvcf/build -j 2 --config Debug |
| 32 | + - name: Upload coredump as artifact if build failed |
| 33 | + if: failure() |
| 34 | + uses: actions/upload-artifact@v3 |
| 35 | + with: |
| 36 | + name: coredump |
| 37 | + path: libtiledbvcf/build/core |
| 38 | + retention-days: 14 |
| 39 | + if-no-files-found: error |
| 40 | + - name: Install libtiledbvcf |
| 41 | + run: cmake --build $(pwd)/libtiledbvcf/build --config Debug --target install-libtiledbvcf |
| 42 | + - name: Upload libtiledbvcf as artifact |
| 43 | + uses: actions/upload-artifact@v3 |
| 44 | + with: |
| 45 | + name: libtiledbvcf |
| 46 | + path: dist/* |
| 47 | + retention-days: 14 |
| 48 | + if-no-files-found: error |
| 49 | + - name: Confirm linking |
| 50 | + run: otool -L dist/lib/libtiledbvcf.dylib |
| 51 | + - name: libtiledbvcf version |
| 52 | + run: ./dist/bin/tiledbvcf version |
| 53 | + - name: Install bcftools |
| 54 | + run: brew install bcftools |
| 55 | + - name: Unit tests |
| 56 | + run: | |
| 57 | + make -j 2 -C libtiledbvcf/build/libtiledbvcf tiledb_vcf_unit |
| 58 | + ./libtiledbvcf/build/libtiledbvcf/test/tiledb_vcf_unit |
| 59 | + - name: CLI tests (require bcftools) |
| 60 | + run: | |
| 61 | + # USAGE: run-cli-tests.sh <build-dir> <inputs-dir> |
| 62 | + libtiledbvcf/test/run-cli-tests.sh libtiledbvcf/build libtiledbvcf/test/inputs |
| 63 | + python: |
| 64 | + runs-on: macos-11 |
| 65 | + needs: libtiledbvcf |
| 66 | + env: |
| 67 | + DYLD_LIBRARY_PATH: "${{ github.workspace }}/dist/lib" |
| 68 | + steps: |
| 69 | + - uses: actions/checkout@v3 |
| 70 | + with: |
| 71 | + fetch-depth: 0 # fetch everything for python setuptools_scm |
| 72 | + - name: Download libtiledbvcf artifact |
| 73 | + uses: actions/download-artifact@v3 |
| 74 | + with: |
| 75 | + name: libtiledbvcf |
| 76 | + path: dist |
| 77 | + - name: Set up Python |
| 78 | + uses: actions/setup-python@v4 |
| 79 | + with: |
| 80 | + python-version: "3.11" |
| 81 | + - name: Install dependencies |
| 82 | + run: python -m pip install --prefer-binary \ |
| 83 | + dask \ |
| 84 | + distributed \ |
| 85 | + 'fsspec<2023.3.0' \ |
| 86 | + pandas \ |
| 87 | + pyarrow==10.0.1 \ |
| 88 | + pyarrow-hotfix \ |
| 89 | + pybind11 \ |
| 90 | + pytest \ |
| 91 | + setuptools \ |
| 92 | + setuptools_scm \ |
| 93 | + setuptools_scm_git_archive \ |
| 94 | + wheel |
| 95 | + - name: Build tiledbvcf-py |
| 96 | + env: |
| 97 | + LIBTILEDBVCF_PATH: "${{ github.workspace }}/dist" |
| 98 | + run: | |
| 99 | + echo $DYLD_LIBRARY_PATH |
| 100 | + cd apis/python |
| 101 | + python -m pip install . |
| 102 | + - name: Confirm linking |
| 103 | + run: otool -L /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/tiledbvcf/libtiledbvcf.cpython-*-darwin.so |
| 104 | + java: |
| 105 | + runs-on: macos-11 |
| 106 | + needs: libtiledbvcf |
| 107 | + steps: |
| 108 | + - uses: actions/checkout@v3 |
| 109 | + - name: Download libtiledbvcf artifact |
| 110 | + uses: actions/download-artifact@v3 |
| 111 | + with: |
| 112 | + name: libtiledbvcf |
| 113 | + path: dist |
| 114 | + - name: Check format |
| 115 | + run: cd apis/java && ./gradlew checkFormat |
| 116 | + - name: Assemble |
| 117 | + run: cd apis/java && ./gradlew assemble |
| 118 | + - name: Test |
| 119 | + run: cd apis/java && ./gradlew test |
| 120 | + spark: |
| 121 | + runs-on: macos-11 |
| 122 | + needs: libtiledbvcf |
| 123 | + steps: |
| 124 | + - uses: actions/checkout@v3 |
| 125 | + - name: Download libtiledbvcf artifact |
| 126 | + uses: actions/download-artifact@v3 |
| 127 | + with: |
| 128 | + name: libtiledbvcf |
| 129 | + path: dist |
| 130 | + - name: Assemble |
| 131 | + run: cd apis/spark && ./gradlew assemble |
| 132 | + - name: Jar |
| 133 | + run: cd apis/spark && ./gradlew jar |
| 134 | + - name: Test |
| 135 | + run: cd apis/spark && ./gradlew test |
| 136 | + - name: Check format |
| 137 | + run: cd apis/spark && ./gradlew checkFormat |
| 138 | + spark3: |
| 139 | + runs-on: macos-11 |
| 140 | + needs: libtiledbvcf |
| 141 | + steps: |
| 142 | + - uses: actions/checkout@v3 |
| 143 | + - name: Download libtiledbvcf artifact |
| 144 | + uses: actions/download-artifact@v3 |
| 145 | + with: |
| 146 | + name: libtiledbvcf |
| 147 | + path: dist |
| 148 | + - name: Assemble |
| 149 | + run: cd apis/spark3 && ./gradlew assemble |
| 150 | + - name: Jar |
| 151 | + run: cd apis/spark3 && ./gradlew jar |
| 152 | + - name: Test |
| 153 | + run: cd apis/spark3 && ./gradlew test |
| 154 | + - name: Check format |
| 155 | + run: cd apis/spark3 && ./gradlew checkFormat |
| 156 | + python-standalone: |
| 157 | + runs-on: macos-11 |
| 158 | + steps: |
| 159 | + - uses: actions/checkout@v3 |
| 160 | + with: |
| 161 | + fetch-depth: 0 # fetch everything for python setuptools_scm |
| 162 | + - name: Set up Python |
| 163 | + uses: actions/setup-python@v4 |
| 164 | + with: |
| 165 | + python-version: "3.11" |
| 166 | + - name: Install dependencies |
| 167 | + run: python -m pip install --prefer-binary \ |
| 168 | + dask \ |
| 169 | + distributed \ |
| 170 | + 'fsspec<2023.3.0' \ |
| 171 | + pandas \ |
| 172 | + pyarrow==10.0.1 \ |
| 173 | + pyarrow-hotfix \ |
| 174 | + pybind11 \ |
| 175 | + pytest \ |
| 176 | + setuptools \ |
| 177 | + setuptools_scm \ |
| 178 | + setuptools_scm_git_archive \ |
| 179 | + wheel |
| 180 | + - name: Build tiledbvcf-py |
| 181 | + run: cd apis/python && python -m pip install . |
| 182 | + - name: Confirm linking |
| 183 | + run: | |
| 184 | + otool -L /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/tiledbvcf/libtiledbvcf.cpython-*-darwin.so |
| 185 | + otool -L /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/tiledbvcf/libtiledbvcf.dylib |
| 186 | + otool -L /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/tiledbvcf/libtiledb.dylib |
| 187 | + otool -L /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/tiledbvcf/libhts.*.dylib |
| 188 | + - name: Version |
| 189 | + run: python -c "import tiledbvcf; print(tiledbvcf.version)" |
| 190 | + - name: Install bcftools (for tests) |
| 191 | + run: brew install bcftools |
| 192 | + - name: Install tiledb-py |
| 193 | + run: pip install tiledb |
| 194 | + - name: Test tiledbvcf-py |
| 195 | + run: cd apis/python && pytest |
0 commit comments