Skip to content

Commit

Permalink
ci-cd: code style check and clippy added to github actions
Browse files Browse the repository at this point in the history
build-system: makefile added
  • Loading branch information
ali77gh committed Apr 16, 2024
1 parent f775c8a commit cd291cd
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 9 deletions.
32 changes: 23 additions & 9 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,36 @@
name: Rust

on:
push:
branches: [ "stable" ]
branches:
- "stable"
pull_request:
branches: [ "stable" ]
branches:
- "stable"
- "dev"

env:
CARGO_TERM_COLOR: always

jobs:
build:
style:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check style
run: make lint

clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Clippy
run: make clippy

test:
runs-on: ubuntu-latest
needs:
- build
steps:
- uses: actions/checkout@v3
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
- uses: actions/checkout@v4
- name: Test
run: make test
18 changes: 18 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
all: build check test docs

fmt:
cargo fmt

build:
cargo build --release

check: clippy lint

test:
cargo test

clippy:
cargo clippy --all-features --no-deps

lint:
cargo fmt --check --verbose

0 comments on commit cd291cd

Please sign in to comment.