edits #77
Workflow file for this run
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: build-dependencies | |
| on: | |
| push: | |
| pull_request: | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Python | |
| if: matrix.os != 'windows-latest' | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.13" | |
| - name: Install system deps (Ubuntu) | |
| if: matrix.os == 'ubuntu-latest' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y build-essential cmake git pkg-config libgmp-dev zlib1g-dev libreadline-dev libboost-dev libboost-program-options-dev patchelf | |
| - name: Install system deps (macOS) | |
| if: matrix.os == 'macos-latest' | |
| run: | | |
| brew update | |
| brew install cmake gmp boost | |
| - name: Install Python deps | |
| if: matrix.os != 'windows-latest' | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install -r requirements.txt pybind11 | |
| - name: Clone and pin dependencies | |
| if: matrix.os != 'windows-latest' | |
| run: | | |
| python - <<'PY' | |
| import json | |
| import os | |
| import subprocess | |
| import sys | |
| from pathlib import Path | |
| with open("dependencies/dependency_pins.json", "r") as f: | |
| pins = json.load(f) | |
| def ensure_repo(path, url, rev): | |
| path = Path(path) | |
| if (path / ".git").exists(): | |
| subprocess.check_call(["git", "-C", str(path), "fetch", "--all", "--tags"]) | |
| elif not path.exists(): | |
| path.parent.mkdir(parents=True, exist_ok=True) | |
| subprocess.check_call(["git", "clone", url, str(path)]) | |
| else: | |
| print(f"Skipping {path} (not a git repo)", file=sys.stderr) | |
| return | |
| subprocess.check_call(["git", "-C", str(path), "checkout", rev]) | |
| if str(path) in {"dependencies/unique", "dependencies/manthan-preprocess"}: | |
| subprocess.check_call(["git", "-C", str(path), "submodule", "update", "--init", "--recursive"]) | |
| for entry in pins: | |
| ensure_repo(entry["path"], entry["url"], entry["rev"]) | |
| PY | |
| - name: Build dependencies (Ubuntu) | |
| if: matrix.os == 'ubuntu-latest' | |
| run: | | |
| ./scripts/build_dependencies_linux.sh | |
| - name: Build dependencies (macOS) | |
| if: matrix.os == 'macos-latest' | |
| run: | | |
| ./scripts/build_dependencies_macos.sh | |
| - name: Smoke test Manthan | |
| run: | | |
| python --version | |
| python manthan.py benchmarks/max64.qdimacs \ | |
| --maxsamples=10 \ | |
| --maxrepairitr=10 \ | |
| --adaptivesample=0 \ | |
| --weightedsampling=0 |