diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..f0c5c73 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,43 @@ +name: Ringal Tests + +on: + pull_request: + branches: [ "master" ] + +jobs: + rust-checks: + runs-on: ubuntu-latest + container: + image: rust:latest + + steps: + - uses: actions/checkout@v4 + - uses: actions/cache@v4 + with: + path: | + target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }} + - name: Install rustfmt and clippy + run: rustup component add rustfmt clippy + - name: Run rustfmt + run: cargo fmt --check + - name: Run clippy + run: cargo clippy -- -D warnings + + test-and-build: + runs-on: ubuntu-latest + container: + image: rust:latest + + needs: + - rust-checks + + steps: + - uses: actions/checkout@v4 + - uses: actions/cache@v4 + with: + path: | + target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }} + - name: Run tests + run: cargo test diff --git a/README.md b/README.md index bff6323..bb3db04 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Crates.io](https://img.shields.io/crates/v/ringal.svg)](https://crates.io/crates/ringal) [![Documentation](https://docs.rs/ringal/badge.svg)](https://docs.rs/ringal) -[![Build Status](https://github.com/bmuddha/ringal/workflows/CI/badge.svg)](https://github.com/yourusername/ringal/actions) +[![Build Status](https://github.com/bmuddha/ringal/workflows/CI/badge.svg)](https://github.com/bmuddha/ringal/actions) ## Overview