diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a7c3efc..b354079 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,20 +19,7 @@ jobs: uses: prefix-dev/setup-pixi@v0.9.0 with: pixi-version: "latest" - cache: true # Cache pixi installation - - - name: Cache pixi environment - uses: actions/cache@v4 - with: - path: | - ~/.pixi - .pixi - key: ${{ runner.os }}-pixi-${{ hashFiles('pixi.lock') }} - restore-keys: | - ${{ runner.os }}-pixi- - - - name: Install dependencies - run: pixi install + cache: false # pixi is too large to cache (contains CUDA toolkit) - name: Check formatting run: | diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 14fdd04..7fb18be 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -26,7 +26,8 @@ repos: # Run tests (pre-push hook) - id: test name: Run all tests - entry: scripts/test-quiet.sh + # reinstall genmetaballs to rebuild C++/CUDA code, then run tests + entry: bash -c "pixi reinstall genmetaballs && pixi run test" language: system pass_filenames: false always_run: true diff --git a/scripts/test-quiet.sh b/scripts/test-quiet.sh deleted file mode 100755 index 2f4ccc9..0000000 --- a/scripts/test-quiet.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash -# Run tests with minimal output on success, full output on failure - -set -e - -# Run ctest (not using --quiet to get summary) -CTEST_OUTPUT=$(pixi run ctest --test-dir build 2>&1) -CTEST_EXIT=$? - -if [ $CTEST_EXIT -ne 0 ]; then - echo "$CTEST_OUTPUT" - exit 1 -fi - -# Extract summary from ctest output (output to stderr so pre-commit shows it) -echo "C++/CUDA tests:" >&2 -echo "$CTEST_OUTPUT" | grep -E "(tests passed|Test #.*Passed)" | head -2 | sed 's/^/ /' >&2 - -# Run pytest with quiet flag -PYTEST_OUTPUT=$(pixi run pytest --quiet 2>&1) -PYTEST_EXIT=$? - -if [ $PYTEST_EXIT -ne 0 ]; then - echo "" >&2 - echo "Python tests:" >&2 - echo "$PYTEST_OUTPUT" >&2 - exit 1 -fi - -# Extract summary from pytest output (output to stderr so pre-commit shows it) -echo "Python tests:" >&2 -echo "$PYTEST_OUTPUT" | grep -E "(passed|failed)" | tail -1 | sed 's/^/ /' >&2 - -exit 0 -