From ac07744b68adb0e20bcec1960f3620d8a5f127f5 Mon Sep 17 00:00:00 2001 From: Victor Dudochkin Date: Fri, 23 Apr 2021 22:03:43 +0700 Subject: [PATCH] Codecov and other changes (#2) --- .github/ISSUE_TEMPLATE/bug_report.md | 2 +- .github/ISSUE_TEMPLATE/feature_request.md | 2 +- .github/codecov.yml | 9 +++++ .github/workflows/audit.yaml | 17 ++++++++ .github/workflows/coverage.yaml | 49 +++++++++++++++++++++++ .github/workflows/tests.yml | 27 +++++++++++++ Cargo.toml | 10 ++--- README.md | 20 +++++---- src/barchart.rs | 4 +- src/gaugechart.rs | 4 +- src/linechart.rs | 4 +- src/piechart.rs | 4 +- src/radarchart.rs | 4 +- 13 files changed, 132 insertions(+), 24 deletions(-) create mode 100644 .github/codecov.yml create mode 100644 .github/workflows/audit.yaml create mode 100644 .github/workflows/coverage.yaml create mode 100644 .github/workflows/tests.yml diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index af039b6..d845929 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -15,4 +15,4 @@ It would be nice to have screenshot or result image uploaded Some minimal reproduce code is highly recommended **Version Information** -Please give us what version you are using. If you are pulling `Plotters` directly from git repo, please mention this as well +Please give us what version you are using. If you are pulling `YMC` directly from git repo, please mention this as well diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index cbf5a68..6b3f659 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -1,6 +1,6 @@ --- name: Feature request -about: Suggest an idea to Plotter maintainers +about: Suggest an idea to YMC maintainers title: "[Feature Request]" labels: feature request assignees: '' diff --git a/.github/codecov.yml b/.github/codecov.yml new file mode 100644 index 0000000..f2cf6e4 --- /dev/null +++ b/.github/codecov.yml @@ -0,0 +1,9 @@ +comment: + layout: "diff, flags, files" + require_changes: true + +coverage: + status: + project: + default: + informational: true diff --git a/.github/workflows/audit.yaml b/.github/workflows/audit.yaml new file mode 100644 index 0000000..e0c79d5 --- /dev/null +++ b/.github/workflows/audit.yaml @@ -0,0 +1,17 @@ +name: Security audit +on: + pull_request: + push: + branches: + - master + schedule: + - cron: '0 0 * * 0' + +jobs: + security_audit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/audit-check@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml new file mode 100644 index 0000000..340704c --- /dev/null +++ b/.github/workflows/coverage.yaml @@ -0,0 +1,49 @@ +name: Test coverage + +#on: +# push: +# branches: +# - main +# pull_request: + +on: [push, pull_request] + +env: + CARGO_TERM_COLOR: always + RUST_BACKTRACE: full + +jobs: + coverage: + name: Coverage + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Install Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: nightly + profile: minimal + default: true + + - name: Restore cache + uses: Swatinem/rust-cache@v1 + + - name: Run cargo-tarpaulin + uses: actions-rs/tarpaulin@v0.1 + with: + args: '--all-features --run-types Doctests,Tests' + timeout: 120 + + - name: Upload to codecov.io + uses: codecov/codecov-action@239febf655bba88b16ff5dea1d3135ea8663a1f9 + with: + token: ${{ secrets.CODECOV_TOKEN }} + + - name: Archive code coverage results + uses: actions/upload-artifact@v2 + with: + name: code-coverage-report + path: cobertura.xml + retention-days: 30 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..6893c69 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,27 @@ +name: Tests + +on: [push, pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - name: Build + run: cargo build --verbose + - name: Run tests + run: cargo test --verbose + + clippy_check: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - run: rustup component add clippy + - uses: actions-rs/clippy-check@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + args: --all-features diff --git a/Cargo.toml b/Cargo.toml index 54616ec..87676c1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,7 +18,7 @@ maintenance = { status = "actively-developed" } [features] banner = [] button = [] -barchart = ["ux-animate", "ux-dataflow", "ux-charts", "ux-charts/web"] +barchart = ["ux-animate", "ux-dataflow", "ux-charts"] card = [] charts = ["barchart", "gaugechart", "linechart", "piechart", "radarchart"] checkbox = [] @@ -30,17 +30,17 @@ dialog = [] drawer = [] fab = [] formfield = [] -gaugechart = ["ux-animate", "ux-dataflow", "ux-charts", "ux-charts/web"] +gaugechart = ["ux-animate", "ux-dataflow", "ux-charts"] icon-button-toggle = [] icon-button = [] icon = [] image-list = [] -linechart = ["ux-animate", "ux-dataflow", "ux-charts", "ux-charts/web"] +linechart = ["ux-animate", "ux-dataflow", "ux-charts"] linear-progress = [] list = [] menu = [] -piechart = ["ux-animate", "ux-dataflow", "ux-charts", "ux-charts/web"] -radarchart = ["ux-animate", "ux-dataflow", "ux-charts", "ux-charts/web"] +piechart = ["ux-animate", "ux-dataflow", "ux-charts"] +radarchart = ["ux-animate", "ux-dataflow", "ux-charts"] radio = [] select = [] slider = [] diff --git a/README.md b/README.md index 0a410ac..edb8cf6 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,16 @@ -# YEW Material Components +#
+[![](https://dudochkin-victor.github.io/assets/yew-components/logo.svg)](#top) +# YEW Material Components + [![API Docs][docrs-badge]][docrs-url] [![Crates.io][crates-badge]][crates-url] +[![Code coverage][codecov-badge]][codecov-url] +[![Tests][tests-badge]][tests-url] [![MPL-2.0 licensed][license-badge]][license-url] [![Gitter chat][gitter-badge]][gitter-url] -[![Rustc Version 1.45+][rust-badge]][rust-url] [![loc][loc-badge]][loc-url]
@@ -16,11 +20,13 @@ [crates-url]: https://crates.io/crates/ymc [license-badge]: https://img.shields.io/badge/license-MPL--2.0-blue.svg?style=flat-square [license-url]: https://github.com/angular-rust/yew-components/blob/master/LICENSE -[gitter-badge]: https://img.shields.io/gitter/room/angular_rust/angular_rust.svg?style=flat-square +[gitter-badge]: https://img.shields.io/gitter/room/angular_rust/community.svg?style=flat-square [gitter-url]: https://gitter.im/angular_rust/community -[rust-badge]: https://img.shields.io/badge/rustc-1.45-lightgrey.svg?style=flat-square -[rust-url]: https://blog.rust-lang.org/2020/07/16/Rust-1.45.0.html -[loc-badge]: https://tokei.rs/b1/github/angular-rust/yew-components?category=code +[tests-badge]: https://img.shields.io/github/workflow/status/angular-rust/yew-components/tests?label=tests&logo=github&style=flat-square +[tests-url]: https://github.com/angular-rust/yew-components/actions/workflows/tests.yml +[codecov-badge]: https://img.shields.io/codecov/c/github/angular-rust/yew-components?logo=codecov&style=flat-square&token=OWZIWBTGII +[codecov-url]: https://codecov.io/gh/angular-rust/yew-components +[loc-badge]: https://img.shields.io/tokei/lines/github/angular-rust/yew-components?style=flat-square [loc-url]: https://github.com/angular-rust/yew-components Material Design Components for the Yew framework. @@ -129,7 +135,7 @@ These components respect the theming applied to Material Design Components using We believe the wider community can create better code. The first tool for improving the community is to tell the developers about the project by giving it a star. More stars - more members. - ![Star a repo](https://dudochkin-victor.github.io/assets/star-me-wide.svg) + [![](https://dudochkin-victor.github.io/assets/star-me-wide.svg)](https://github.com/angular-rust/yew-components#top) Angular Rust is a community effort and we welcome all kinds of contributions, big or small, from developers of all backgrounds. We want the Angular Rust community to be a fun and friendly place, so please review our [Code of Conduct](CODE_OF_CONDUCT.md) to learn what behavior will not be tolerated. diff --git a/src/barchart.rs b/src/barchart.rs index 6b29e9d..1cbf152 100644 --- a/src/barchart.rs +++ b/src/barchart.rs @@ -3,7 +3,7 @@ #![allow(unused_imports)] use super::to_option; -use animate::WebCanvas; +use animate::Canvas; use charts::{BarChart as BarChartComponent, BarChartOptions, Chart}; use dataflow::*; use wasm_bindgen::prelude::*; @@ -114,7 +114,7 @@ impl Component for BarChart { chart.resize(800., 400.); - let ctx = WebCanvas::new(cr); // overhead + let ctx = Canvas::new(cr); // overhead chart.draw(&ctx); // let element = self.node_ref.cast::().unwrap(); diff --git a/src/gaugechart.rs b/src/gaugechart.rs index 83e3adc..afc131c 100644 --- a/src/gaugechart.rs +++ b/src/gaugechart.rs @@ -3,7 +3,7 @@ #![allow(unused_imports)] use super::to_option; -use animate::WebCanvas; +use animate::Canvas; use charts::{Chart, GaugeChart as GaugeChartComponent, GaugeChartOptions}; use dataflow::*; use wasm_bindgen::prelude::*; @@ -110,7 +110,7 @@ impl Component for GaugeChart { chart.resize(800., 400.); - let ctx = WebCanvas::new(cr); // overhead + let ctx = Canvas::new(cr); // overhead chart.draw(&ctx); // let element = self.node_ref.cast::().unwrap(); // if self.props.checked { diff --git a/src/linechart.rs b/src/linechart.rs index c0a2f31..384ac0f 100644 --- a/src/linechart.rs +++ b/src/linechart.rs @@ -3,7 +3,7 @@ #![allow(unused_imports)] use super::to_option; -use animate::WebCanvas; +use animate::Canvas; use charts::{Chart, LineChart as LineChartComponent, LineChartOptions}; use dataflow::*; use wasm_bindgen::prelude::*; @@ -112,7 +112,7 @@ impl Component for LineChart { chart.resize(800., 400.); - let ctx = WebCanvas::new(cr); // overhead + let ctx = Canvas::new(cr); // overhead chart.draw(&ctx); // let element = self.node_ref.cast::().unwrap(); // if self.props.checked { diff --git a/src/piechart.rs b/src/piechart.rs index 673949a..ce75250 100644 --- a/src/piechart.rs +++ b/src/piechart.rs @@ -3,7 +3,7 @@ #![allow(unused_imports)] use super::to_option; -use animate::WebCanvas; +use animate::Canvas; use charts::{Chart, PieChart as PieChartComponent, PieChartOptions}; use dataflow::*; use wasm_bindgen::prelude::*; @@ -115,7 +115,7 @@ impl Component for PieChart { chart.resize(800., 400.); - let ctx = WebCanvas::new(cr); // overhead + let ctx = Canvas::new(cr); // overhead chart.draw(&ctx); // let element = self.node_ref.cast::().unwrap(); // if self.props.checked { diff --git a/src/radarchart.rs b/src/radarchart.rs index 41826ac..3ac6524 100644 --- a/src/radarchart.rs +++ b/src/radarchart.rs @@ -3,7 +3,7 @@ #![allow(unused_imports)] use super::to_option; -use animate::WebCanvas; +use animate::Canvas; use charts::{Chart, RadarChart as RadarChartComponent, RadarChartOptions}; use dataflow::*; use wasm_bindgen::prelude::*; @@ -110,7 +110,7 @@ impl Component for RadarChart { chart.resize(800., 400.); - let ctx = WebCanvas::new(cr); // overhead + let ctx = Canvas::new(cr); // overhead chart.draw(&ctx); // let element = self.node_ref.cast::().unwrap(); // if self.props.checked {