feat: add SDOM bad-scaling variant and dataset fetch script #400
This file contains hidden or 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: Continuous Integration | |
| on: | |
| pull_request: | |
| paths: | |
| - "crates/**" | |
| - "bindings/python/**" | |
| - "Cargo.toml" | |
| - "Cargo.lock" | |
| - "justfile" | |
| - ".github/workflows/ci.yaml" | |
| - ".github/actions/**" | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - "crates/**" | |
| - "bindings/python/**" | |
| - "Cargo.toml" | |
| - "Cargo.lock" | |
| - "justfile" | |
| - ".github/workflows/ci.yaml" | |
| - ".github/actions/**" | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref_name }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| env: | |
| UV_VERSION: "0.9.4" | |
| JUST_VERSION: "1.43.0" | |
| PYTHON_LATEST: "3.12" | |
| RUST_TOOLCHAIN_VERSION: "1.85" | |
| jobs: | |
| version-consistency: | |
| name: Version consistency | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 2 | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| with: | |
| persist-credentials: false | |
| - name: Validate Cargo.toml and pyproject.toml versions match | |
| run: | | |
| set -euo pipefail | |
| cargo_version="$(awk -F '"' ' | |
| /^\[workspace\.package\]$/ { in_ws = 1; next } | |
| /^\[/ && in_ws { in_ws = 0 } | |
| in_ws && /^version = / { print $2; exit } | |
| ' Cargo.toml)" | |
| pyproject_version="$(awk -F '"' ' | |
| /^\[project\]$/ { in_proj = 1; next } | |
| /^\[/ && in_proj { in_proj = 0 } | |
| in_proj && /^version = / { print $2; exit } | |
| ' bindings/python/pyproject.toml)" | |
| [[ -n "$cargo_version" ]] || { echo "::error::Could not read workspace version from Cargo.toml"; exit 1; } | |
| [[ -n "$pyproject_version" ]] || { echo "::error::Could not read version from pyproject.toml"; exit 1; } | |
| [[ "$cargo_version" == "$pyproject_version" ]] || { echo "::error::Version mismatch: Cargo.toml=$cargo_version pyproject.toml=$pyproject_version"; exit 1; } | |
| echo "Versions match: $cargo_version" | |
| rust-fmt: | |
| name: Rust formatting | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| with: | |
| persist-credentials: false | |
| - name: Set up Rust toolchain | |
| run: | | |
| rustup toolchain install "$RUST_TOOLCHAIN_VERSION" --profile minimal | |
| rustup component add rustfmt --toolchain "$RUST_TOOLCHAIN_VERSION" | |
| rustup default "$RUST_TOOLCHAIN_VERSION" | |
| - name: Check Rust formatting | |
| run: cargo +"$RUST_TOOLCHAIN_VERSION" fmt --all -- --check | |
| rust-clippy: | |
| name: Rust clippy (${{ matrix.target.name }}) | |
| needs: [rust-fmt, version-consistency] | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| target: | |
| - name: core | |
| command: just clippy-core | |
| apt-deps: "" | |
| fflags: "" | |
| - name: arco-ipopt | |
| command: just clippy-solver arco-ipopt | |
| # Build IPOPT from source via ipopt-sys; the Ubuntu 24.04 system | |
| # package (3.11.9) has a memory corruption bug with MUMPS >= 5.1.0. | |
| apt-deps: liblapack-dev libopenblas-dev gfortran | |
| # MUMPS 4.10.0 (bundled by ipopt-sys) has type mismatches that | |
| # GCC 14 rejects by default (-fallow-argument-mismatch). | |
| fflags: "-fallow-argument-mismatch" | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| with: | |
| persist-credentials: false | |
| - name: Install system dependencies | |
| if: matrix.target.apt-deps != '' | |
| env: | |
| MATRIX_APT_DEPS: ${{ matrix.target.apt-deps }} | |
| run: | | |
| set -euo pipefail | |
| sudo apt-get update -qq | |
| read -r -a apt_deps <<< "$MATRIX_APT_DEPS" | |
| sudo apt-get install -y --no-install-recommends "${apt_deps[@]}" | |
| - name: Set up build environment | |
| uses: ./.github/actions/setup-build-env | |
| with: | |
| python-version: ${{ env.PYTHON_LATEST }} | |
| uv-version: ${{ env.UV_VERSION }} | |
| just-version: ${{ env.JUST_VERSION }} | |
| rust-toolchain-version: ${{ env.RUST_TOOLCHAIN_VERSION }} | |
| install-uv: "false" | |
| sync-python-licenses: "false" | |
| rust-cache-shared-key: rust-clippy | |
| - name: Run clippy (${{ matrix.target.name }}) | |
| env: | |
| MATRIX_TARGET_NAME: ${{ matrix.target.name }} | |
| FFLAGS: ${{ matrix.target.fflags }} | |
| FCFLAGS: ${{ matrix.target.fflags }} | |
| run: | | |
| set -euo pipefail | |
| case "$MATRIX_TARGET_NAME" in | |
| core) just clippy-core ;; | |
| arco-ipopt) just clippy-solver arco-ipopt ;; | |
| *) | |
| echo "::error::Unknown clippy target: $MATRIX_TARGET_NAME" | |
| exit 1 | |
| ;; | |
| esac | |
| rust-test: | |
| name: Rust tests (${{ matrix.target.name }}) | |
| needs: [rust-fmt, version-consistency] | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| target: | |
| - name: core | |
| command: just test-core | |
| apt-deps: "" | |
| fflags: "" | |
| - name: arco-ipopt | |
| command: just test-solver arco-ipopt | |
| # Build IPOPT from source via ipopt-sys; the Ubuntu 24.04 system | |
| # package (3.11.9) has a memory corruption bug with MUMPS >= 5.1.0. | |
| apt-deps: liblapack-dev libopenblas-dev gfortran | |
| # MUMPS 4.10.0 (bundled by ipopt-sys) has type mismatches that | |
| # GCC 14 rejects by default (-fallow-argument-mismatch). | |
| fflags: "-fallow-argument-mismatch" | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| with: | |
| persist-credentials: false | |
| - name: Install system dependencies | |
| if: matrix.target.apt-deps != '' | |
| env: | |
| MATRIX_APT_DEPS: ${{ matrix.target.apt-deps }} | |
| run: | | |
| set -euo pipefail | |
| sudo apt-get update -qq | |
| read -r -a apt_deps <<< "$MATRIX_APT_DEPS" | |
| sudo apt-get install -y --no-install-recommends "${apt_deps[@]}" | |
| - name: Set up build environment | |
| uses: ./.github/actions/setup-build-env | |
| with: | |
| python-version: ${{ env.PYTHON_LATEST }} | |
| uv-version: ${{ env.UV_VERSION }} | |
| just-version: ${{ env.JUST_VERSION }} | |
| rust-toolchain-version: ${{ env.RUST_TOOLCHAIN_VERSION }} | |
| install-uv: "true" | |
| sync-python-licenses: "false" | |
| rust-cache-shared-key: rust-clippy | |
| save-rust-cache: "false" | |
| - name: Run tests (${{ matrix.target.name }}) | |
| env: | |
| MATRIX_TARGET_NAME: ${{ matrix.target.name }} | |
| FFLAGS: ${{ matrix.target.fflags }} | |
| FCFLAGS: ${{ matrix.target.fflags }} | |
| run: | | |
| set -euo pipefail | |
| case "$MATRIX_TARGET_NAME" in | |
| core) just test-core ;; | |
| arco-ipopt) just test-solver arco-ipopt ;; | |
| *) | |
| echo "::error::Unknown test target: $MATRIX_TARGET_NAME" | |
| exit 1 | |
| ;; | |
| esac | |
| python-validation: | |
| name: Python validation (py${{ matrix.python-version }}) | |
| needs: [version-consistency] | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| with: | |
| persist-credentials: false | |
| - name: Set up build environment | |
| uses: ./.github/actions/setup-build-env | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| uv-version: ${{ env.UV_VERSION }} | |
| just-version: ${{ env.JUST_VERSION }} | |
| rust-toolchain-version: ${{ env.RUST_TOOLCHAIN_VERSION }} | |
| rust-cache-shared-key: rust-clippy | |
| save-uv-cache: "false" | |
| save-rust-cache: "false" | |
| - name: Run Python quality checks | |
| run: just py-check | |
| - name: Verify pre-commit config | |
| run: uvx --from pre-commit pre-commit validate-config | |
| - name: Build wheel and validate import | |
| run: just py-validate-wheel "dist/*.whl" | |
| - name: Run docs doctests | |
| if: matrix.python-version == '3.12' | |
| run: just py-doctest-ci |