Skip to content

Commit 8e2ec56

Browse files
committed
Update tests
1 parent f900244 commit 8e2ec56

2 files changed

Lines changed: 48 additions & 58 deletions

File tree

.github/actions/tests/action.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: "Run Python and Rust Tests"
2+
description: "Standardized test suite with strict shell"
3+
inputs:
4+
python-version:
5+
description: "Python version to use"
6+
required: true
7+
8+
runs:
9+
using: "composite"
10+
steps:
11+
- name: Set up Python ${{ inputs.python-version }}
12+
uses: actions/setup-python@v5
13+
with:
14+
python-version: ${{ inputs.python-version }}
15+
cache: pip
16+
17+
- name: Install dependencies
18+
shell: bash -euxo pipefail {0}
19+
run: |
20+
python -m pip install --upgrade pip
21+
pip install -e .[tests]
22+
23+
- name: Set up Rust
24+
uses: dtolnay/rust-toolchain@stable
25+
26+
- name: Rust Cache
27+
uses: Swatinem/rust-cache@v2
28+
29+
- name: Run Tests
30+
shell: bash -euxo pipefail {0}
31+
run: |
32+
pytest tests/
33+
cargo test --workspace --locked

.github/workflows/tests.yml

Lines changed: 15 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ on:
1010

1111
env:
1212
REDIS_VERSION: 8.4.0
13-
PYTHON_VERSIONS: '["3.11","3.12","3.13","3.14"]'
1413

1514
jobs:
1615
# TODO: Add another job that will determine which tests to run based on push types and the changes that were made.
@@ -26,74 +25,32 @@ jobs:
2625
- uses: actions/setup-python@v5
2726
with:
2827
python-version: "3.13"
29-
- run: pip install -e .[dev]
30-
- run: scripts/check-prettier.sh
31-
- run: ruff check .
32-
- run: cargo fmt --all -- --check
33-
- run: cargo clippy --workspace -- -D warnings
28+
- run: |
29+
pip install -e .[dev]
30+
scripts/check-prettier.sh
31+
ruff check .
32+
cargo fmt --all -- --check
33+
cargo clippy --workspace -- -D warnings
3434
35-
tests-linux:
36-
runs-on: ubuntu-latest
35+
tests:
36+
name: ${{ matrix.os }} (Py ${{ matrix.python-version }})
3737
strategy:
38+
fail-fast: false
3839
matrix:
39-
python-version: ${{ fromJSON(env.PYTHON_VERSIONS) }}
40+
python-version: ["3.11", "3.12", "3.13", "3.14"]
41+
os: [ubuntu-latest, macos-15-intel, macos-latest]
42+
runs-on: ${{ matrix.os }}
4043
steps:
4144
- uses: actions/checkout@v4
42-
- uses: actions/setup-python@v5
43-
with:
44-
python-version: ${{ matrix.python-version }}
45-
cache: pip
46-
- run: python -m pip install --upgrade pip
47-
- uses: dtolnay/rust-toolchain@stable
48-
- uses: Swatinem/rust-cache@v2
49-
- run: pip install -e .[tests]
50-
- run: pytest tests/
51-
- run: cargo test --workspace --locked
5245

53-
tests-macos-x86_64:
54-
runs-on: macos-15-intel
55-
strategy:
56-
matrix:
57-
python-version: ${{ fromJSON(env.PYTHON_VERSIONS) }}
58-
steps:
59-
- uses: actions/checkout@v4
60-
- uses: actions/setup-python@v5
46+
- name: Run Test Suite
47+
uses: ./.github/actions/tests
6148
with:
6249
python-version: ${{ matrix.python-version }}
63-
cache: pip
64-
- run: python -m pip install --upgrade pip
65-
- uses: dtolnay/rust-toolchain@stable
66-
- uses: Swatinem/rust-cache@v2
67-
- run: pip install -e .[tests]
68-
- run: pytest tests/
69-
- run: cargo test --workspace --locked
70-
71-
tests-macos-aarch64:
72-
runs-on: macos-latest
73-
strategy:
74-
matrix:
75-
arch: [aarch64]
76-
python-version: ${{ fromJSON(env.PYTHON_VERSIONS) }}
77-
steps:
78-
- uses: actions/checkout@v4
79-
- uses: actions/setup-python@v5
80-
with:
81-
python-version: ${{ matrix.python-version }}
82-
cache: pip
83-
- run: python -m pip install --upgrade pip
84-
- uses: dtolnay/rust-toolchain@stable
85-
- uses: Swatinem/rust-cache@v2
86-
- run: pip install -e .[tests]
87-
- run: pytest tests/
88-
- run: cargo test --workspace --locked
8950

9051
tests-pass:
91-
needs:
92-
- check-style
93-
- tests-linux
94-
- tests-macos-x86_64
95-
- tests-macos-aarch64
9652
if: (github.repository_owner == 'ccxlv')
53+
needs: [check-style, tests]
9754
runs-on: ubuntu-latest
9855
steps:
9956
- run: echo "All tests passed ✅"

0 commit comments

Comments
 (0)