Make curvelops optional; install only in CurveLab CI job #161
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: ci | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: ["**"] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| test-basic: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.10", "3.12", "3.13"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y build-essential gcc g++ make wget curl unzip | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install --break-system-packages -e . | |
| python -m pip install --break-system-packages pytest pytest-cov ruff | |
| - name: Run basic tests (placeholder mode) | |
| env: | |
| TMEQ_RUN_CURVELETS: "0" | |
| QT_QPA_PLATFORM: "offscreen" | |
| run: | | |
| pytest -q -vv tests/curvealign_py/ tests/ctfire_py/ tests/test_unified_api.py | |
| # Secure build with CurveLab; skip on forked PRs (no secrets on forks). | |
| test-curvelab: | |
| if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }} | |
| runs-on: ubuntu-latest | |
| environment: secret-test | |
| strategy: | |
| matrix: | |
| python-version: ["3.10", "3.12"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y build-essential gcc g++ make wget curl unzip | |
| - name: Fetch CurveLab archive | |
| shell: bash | |
| env: | |
| FETCH_FDCT: ${{ secrets.FETCH_FDCT }} | |
| run: | | |
| set -euo pipefail | |
| if [ -z "${FETCH_FDCT}" ]; then | |
| echo "::error title=Missing secret::FETCH_FDCT is empty. Add the curl command under repo secrets." | |
| exit 1 | |
| fi | |
| mkdir -p utils | |
| cd utils | |
| eval "${FETCH_FDCT}" | |
| if [ ! -f "CurveLab-2.1.3.tar.gz" ]; then | |
| echo "::error title=CurveLab archive missing after FETCH_FDCT::Expected utils/CurveLab-2.1.3.tar.gz to exist after running FETCH_FDCT." | |
| echo "Files in utils/:" | |
| ls -la | |
| exit 1 | |
| fi | |
| if command -v file >/dev/null 2>&1; then | |
| echo "Downloaded archive mime-type:" | |
| file -b --mime-type "CurveLab-2.1.3.tar.gz" || true | |
| fi | |
| - name: Prepare FFTW + CurveLab toolchain | |
| run: | | |
| bash bin/ci_setup_curvelab.sh | |
| - name: Install Python dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install --break-system-packages -e ".[curvelab]" | |
| python -m pip install --break-system-packages pytest pytest-cov ruff | |
| - name: Test CurveLab compilation | |
| run: | | |
| echo "Testing CurveLab compilation..." | |
| test -f "utils/CurveLab-2.1.3/fdct_wrapping_cpp/src/fdct_wrapping_cpp" && echo "✅ fdct_wrapping_cpp built" || (echo "❌ fdct_wrapping_cpp missing"; exit 1) | |
| test -f "utils/CurveLab-2.1.3/fdct3d/src/fdct3d" && echo "✅ fdct3d built" || (echo "❌ fdct3d missing"; exit 1) | |
| - name: Run tests with CurveLab | |
| env: | |
| TMEQ_RUN_CURVELETS: "1" | |
| QT_QPA_PLATFORM: "offscreen" | |
| run: | | |
| python tests/test_curvelops_basic.py | |
| pytest -q -vv tests/curvealign_py/ tests/ctfire_py/ tests/test_unified_api.py tests/test_curvelops_basic.py |