forked from webrtc-rs/media
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
212 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
branch: true | ||
ignore-not-existing: true | ||
llvm: true | ||
filter: covered | ||
output-type: lcov | ||
output-path: ./lcov.info | ||
source-dir: . | ||
ignore: | ||
- "/*" | ||
- "C:/*" | ||
- "../*" | ||
excl-line: "#\\[derive\\(" | ||
excl-start: "mod tests \\{" | ||
excl-br-line: "#\\[derive\\(" | ||
excl-br-start: "mod tests \\{" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Cargo | ||
|
||
on: | ||
push: | ||
branches: [ master, main ] | ||
pull_request: | ||
branches: [ master, main ] | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
build: | ||
name: Build and test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Build | ||
run: cargo build --verbose | ||
- name: Run tests | ||
run: cargo test --verbose | ||
|
||
rustfmt_and_clippy: | ||
name: Check rustfmt style && run clippy | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: 1.46.0 | ||
profile: minimal | ||
components: clippy, rustfmt | ||
override: true | ||
- name: Cache cargo registry | ||
uses: actions/cache@v1 | ||
with: | ||
path: ~/.cargo/registry | ||
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} | ||
- name: Run clippy | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: clippy | ||
- name: Check formating | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: fmt | ||
args: --all -- --check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
name: Coverage | ||
|
||
on: | ||
push: | ||
branches: [ master, main ] | ||
pull_request: | ||
branches: [ master, main ] | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
grcov: | ||
name: Coverage | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: | ||
- ubuntu-latest | ||
toolchain: | ||
- nightly | ||
cargo_flags: | ||
- "--all-features" | ||
steps: | ||
- name: Checkout source code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install Rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: ${{ matrix.toolchain }} | ||
override: true | ||
|
||
- name: Install grcov | ||
uses: actions-rs/[email protected] | ||
with: | ||
crate: grcov | ||
version: latest | ||
use-tool-cache: true | ||
|
||
- name: Test | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: test | ||
args: --all --no-fail-fast ${{ matrix.cargo_flags }} | ||
env: | ||
CARGO_INCREMENTAL: "0" | ||
RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort -Cdebug-assertions=off' | ||
RUSTDOCFLAGS: '-Zprofile -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort -Cdebug-assertions=off' | ||
|
||
- name: Generate coverage data | ||
id: grcov | ||
# uses: actions-rs/[email protected] | ||
run: | | ||
grcov target/debug/ \ | ||
--branch \ | ||
--llvm \ | ||
--source-dir . \ | ||
--output-path lcov.info \ | ||
--ignore='/**' \ | ||
--ignore='C:/**' \ | ||
--ignore='../**' \ | ||
--ignore-not-existing \ | ||
--excl-line "#\\[derive\\(" \ | ||
--excl-br-line "#\\[derive\\(" \ | ||
--excl-start "#\\[cfg\\(test\\)\\]" \ | ||
--excl-br-start "#\\[cfg\\(test\\)\\]" \ | ||
--commit-sha ${{ github.sha }} \ | ||
--service-job-id ${{ github.job }} \ | ||
--service-name "GitHub Actions" \ | ||
--service-number ${{ github.run_id }} | ||
- name: Upload coverage as artifact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: lcov.info | ||
# path: ${{ steps.grcov.outputs.report }} | ||
path: lcov.info | ||
|
||
- name: Upload coverage to codecov.io | ||
uses: codecov/codecov-action@v1 | ||
with: | ||
# file: ${{ steps.grcov.outputs.report }} | ||
file: lcov.info | ||
fail_ci_if_error: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[package] | ||
name = "webrtc-rs-media" | ||
version = "0.0.1" | ||
authors = ["Rain Liu <[email protected]>"] | ||
edition = "2018" | ||
description = "A pure Rust implementation of WebRTC Media API" | ||
license = "MIT" | ||
documentation = "https://docs.rs/webrtc-rs-media" | ||
homepage = "https://webrtc.rs" | ||
repository = "https://github.com/webrtc-rs/media" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,21 @@ | ||
# media | ||
WebRTC Media | ||
<h1 align="center"> | ||
<a href="https://webrtc.rs"><img src="https://github.com/webrtc-rs/webrtc/doc/webrtc.rs.png" alt="WebRTC.rs"></a> | ||
<br> | ||
</h1> | ||
<p align="center"> | ||
<a href="https://github.com/webrtc-rs/media/actions"> | ||
<img src="https://github.com/webrtc-rs/media/workflows/Cargo/badge.svg"> | ||
</a> | ||
<a href="https://codecov.io/gh/webrtc-rs/media"> | ||
<img src="https://codecov.io/gh/webrtc-rs/media/branch/main/graph/badge.svg"> | ||
</a> | ||
<a href="https://deps.rs/repo/github/webrtc-rs/media"> | ||
<img src="https://deps.rs/repo/github/webrtc-rs/media/status.svg"> | ||
</a> | ||
<a href="https://github.com/webrtc-rs/media/blob/master/LICENSE"> | ||
<img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License: MIT"> | ||
</a> | ||
</p> | ||
<p align="center"> | ||
A pure Rust implementation of WebRTC Media API. | ||
</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
codecov: | ||
require_ci_to_pass: yes | ||
max_report_age: off | ||
|
||
coverage: | ||
precision: 2 | ||
round: down | ||
range: 50..90 | ||
status: | ||
project: | ||
default: | ||
enabled: no | ||
threshold: 0.2 | ||
if_not_found: success | ||
patch: | ||
default: | ||
enabled: no | ||
if_not_found: success | ||
changes: | ||
default: | ||
enabled: no | ||
if_not_found: success |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#[cfg(test)] | ||
mod tests { | ||
#[test] | ||
fn it_works() { | ||
assert_eq!(2 + 2, 4); | ||
} | ||
} |