-
Notifications
You must be signed in to change notification settings - Fork 5
132 lines (117 loc) · 3.39 KB
/
tests.yml
File metadata and controls
132 lines (117 loc) · 3.39 KB
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
on: [push, pull_request]
name: Tests and linting
jobs:
test:
name: Test Suite
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
wasm/node_modules
wasm/target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}
- run: cargo test
lints:
name: Lints
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Run cargo fmt
run: cargo fmt --all -- --check
- name: Run cargo clippy
run: cargo clippy -- -D warnings
- name: Run cargo fmt (python)
run: cargo fmt --all -- --check
working-directory: ./python
- name: Run cargo clippy (python)
run: cargo clippy -- -D warnings
working-directory: ./python
- name: Run cargo fmt (wasm)
run: cargo fmt --all -- --check
working-directory: ./wasm
- name: Run cargo clippy (wasm)
run: cargo clippy -- -D warnings
working-directory: ./wasm
flatbuffers:
name: Check FlatBuffers generated file
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Install unzip
run: sudo apt update && sudo apt install unzip
- name: Get flatc
run: wget https://github.com/google/flatbuffers/releases/download/v25.2.10/Linux.flatc.binary.g++-13.zip && unzip Linux.flatc.binary.g++-13.zip
- name: Generate rust code from schema
run: ./flatc --rust schema/lrs.fbs
- name: Ensure same output as commited
run: diff src/lrs_generated.rs lrs_generated.rs
reuse:
name: REUSE
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: REUSE Compliance Check
uses: fsfe/reuse-action@v4
version:
name: Check binding's versions
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Check versions
run: python check_versions.py
python-build:
name: Build python release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
args: --release
working-directory: "./python"
python-test:
name: Test python bindings
runs-on: ubuntu-latest
defaults:
run:
working-directory: "./python"
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v6
- name: Install dependencies
run: uv sync
- name: Install liblrs
run: uv run maturin develop
- name: Run the tests
run: uv run pytest
- name: Check stubs are up-to-date
run: |
cargo run --bin stub_gen
git diff --exit-code
wasm:
name: Build wasm release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: npm install
working-directory: ./wasm
- name: Build
run: npm run build
working-directory: ./wasm