Skip to content

Commit 60f4e5f

Browse files
slpalyssarosenzweig
authored andcommitted
ci: add format and clippy check
Signed-off-by: Sergio Lopez <[email protected]>
1 parent 8f97547 commit 60f4e5f

1 file changed

Lines changed: 41 additions & 0 deletions

File tree

.github/workflows/code_quality.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Code Quality
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
create:
8+
9+
jobs:
10+
build:
11+
if: github.event_name == 'pull_request'
12+
name: Code Quality (clippy, rustfmt)
13+
runs-on: ubuntu-latest
14+
strategy:
15+
matrix:
16+
rust:
17+
- stable
18+
target:
19+
- x86_64-unknown-linux-gnu
20+
steps:
21+
- name: Code checkout
22+
uses: actions/checkout@v2
23+
- name: Install Rust toolchain (${{ matrix.rust }})
24+
uses: actions-rs/toolchain@v1
25+
with:
26+
toolchain: ${{ matrix.rust }}
27+
target: ${{ matrix.target }}
28+
override: true
29+
components: rustfmt, clippy
30+
31+
- name: Install packages
32+
run: sudo apt-get update && sudo apt-get -y install libclang-dev
33+
34+
- name: Download libkrun.h
35+
run: sudo curl -o /usr/include/libkrun.h https://raw.githubusercontent.com/containers/libkrun/refs/heads/main/include/libkrun.h
36+
37+
- name: Formatting (rustfmt)
38+
run: cargo fmt -- --check
39+
40+
- name: Clippy (all features)
41+
run: cargo clippy --all-targets --all-features

0 commit comments

Comments
 (0)