Skip to content

Commit

Permalink
Merge pull request #1 from taeh98/master
Browse files Browse the repository at this point in the history
chore: made Rust CI workflow
  • Loading branch information
desujoy authored Oct 1, 2023
2 parents bfba18f + 974e053 commit 523da89
Showing 1 changed file with 87 additions and 0 deletions.
87 changes: 87 additions & 0 deletions .github/workflows/rust_ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# This CI (Continuous Integration) file will automatically check your Rust code for errors.
# It runs using GitHub Actions: https://docs.github.com/en/actions
# It will check the code compiles, run tests, run lints, and check for security issues.
# CI will help you standardise your code style and detect issues with your code easily and early.
# It makes it easier to integrate different branches once they're finished.
# adapted from https://github.com/actions-rs/meta/blob/master/recipes/quickstart.md and https://gist.github.com/LukeMathWalker/5ae1107432ce283310c3e601fac915f3

name: Rust CI

on:
push:
# branches:
# - main
release:
types: [published]
pull_request:

env:
CARGO_TERM_COLOR: always

jobs:
check:
name: Check code compiles
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Run cargo check
run: cargo check

test:
name: Run tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Run tests
run: cargo test

fmt:
name: Lint with rmstfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- name: Enforce formatting
run: cargo fmt --check

clippy:
name: Lint with clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- uses: Swatinem/rust-cache@v2
- name: Linting
run: cargo clippy -- -D warnings

cargo_deny:
name: cargo deny
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: taiki-e/install-action@cargo-deny
- name: Scan for vulnerabilities
run: cargo deny check advisories

cargo-audit:
name: cargo audit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Install cargo audit
run: cargo install cargo-audit
- name: Run "cargo audit" to check for vulnerabilities
run: cargo audit --color=always --deny=warnings

0 comments on commit 523da89

Please sign in to comment.