From 6bd3556a8abd6b3d4911fc8a8a623cc02a27385e Mon Sep 17 00:00:00 2001 From: e-strauss Date: Mon, 26 Jan 2026 22:17:29 +0100 Subject: [PATCH] new test setup --- .../workflows/{test.yml => python_tests.yml} | 16 +++-- .github/workflows/rust_tests.yml | 63 +++++++++++++++++++ 2 files changed, 70 insertions(+), 9 deletions(-) rename .github/workflows/{test.yml => python_tests.yml} (95%) create mode 100644 .github/workflows/rust_tests.yml diff --git a/.github/workflows/test.yml b/.github/workflows/python_tests.yml similarity index 95% rename from .github/workflows/test.yml rename to .github/workflows/python_tests.yml index 5179ccd7..cf472fc9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/python_tests.yml @@ -1,4 +1,4 @@ -name: Build & Test (Rust + Python) +name: Python Tests on: push: @@ -9,6 +9,7 @@ on: - 'benchmarks/**' - '.gitignore' - 'LICENSE' + - '_rust/**' branches: [main, master] pull_request: paths-ignore: @@ -18,11 +19,12 @@ on: - 'benchmarks/**' - '.gitignore' - 'LICENSE' + - '_rust/**' branches: [main, master] workflow_dispatch: jobs: - build-test: + python-test: name: ${{ matrix.os }} / Python ${{ matrix.python-version }} runs-on: ${{ matrix.os }} strategy: @@ -77,10 +79,6 @@ jobs: - name: Install maturin run: uv pip install maturin - - name: Run Rust tests - working-directory: _rust - run: cargo test --release - - name: Build Rust extension shell: bash working-directory: _rust @@ -136,8 +134,8 @@ jobs: coverage-check: name: Coverage Threshold Check runs-on: ubuntu-latest - needs: build-test - if: needs.build-test.result == 'success' + needs: python-test + if: needs.python-test.result == 'success' steps: - name: Download coverage artifact @@ -180,4 +178,4 @@ jobs: sys.exit(1) else: print(f'SUCCESS: Coverage {coverage_percent:.2f}% meets threshold {threshold}%') - " \ No newline at end of file + " diff --git a/.github/workflows/rust_tests.yml b/.github/workflows/rust_tests.yml new file mode 100644 index 00000000..cbe78681 --- /dev/null +++ b/.github/workflows/rust_tests.yml @@ -0,0 +1,63 @@ +name: Rust Tests + +on: + push: + paths-ignore: + - 'docs/**' + - '*.md' + - 'examples/**' + - 'benchmarks/**' + - '.gitignore' + - 'LICENSE.txt' + - 'stratum/**' + - 'pyproject.toml' + - 'uv.lock' + branches: [main, master] + pull_request: + paths-ignore: + - 'docs/**' + - '*.md' + - 'examples/**' + - 'benchmarks/**' + - '.gitignore' + - 'LICENSE.txt' + - 'stratum/**' + - 'pyproject.toml' + - 'uv.lock' + branches: [main, master] + workflow_dispatch: + +jobs: + rust-test: + name: Rust Tests - ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: + - ubuntu-latest + - macos-14 + - windows-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install OS specific dependencies + if: matrix.os == 'macos-14' + run: | + brew update + brew install libomp + + - name: Cache Cargo build + uses: actions/cache@v4 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + _rust/target + key: ${{ runner.os }}-cargo-${{ hashFiles('_rust/Cargo.lock') }} + + - name: Run Rust tests + working-directory: _rust + run: cargo test --release