diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000000..3c4e779ca9 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,96 @@ +name: TileDB Python CI + +on: [push, pull_request, workflow_dispatch] + +concurrency: + group: ${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + build: + runs-on: ${{ matrix.os }} + defaults: + run: + shell: bash + strategy: + matrix: + os: [ubuntu-latest, macos-12, windows-latest] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + fail-fast: false + env: + # 11.7 necessary due to: https://github.com/actions/setup-python/issues/682#issuecomment-1604261330 + MACOSX_DEPLOYMENT_TARGET: ${{ matrix.os == 'macos-12' && matrix.python-version == '3.8' && '11.7' || '11' }} + #MACOSX_DEPLOYMENT_TARGET: "10.11" + # On windows-2019 we are using the Visual Studio generator, which is multi-config and places the build artifacts in a subdirectory + steps: + - name: Checkout TileDB-Py `dev` + uses: actions/checkout@v3 + + # By default Visual Studio chooses the earliest installed toolset version + # for the main build and vcpkg chooses the latest. Force it to use the + # latest (14.39 currently). + - name: Setup MSVC toolset (VS 2022) + uses: TheMrMilchmann/setup-msvc-dev@v3 + if: matrix.os == 'windows-latest' + with: + arch: x64 + toolset: 14.39 + + - name: Install Ninja (VS 2022) + uses: seanmiddleditch/gha-setup-ninja@v4 + if: matrix.os == 'windows-latest' + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + + - name: Print Python version + run: | + which python + which pip + python --version + + - name: Print env + run: printenv + + - name: Print pip debug info + run: pip debug --verbose + + # Remove after upstream PR fully-deployed: + # - https://github.com/actions/runner-images/pull/7125 + - name: "Install homebrew dependencies" + run: brew install pkg-config + if: matrix.os == 'macos-12' + + - name: "Install libfaketime (linux and macOS)" + if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-12' + run: | + git clone https://github.com/wolfcw/libfaketime/ + cd libfaketime + sudo make install + cd .. + + - name: "Build TileDB-Py" + run: pip install --verbose . + + - name: "Run tests" + run: | + PROJECT_CWD=$PWD + rm tiledb/__init__.py + cd /tmp + pytest -vv --showlocals $PROJECT_CWD + + - name: "Print log files (failed build only)" + run: | + set -xeo pipefail + # Display log files if the build failed + echo 'Dumping log files for failed build' + echo '----------------------------------' + for f in $(find build -name *.log); + do echo '------' + echo $f + echo '======' + cat $f + done; + if: failure()