Skip to content

Commit

Permalink
Merge pull request #2 from JSorngard/Badges
Browse files Browse the repository at this point in the history
Add badge and CI workflow
  • Loading branch information
JSorngard authored Sep 29, 2023
2 parents 61001bd + eb735e0 commit de10fed
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 0 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Rust

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

env:
CARGO_TERM_COLOR: always

jobs:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- name: cargo fmt --check
run: cargo fmt --check
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- name: cargo check --verbose
run: cargo check --verbose
clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- name: cargo clippy -- -D warning
run: cargo clippy -- -D warnings

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Test
run: cargo test --verbose

coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
components: llvm-tools-preview
- name: cargo install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: cargo generate-lockfile
if: hashFiles('Cargo.lock') == ''
run: cargo generate-lockfile
- name: cargo llvm-cov
run: cargo llvm-cov --locked --all-features --lcov --output-path lcov.info
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
fail_ci_if_error: true
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[![Latest Version](https://img.shields.io/crates/v/const-primes.svg)](https://crates.io/crates/const-primes)

# const-primes

A crate for generating and working with prime numbers in const contexts.
Expand Down

0 comments on commit de10fed

Please sign in to comment.