From 086fbbd691e7bad25a8fa1fcb82f0e488a97abff Mon Sep 17 00:00:00 2001 From: Alena Chaikouskaya Date: Wed, 7 Aug 2024 19:12:06 +0200 Subject: [PATCH] Add python CI build This is not the same as other workflows: - core.yaml builds with python turned off - wheels.yaml builds cpp core separately and then builds wheels - docs uses python build system, but no tests - big endian is the one also doing tests, but it is slow and runs on some oldish dependencies So additional workflow is the best option to test python build. --- .github/workflows/python.yaml | 66 +++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 .github/workflows/python.yaml diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml new file mode 100644 index 000000000..eb68b1661 --- /dev/null +++ b/.github/workflows/python.yaml @@ -0,0 +1,66 @@ +name: Build and test python +#Perform the same build as is advised in our docs + +on: + push: + branches: [master] + pull_request: + branches: [master] + workflow_dispatch: + +jobs: + build_python: + runs-on: ${{ matrix.os }} + + strategy: + matrix: + include: + - os: ubuntu-20.04 + + steps: + - uses: actions/checkout@v4 + + - name: Elevate privileges + run: | + echo "PRIVLEDGES=sudo" >> $GITHUB_ENV + + - uses: './.github/actions/build_core_dependencies' + with: + privileges: $PRIVLEDGES + + - uses: actions/setup-python@v5 + with: + python-version: '3.11' + + - name: Create python venv + shell: bash + run: | + python -m venv venv + . ./venv/bin/activate + python -m pip install --upgrade pip + python -m pip install --upgrade setuptools + python -m pip install -r python/requirements-dev.txt + which python + + - name: Configure dlisio + shell: bash + run: | + . ./venv/bin/activate + cmake -S . -B build \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ + -DBUILD_PYTHON=ON + + - name: Build dlisio + shell: bash + run: | + $PRIVLEDGES cmake \ + --build build \ + --parallel \ + --config Release + + - name: Test dlisio + shell: bash + run: | + cd build + ctest -C Release --output-on-failure --verbose