-
Notifications
You must be signed in to change notification settings - Fork 15
74 lines (61 loc) · 1.69 KB
/
build-test-rust-minimappers2.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: minimappers2
on:
pull_request:
branches: [ "main" ]
paths:
- minimappers2/src/
- minimappers2/Cargo.toml
- minimappers2/**
- .github/workflows/build-test-rust-minimappers2.yaml
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
RUSTFLAGS: -C debuginfo=0 # Do not produce debug symbols to keep memory usage down
RUST_BACKTRACE: 1
PYTHONUTF8: 1
CARGO_TERM_COLOR: always
defaults:
run:
working-directory: minimappers2
shell: bash
jobs:
test-python:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ['3.9', '3.12', '3.13']
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Create virtual environment
env:
BIN: ${{ matrix.os == 'windows-latest' && 'Scripts' || 'bin' }}
run: |
python -m venv .venv
echo "$GITHUB_WORKSPACE/minimappers2/.venv/$BIN" >> $GITHUB_PATH
echo "VIRTUAL_ENV=$GITHUB_WORKSPACE/minimappers2/.venv" >> $GITHUB_ENV
- name: Set up Rust
run: rustup show
- name: Cache Rust
uses: Swatinem/rust-cache@v2
with:
workspaces: minimappers2
save-if: ${{ github.ref_name == 'main' }}
- name: Install Python dependencies
run: |
pip install uv
uv pip install maturin
- name: Install minimappers2
run: maturin develop
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose