-
Notifications
You must be signed in to change notification settings - Fork 7
119 lines (106 loc) · 2.87 KB
/
pr.yml
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
name: CI PR
on:
pull_request:
branches:
- main
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
env:
RUST_BACKTRACE: 1
jobs:
test:
name: Test Rust ${{ matrix.rust }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- { rust: nightly, os: ubuntu-latest }
steps:
- uses: actions/checkout@v4
- uses: hecrj/setup-rust-action@v2
with:
rust-version: ${{ matrix.rust }}
- run: cargo test --verbose
clippy:
name: Lint with clippy
runs-on: ubuntu-latest
env:
RUSTFLAGS: -Dwarnings
steps:
- uses: actions/checkout@v4
- uses: hecrj/setup-rust-action@v2
with:
components: clippy
rust-version: nightly
- run: cargo clippy --all-targets --verbose
rustfmt:
name: Verify code formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: hecrj/setup-rust-action@v2
with:
components: rustfmt
- run: cargo fmt --all -- --check
doc:
name: Verify crate documentation
runs-on: ubuntu-latest
env:
RUSTFLAGS: -Dwarnings
RUSTDOCFLAGS: -Dwarnings
steps:
- uses: actions/checkout@v4
- uses: hecrj/setup-rust-action@v2
with:
rust-version: nightly
- run: cargo doc --workspace
miri:
name: Check for undefined behaviour with miri
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: hecrj/setup-rust-action@v2
with:
components: miri
rust-version: nightly
- run: cargo miri setup
- run: cargo miri test
test-python:
name: Test python bindings
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: build python bindings
uses: PyO3/maturin-action@v1
with:
working-directory: "nemo-python"
- name: install python bindings
run: ls target/wheels/*.whl | xargs pip install
- name: run python tests
run: python -m unittest discover -s nemo-python/tests -v
pycodestyle:
name: Check python code formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: install pycodestyle
run: pip install pycodestyle
- name: run pycodestyle
run: pycodestyle nemo-python
wasm-pack:
name: Test wasm bindings
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- run: wasm-pack test --headless --chrome nemo-wasm
- run: wasm-pack test --headless --firefox nemo-wasm