From 2ab63b15d994ec88c5635b1d2829abbbcf4fd42a Mon Sep 17 00:00:00 2001 From: Richard Jansen Date: Thu, 4 Jan 2024 13:52:30 +0100 Subject: [PATCH] Github actions & coveralls - github actions change to also include coveralls - updated README for test results badge - updated repo links in Cargo.toml --- .github/workflows/test.yml | 29 +++++++++++++++++++++++++---- Cargo.toml | 4 ++-- README.md | 2 +- 3 files changed, 28 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 777fe89f9..483b4ffb5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,7 +2,8 @@ name: Cargo tests on: push: branches: - - master + - main + - develop pull_request: jobs: clippy: @@ -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 @@ -50,7 +51,10 @@ 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 @@ -58,6 +62,7 @@ jobs: - uses: actions-rs/toolchain@v1 with: toolchain: ${{matrix.rust}} + components: llvm-tools-preview - uses: actions/cache@v2 with: @@ -65,5 +70,21 @@ jobs: 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 + diff --git a/Cargo.toml b/Cargo.toml index 54fa0d18a..6e465a1fe 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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" diff --git a/README.md b/README.md index ff7e8150b..14866b84a 100644 --- a/README.md +++ b/README.md @@ -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]