mirror of
https://github.com/Devolutions/IronRDP.git
synced 2025-08-04 07:08:17 +00:00
ci: wrong comparison operator for coverage diff (#176)
This commit is contained in:
parent
38b3b4887a
commit
0b408200a8
2 changed files with 7 additions and 5 deletions
6
.github/workflows/coverage.yml
vendored
6
.github/workflows/coverage.yml
vendored
|
@ -23,13 +23,13 @@ jobs:
|
||||||
uses: Swatinem/rust-cache@v2.3.0
|
uses: Swatinem/rust-cache@v2.3.0
|
||||||
|
|
||||||
- name: Prepare runner
|
- name: Prepare runner
|
||||||
run: cargo xtask cov install
|
run: cargo xtask cov install -v
|
||||||
|
|
||||||
- name: Generate PR report
|
- name: Generate PR report
|
||||||
if: github.event.number != ''
|
if: github.event.number != ''
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ secrets.DEVOLUTIONSBOT_TOKEN != '' && secrets.DEVOLUTIONSBOT_TOKEN || github.token }}
|
GH_TOKEN: ${{ secrets.DEVOLUTIONSBOT_TOKEN != '' && secrets.DEVOLUTIONSBOT_TOKEN || github.token }}
|
||||||
run: cargo xtask cov report-gh --repo "${{ github.repository }}" --pr "${{ github.event.number }}"
|
run: cargo xtask cov report-gh --repo "${{ github.repository }}" --pr "${{ github.event.number }}" -v
|
||||||
|
|
||||||
- name: Configure Git Identity
|
- name: Configure Git Identity
|
||||||
if: github.ref == 'refs/heads/master'
|
if: github.ref == 'refs/heads/master'
|
||||||
|
@ -41,4 +41,4 @@ jobs:
|
||||||
if: github.ref == 'refs/heads/master'
|
if: github.ref == 'refs/heads/master'
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ secrets.DEVOLUTIONSBOT_TOKEN }}
|
GH_TOKEN: ${{ secrets.DEVOLUTIONSBOT_TOKEN }}
|
||||||
run: cargo xtask cov update
|
run: cargo xtask cov update -v
|
||||||
|
|
|
@ -81,6 +81,7 @@ pub fn report_github(sh: &Shell, repo: &str, pr_id: u32) -> anyhow::Result<()> {
|
||||||
use std::fmt::Write as _;
|
use std::fmt::Write as _;
|
||||||
|
|
||||||
const COMMENT_HEADER: &str = "## Coverage Report :robot: :gear:";
|
const COMMENT_HEADER: &str = "## Coverage Report :robot: :gear:";
|
||||||
|
const DIFF_THRESHOLD: f64 = 0.005;
|
||||||
|
|
||||||
let _s = Section::new("COV-REPORT");
|
let _s = Section::new("COV-REPORT");
|
||||||
|
|
||||||
|
@ -91,7 +92,7 @@ pub fn report_github(sh: &Shell, repo: &str, pr_id: u32) -> anyhow::Result<()> {
|
||||||
|
|
||||||
println!("Past:\n{past_report}");
|
println!("Past:\n{past_report}");
|
||||||
println!("New:\n{report}");
|
println!("New:\n{report}");
|
||||||
println!("Diff: {:+.2}%", diff);
|
println!("Diff: {:+}%", diff);
|
||||||
|
|
||||||
let comments = cmd!(sh, "gh api")
|
let comments = cmd!(sh, "gh api")
|
||||||
.arg("-H")
|
.arg("-H")
|
||||||
|
@ -137,7 +138,8 @@ pub fn report_github(sh: &Shell, repo: &str, pr_id: u32) -> anyhow::Result<()> {
|
||||||
.arg(format!("/repos/{repo}/issues/comments/{comment_id}"))
|
.arg(format!("/repos/{repo}/issues/comments/{comment_id}"))
|
||||||
.ignore_stdout()
|
.ignore_stdout()
|
||||||
.run()?;
|
.run()?;
|
||||||
} else if diff.abs() < 0.01 {
|
} else if diff.abs() > DIFF_THRESHOLD {
|
||||||
|
trace!("Diff ({diff}) is greater than threshold ({DIFF_THRESHOLD})");
|
||||||
println!("Create new comment");
|
println!("Create new comment");
|
||||||
|
|
||||||
command
|
command
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue