Skip to content

Commit 3c90481

Browse files
fengys1996fengyangsen
andauthored
ci: add develop ci (#18)
* add develop ci * fix: cr * fix: cr --------- Co-authored-by: fengyangsen <fys@fys.lan>
1 parent 9761434 commit 3c90481

1 file changed

Lines changed: 86 additions & 0 deletions

File tree

.github/workflows/dev.yml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
name: develop
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
types: [ opened, synchronize, reopened, ready_for_review ]
9+
branches:
10+
- main
11+
workflow_dispatch:
12+
13+
env:
14+
RUST_TOOLCHAIN: 1.94
15+
16+
jobs:
17+
toml:
18+
name: Toml Check
19+
runs-on: ubuntu-latest
20+
timeout-minutes: 10
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v4
24+
25+
- name: Install taplo
26+
run: cargo +stable install taplo-cli --version ^0.10 --locked
27+
28+
- name: Run taplo
29+
run: taplo format --check --option "indent_string= "
30+
31+
typos:
32+
name: Typos Check
33+
runs-on: ubuntu-latest
34+
timeout-minutes: 10
35+
steps:
36+
- name: Checkout
37+
uses: actions/checkout@v4
38+
39+
- name: Check typos
40+
uses: crate-ci/typos@master
41+
42+
clang-format:
43+
name: Clang Format Check
44+
runs-on: ubuntu-latest
45+
timeout-minutes: 10
46+
steps:
47+
- name: Checkout
48+
uses: actions/checkout@v4
49+
50+
- name: Install clang-format
51+
run: sudo apt-get update && sudo apt-get install -y clang-format
52+
53+
- name: Check clang-format
54+
run: find c/src -iname '*.h' -o -iname '*.c' | xargs clang-format -style=file --dry-run -Werror
55+
56+
cargo-check:
57+
if: github.event.pull_request.draft == false
58+
runs-on: ubuntu-latest
59+
timeout-minutes: 10
60+
defaults:
61+
run:
62+
working-directory: ffi
63+
steps:
64+
- name: Checkout
65+
uses: actions/checkout@v4
66+
67+
- name: Install Protobuf
68+
uses: arduino/setup-protoc@v2
69+
70+
- name: Install Rust toolchain
71+
uses: dtolnay/rust-toolchain@stable
72+
with:
73+
toolchain: ${{ env.RUST_TOOLCHAIN }}
74+
components: rustfmt, clippy
75+
76+
- name: Check format
77+
run: cargo fmt --check
78+
79+
- name: Check clippy
80+
run: cargo clippy --workspace --all-targets -- -D warnings -D clippy::print_stdout -D clippy::print_stderr
81+
82+
- name: Install latest nextest release
83+
uses: taiki-e/install-action@nextest
84+
85+
- name: Check test
86+
run: cargo nextest run

0 commit comments

Comments
 (0)