Skip to content

Commit

Permalink
Github actions & coveralls
Browse files Browse the repository at this point in the history
- github actions change to also include coveralls
- updated README for test results badge
- updated repo links in Cargo.toml
  • Loading branch information
rj76 committed Jan 4, 2024
1 parent e765990 commit 2ab63b1
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 7 deletions.
29 changes: 25 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ name: Cargo tests
on:
push:
branches:
- master
- main
- develop
pull_request:
jobs:
clippy:
Expand All @@ -11,7 +12,7 @@ jobs:
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
toolchain: stable
components: clippy
override: true
- name: Install dependencies
Expand Down Expand Up @@ -50,20 +51,40 @@ jobs:
runs-on: ${{ matrix.os }}

env:
RUSTFLAGS: "-Dwarnings"
RUSTFLAGS: "-Dwarnings -Cinstrument-coverage -Zprofile -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort"
CARGO_INCREMENTAL: "0"
RUSTDOCFLAGS: "-Cpanic=abort"
RUSTC_BOOTSTRAP: "1"

steps:
- uses: actions/checkout@v2

- uses: actions-rs/toolchain@v1
with:
toolchain: ${{matrix.rust}}
components: llvm-tools-preview

- uses: actions/cache@v2
with:
path: |
target
key: ${{ runner.os }}-cargo-${{ matrix.rust }}

- name: Build
run: cargo build

- name: Install grcov
run: cargo install grcov

- name: Run tests
run: cargo test
run: LLVM_PROFILE_FILE="fcm-rust-%p-%m.profraw" cargo test

- name: Collect results
run: grcov . -s . --binary-path ./target/debug/ -t lcov --branch --ignore-not-existing -o .

- name: Coveralls GitHub Action
uses: coverallsapp/github-action@v2.2.3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
file: ./lcov

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ authors = [
]
description = "An API to talk to FCM (Firebase Cloud Messaging) in Rust"
license = "MIT"
homepage = "https://github.com/panicbit/fcm-rust"
repository = "https://github.com/panicbit/fcm-rust"
homepage = "https://github.com/rj76/fcm-rust"
repository = "https://github.com/rj76/fcm-rust"
documentation = "https://docs.rs/fcm/"
keywords = ["fcm", "firebase", "notification"]
edition = "2018"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# fcm
[![Cargo tests](https://github.com/rj76/fcm-rust/actions/workflows/test.yml/badge.svg)](https://github.com/panicbit/fcm-rust/actions/workflows/test.yml)
[![Cargo tests](https://github.com/rj76/fcm-rust/actions/workflows/test.yml/badge.svg)](https://github.com/rj76/fcm-rust/actions/workflows/test.yml)
[![Coveralls](https://img.shields.io/coveralls/panicbit/fcm-rust.svg?style=flat-square)][coveralls]
[![Crates.io Version](https://img.shields.io/crates/v/fcm.svg?style=flat-square)][crates.io]
[![Crates.io Downloads](https://img.shields.io/crates/dv/fcm.svg?style=flat-square)][crates.io]
Expand Down

0 comments on commit 2ab63b1

Please sign in to comment.