Skip to content

Commit

Permalink
ci: add tests workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
bmuddha committed Dec 23, 2024
1 parent e74a077 commit 048240f
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 1 deletion.
43 changes: 43 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 048240f

Please sign in to comment.