Skip to content

Commit

Permalink
Adds GitHub actions
Browse files Browse the repository at this point in the history
  • Loading branch information
xfbs committed Oct 18, 2024
1 parent f5b5eef commit 2d4ea86
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Continuous Integration

# run for pull requests and pushes to master branch
on:
push:
branches:
- 'master'
pull_request:

# always use pretty colors
env:
CARGO_TERM_COLOR: always

jobs:
# check formatting (use nightly rustfmt)
formatting:
name: Check Formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: rustup update nightly
- run: rustup component add rustfmt --toolchain nightly
- run: cargo default nightly
- run: cargo fmt --check

# check style (using clippy)
style:
name: Check Style
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@4
- run: cargo clippy --check

# build and test code
build_and_test:
name: Rust project - latest
runs-on: ubuntu-latest
strategy:
matrix:
toolchain:
- stable
- beta
- nightly
steps:
- uses: actions/checkout@v4
- run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
- run: cargo build --verbose
- run: cargo test --verbose

0 comments on commit 2d4ea86

Please sign in to comment.