Skip to content

Commit 8fd9309

Browse files
Merge #206
206: coverage r=Emilgardis a=Emilgardis Trying to enable coverage again, this time allowing failure, and using instrument-coverage. Co-authored-by: Emil Gardström <emil.gardstrom@gmail.com>
2 parents 8c6b47e + 72df734 commit 8fd9309

File tree

62 files changed

+122
-112
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+122
-112
lines changed

.github/codecov.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
comment: false

.github/workflows/codecov.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# This doesn't work currently there is a bug in the output of grcov
2+
on:
3+
push:
4+
branches:
5+
- master
6+
- trying
7+
8+
name: Code Coverage
9+
jobs:
10+
coverage:
11+
name: Run test coverage
12+
runs-on: ubuntu-latest
13+
continue-on-error: true
14+
steps:
15+
- uses: actions/checkout@v1
16+
with:
17+
submodules: recursive
18+
- name: Toolchain setup
19+
uses: actions-rs/toolchain@v1
20+
with:
21+
toolchain: nightly
22+
override: true
23+
components: llvm-tools-preview
24+
- name: Cache cargo
25+
uses: actions/cache@v2
26+
id: cache
27+
with:
28+
path: |
29+
~/.cargo/registry
30+
~/.cargo/git
31+
~/.cargo/bin
32+
key: ${{ runner.os }}-nightly-cargo-target-cov-${{ hashFiles('**/Cargo.lock') }}
33+
restore-keys: ${{ runner.os }}-nightly-cargo-target-${{ hashFiles('**/Cargo.lock') }}
34+
- name: Install cargo-llvm-cov
35+
run: curl -LsSf https://github.com/taiki-e/cargo-llvm-cov/releases/latest/download/cargo-llvm-cov-x86_64-unknown-linux-gnu.tar.gz | tar xzf - -C ~/.cargo/bin
36+
- name: Generate code coverage
37+
# env:
38+
# RUSTFLAGS: '-Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests'
39+
# RUSTDOCFLAGS: '-Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests'
40+
run: cargo llvm-cov --features "twitch_oauth2/all all unsupported deny_unknown_fields trace_unknown_fields" --doctests --ignore-filename-regex "twitch_oauth2" --lcov --output-path lcov.info
41+
- name: Determine PR number
42+
if: ${{ github.ref == 'refs/heads/trying' }}
43+
run: git log -1 --pretty=format:"%s" | awk '{ print "PR_NUMBER=" substr($NF,2,length($NF)-2) }' >> $GITHUB_ENV
44+
# - name: Determine actual commit
45+
# if: ${{ github.ref == 'refs/heads/trying' }}
46+
# run: git rev-parse HEAD~1 | awk '{ print "ACTUAL_COMMIT_SHA=" $NF }' >> $GITHUB_ENV
47+
- name: Upload to codecov.io
48+
uses: codecov/codecov-action@v2
49+
with:
50+
files: ./lcov.info
51+
override_pr: ${{env.PR_NUMBER}}
52+
# override_commit: ${{env.ACTUAL_COMMIT_SHA}}

.github/workflows/codecov.yml.x

Lines changed: 0 additions & 51 deletions
This file was deleted.

src/eventsub/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
//!
1010
//! To parse these, use [`Payload::parse`]
1111
//!
12-
//! ```rust,no_run
12+
//! ```rust
1313
//! use twitch_api2::eventsub::Payload;
1414
//! let payload = r#"{
1515
//! "subscription": {

src/helix/bits/get_cheermotes.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
//! To use this endpoint, construct a [`GetCheermotesRequest`] with the [`GetCheermotesRequest::builder()`] method.
99
//! If you do not provide an ID, the request will only include global cheermotes as defined by twitch.
1010
//!
11-
//! ```rust, no_run
11+
//! ```rust
1212
//! use twitch_api2::helix::bits::get_cheermotes;
1313
//! let request = get_cheermotes::GetCheermotesRequest::builder()
1414
//! .broadcaster_id(Some("1234".into()))

src/helix/channels/get_channel_editors.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
//!
88
//! To use this endpoint, construct a [`GetChannelEditorsRequest`] with the [`GetChannelEditorsRequest::builder()`] method.
99
//!
10-
//! ```rust, no_run
10+
//! ```rust
1111
//! use twitch_api2::helix::channels::get_channel_editors;
1212
//! let request = get_channel_editors::GetChannelEditorsRequest::builder()
1313
//! .broadcaster_id("1234")

src/helix/channels/get_channel_information.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
//!
88
//! To use this endpoint, construct a [`GetChannelInformationRequest`] with the [`GetChannelInformationRequest::builder()`] method.
99
//!
10-
//! ```rust, no_run
10+
//! ```rust
1111
//! use twitch_api2::helix::channels::get_channel_information;
1212
//! let request = get_channel_information::GetChannelInformationRequest::builder()
1313
//! .broadcaster_id("1234")

src/helix/channels/modify_channel_information.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
//!
88
//! To use this endpoint, construct a [`ModifyChannelInformationRequest`] with the [`ModifyChannelInformationRequest::builder()`] method.
99
//!
10-
//! ```rust, no_run
10+
//! ```rust
1111
//! use twitch_api2::helix::channels::modify_channel_information;
1212
//! let request = modify_channel_information::ModifyChannelInformationRequest::builder()
1313
//! .broadcaster_id("1234")

src/helix/channels/start_commercial.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
//!
88
//! To use this endpoint, construct a [`StartCommercialRequest`] with the [`StartCommercialRequest::new()`] method.
99
//!
10-
//! ```rust, no_run
10+
//! ```rust
1111
//! use twitch_api2::helix::channels::start_commercial;
1212
//! let request = start_commercial::StartCommercialRequest::new();
1313
//! ```

src/helix/chat/get_channel_chat_badges.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
//!
88
//! To use this endpoint, construct a [`GetChannelChatBadgesRequest`] with the [`GetChannelChatBadgesRequest::builder()`] method.
99
//!
10-
//! ```rust, no_run
10+
//! ```rust
1111
//! use twitch_api2::helix::chat::get_channel_chat_badges;
1212
//! let request = get_channel_chat_badges::GetChannelChatBadgesRequest::builder()
1313
//! .broadcaster_id("1234".to_string())

0 commit comments

Comments
 (0)