53 lines
1.3 KiB
YAML
53 lines
1.3 KiB
YAML
name: PyTest
|
|
|
|
on: [push, pull_request, workflow_call]
|
|
|
|
jobs:
|
|
pytest:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
python-version: ["3.10", "3.12", "3.14"]
|
|
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
|
|
- name: Restore cache
|
|
uses: actions/cache/restore@v4
|
|
with:
|
|
path: |
|
|
~/.cache/pip
|
|
~/.cache/pip-wheel
|
|
~/.cache/sccache
|
|
~/.cache/cargo-xwin
|
|
~/.cargo
|
|
~/.osxcross
|
|
key: cache-ubuntu-maturin-cross-compile
|
|
|
|
- name: Install Rust
|
|
run: |
|
|
export PATH="$HOME/.cargo/bin:$PATH"
|
|
if ! command -v rustc >/dev/null 2>&1; then
|
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
|
else
|
|
rustup update
|
|
fi
|
|
rustup default stable
|
|
shell: bash
|
|
|
|
- name: "cargo test"
|
|
run: |-
|
|
export PATH="$HOME/.cargo/bin:$PATH"
|
|
cargo test
|
|
|
|
- name: Store cache
|
|
uses: actions/cache/save@v4
|
|
with:
|
|
path: |
|
|
~/.cache/pip
|
|
~/.cache/pip-wheel
|
|
~/.cache/sccache
|
|
~/.cache/cargo-xwin
|
|
~/.cargo
|
|
~/.osxcross
|
|
key: cache-ubuntu-maturin-cross-compile |