forked from rustnn/rustnn
-
Notifications
You must be signed in to change notification settings - Fork 0
148 lines (119 loc) · 4.32 KB
/
Copy pathci.yml
File metadata and controls
148 lines (119 loc) · 4.32 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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
# Rust tests
rust-test:
name: Rust Tests (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
env:
RUSTFLAGS: -D warnings
steps:
- uses: actions/checkout@v4
- name: Install Rust MSRV
uses: dtolnay/rust-toolchain@1.95.0
- name: Install Rust test toolchain
uses: dtolnay/rust-toolchain@1.96.0
- name: Install Rust formatting toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- name: Install protobuf compiler (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y protobuf-compiler
protoc --version
- name: Install protobuf/flatbuffer compiler (macOS)
if: runner.os == 'macOS'
run: |
brew install protobuf flatbuffers
protoc --version
- name: Install flatc
if: runner.os == 'Linux'
run: |
curl -sSL "https://github.com/google/flatbuffers/releases/download/v25.12.19/Linux.flatc.binary.clang++-18.zip" -o /tmp/flatc.zip
sudo unzip -o /tmp/flatc.zip flatc -d /usr/local/bin
sudo chmod +x /usr/local/bin/flatc
flatc --version
- name: Cache cargo registry
uses: actions/cache@v4
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo index
uses: actions/cache@v4
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo build
uses: actions/cache@v4
with:
path: target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
- name: Is Cargo.lock consistent with Cargo.toml?
run: cargo +1.95.0 fetch --locked
- name: Run cargo fmt check
run: cargo +stable fmt --all -- --check
- name: Run cargo check
run: cargo +1.95.0 check
- name: Run cargo check (explicitly without dynamic-inputs)
run: cargo +1.95.0 check --no-default-features
- name: Run cargo check (onnx-runtime without dynamic-inputs)
run: cargo +1.95.0 check --no-default-features --features onnx-runtime
- name: Run cargo check (TensorRT)
run: cargo +1.95.0 check -F trtx-runtime
- name: Run cargo check (LiteRT)
run: cargo +1.95.0 check --features litert-runtime
- name: Run cargo check (CoreML)
if: runner.os == 'macOS'
run: cargo +1.95.0 check --features coreml-runtime
- name: Run cargo test (library only)
run: cargo +1.96.0 test --lib
- name: Run cargo test (library only, CoreML)
if: runner.os == 'macOS'
run: cargo +1.96.0 test --lib --features coreml-runtime
- name: Check backend operator report is up to date
if: runner.os == 'Linux'
run: |
python3 scripts/generate_backend_operator_report.py --check
- name: Run backend operator report parser tests
if: runner.os == 'Linux'
run: |
python3 -m unittest scripts/test_generate_backend_operator_report.py
docs-test:
name: Test Documentation Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install dependencies
run: pip install -r docs/requirements.txt
- name: Build documentation
run: mkdocs build --strict
# Check that version in pyproject.toml matches git tag (for releases)
version-check:
name: Version Check
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v4
- name: Check version matches tag
run: |
TAG=${GITHUB_REF#refs/tags/v}
VERSION=$(grep '^version = ' pyproject.toml | sed 's/version = "\(.*\)"/\1/')
if [ "$TAG" != "$VERSION" ]; then
echo "Error: Tag version ($TAG) does not match pyproject.toml version ($VERSION)"
exit 1
fi
echo "Version check passed: $VERSION"