Skip to content

Commit

Permalink
circleci: add check job
Browse files Browse the repository at this point in the history
- cargo fmt
- cargo clippy

Signed-off-by: Takashi IIGUNI <[email protected]>
  • Loading branch information
guni1192 committed Feb 22, 2022
1 parent ffb1954 commit d3ed5c6
Showing 1 changed file with 27 additions and 5 deletions.
32 changes: 27 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,38 @@
version: 2.1

jobs:
test:
check:
docker:
- image: rust:1.58-slim-bullseye
steps:
- checkout
- run:
name: Show kernel version
command: uname -a
name: Install build dependencies
command: apt update && apt-get install -y libelf-dev libgcc-s1 libbpf-dev clang bpftool make pkg-config
- run:
name: Install rustfmt for libbpf-cargo
command: rustup component add rustfmt
- run:
name: Install libbpf-cargo
command: cargo install libbpf-cargo
- run:
name: Generate vmlinux.h
command: bpftool btf dump file /sys/kernel/btf/vmlinux format c > ./sprofiler/src/bpf/vmlinux.h
- run:
name: Build sprofiler
command: cargo libbpf make
- run:
name: cargo fmt
command: cargo fmt --all -- --check
- run:
name: Show rustc version
command: rustc --version
name: cargo clippy
command: cargo clippy --all-features -- -D warnings

test:
docker:
- image: rust:1.58-slim-bullseye
steps:
- checkout
- run:
name: Install build dependencies
command: apt update && apt-get install -y libelf-dev libgcc-s1 libbpf-dev clang bpftool make pkg-config
Expand All @@ -34,4 +55,5 @@ jobs:
workflows:
build-and-test:
jobs:
- check
- test

0 comments on commit d3ed5c6

Please sign in to comment.