From 048240f6d657c36dee95c8b15ce6c1d6c379db18 Mon Sep 17 00:00:00 2001 From: Babur Makhmudov Date: Mon, 23 Dec 2024 15:10:51 +0530 Subject: [PATCH] ci: add tests workflow --- .github/workflows/test.yml | 43 ++++++++++++++++++++++++++++++++++++++ README.md | 2 +- 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/test.yml 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