Skip to content

Commit 059baa5

Browse files
committed
Run rust tests in CI
This commit also coincides with the creation of the "testing" environment which exposes a BN_SERIAL secret for pulling a headless Binary Ninja
1 parent 5b974d7 commit 059baa5

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

.github/workflows/rust.yml

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,25 @@ on:
1010
- 'rust/**'
1111

1212
jobs:
13-
# TODO: Cargo test (we would need to pull in binary ninja)
13+
# Check that code compiles and tests pass
14+
test:
15+
# The testing environment is used to access the BN_SERIAL secret.
16+
environment: testing
17+
name: cargo test
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v4
21+
# Pull in Binary Ninja
22+
- name: Setup Binary Ninja
23+
uses: Vector35/setup-binary-ninja@v1-beta
24+
with:
25+
license: '${{ secrets.BN_SERIAL }}'
26+
python-support: 'false'
27+
- uses: actions-rust-lang/setup-rust-toolchain@v1
28+
- name: Test
29+
# For now, we run the tests single threaded, there are some data races in core around platform types
30+
run: cargo test --all-features -- --test-threads=1
31+
1432
# Check lints with clippy
1533
clippy:
1634
name: cargo clippy
@@ -24,6 +42,7 @@ jobs:
2442
- name: Clippy Check
2543
uses: clechasseur/rs-clippy-check@v4
2644
with:
45+
# We do not run clippy on plugins.
2746
working-directory: ./rust
2847
args: --all-features
2948

@@ -39,8 +58,6 @@ jobs:
3958
components: rustfmt
4059
- name: Rustfmt Check
4160
uses: actions-rust-lang/rustfmt@v1
42-
with:
43-
manifest-path: ./rust/Cargo.toml
4461

4562
# Check spelling with typos
4663
spelling:

0 commit comments

Comments
 (0)