diff --git a/.github/workflows/pylucid-test.yml b/.github/workflows/pylucid-test.yml new file mode 100644 index 00000000..0a55b904 --- /dev/null +++ b/.github/workflows/pylucid-test.yml @@ -0,0 +1,108 @@ +name: pylucid test CI + +on: + workflow_dispatch: + push: + branches: [main] + paths: + - "lucid/**" + - "bindings/pylucid/**" + - "test/**" + pull_request: + branches: [main] + paths: + - "lucid/**" + - "bindings/pylucid/**" + - "test/**" + +env: + LUCID_FLAGS: --enable_gurobi_build=False --enable_matplotlib_build=False + +jobs: + test: + runs-on: ${{ matrix.os }} + if: false # TODO: enable this again + strategy: + matrix: + os: + - ubuntu-latest + - macos-latest + - windows-latest + python_version: + - "3.9" + - "3.13" + # - "3.14" Need to upgrade gurobi to 13 first + + steps: + - uses: actions/checkout@v6 + - uses: ./.github/actions/bazel-cache + if: matrix.os != 'windows-latest' + - uses: ./.github/actions/frontend-setup + if: matrix.os == 'windows-latest' + - name: Install openmp on macOS + if: matrix.os == 'macos-latest' + run: | + brew install llvm libomp + export CC=/usr/local/opt/llvm/bin/clang + export CXX=/usr/local/opt/llvm/bin/clang++ + - name: Run tests + run: | + bazel test --config=py --python_version=${{ matrix.python_version }} ${{ env.LUCID_FLAGS }} //tests/bindings/pylucid/... + + build: + runs-on: ${{ matrix.os }} + # needs: test # TODO: enable this again + strategy: + fail-fast: false + matrix: + os: + - ubuntu-22.04 + - macos-latest + - windows-latest + python_version: + - "3.9" + - "3.13" + # - "3.14" Need to upgrade gurobi to 13 first + + steps: + - uses: actions/checkout@v6 + - uses: ./.github/actions/gurobi-lib + id: gurobi-lib + with: + os: ${{ matrix.os }} + version: "12.0.0" + - uses: ./.github/actions/bazel-cache + - uses: ./.github/actions/frontend-setup + if: matrix.os == 'windows-latest' + + # - name: Install openmp on macOS + # if: matrix.os == 'macos-latest' + # run: | + # brew install llvm libomp + # export CC=/usr/local/opt/llvm/bin/clang + # export CXX=/usr/local/opt/llvm/bin/clang++ + + - name: Install python + uses: actions/setup-python@v6 + with: + python-version: "${{ matrix.python_version }}" + cache: "pip" + - name: Upgrade pip + run: python -m pip install --upgrade pip + + - name: Install pip dependencies + run: | + python -m pip install --upgrade pip + pip install build setuptools wheel twine + + - name: Build a binary wheel and a source tarball + run: python3 -m build + env: + GUROBI_HOME: ${{ steps.gurobi-lib.outputs.gurobi-home }} + LD_LIBRARY_PATH: ${{ steps.gurobi-lib.outputs.gurobi-home }}/lib + + - name: Store the distribution packages + uses: actions/upload-artifact@v7 + with: + name: python-package-${{ matrix.os }}-${{ matrix.python_version }} + path: dist/ diff --git a/tools/requirements.txt b/tools/requirements.txt index 15cda3d3..3742b18c 100644 --- a/tools/requirements.txt +++ b/tools/requirements.txt @@ -17,7 +17,7 @@ pillow<=11.2.1 pyparsing<=3.2.3 python-dateutil<=2.9.0.post0 six<=1.17.0 -tornado<=6.5.3 +tornado<=6.5.5 scikit-learn<=1.6.1 joblib<=1.5.3 scipy<=1.15.2