Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Update .github/workflows/code-coverage.yaml in artichoke/roe #202

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions .github/workflows/code-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ jobs:
steps:
- name: Checkout repository
uses: actions/[email protected]
with:
persist-credentials: false

- name: Install nightly Rust toolchain
uses: artichoke/setup-rust/[email protected]
Expand Down Expand Up @@ -82,8 +84,13 @@ jobs:

- name: Check missed lines
shell: python
env:
GITHUB_REF_NAME: ${{ github.ref_name }}
GITHUB_EVENT_NAME: ${{ github.event_name }}
GITHUB_EVENT_NUMBER: ${{ github.event.number }}
run: |
import json
import os
from urllib.request import urlopen

trunk_coverage_url = "https://codecov.artichokeruby.org/roe/coverage.json"
Expand All @@ -101,7 +108,7 @@ jobs:
print("")


if "${{ github.ref_name }}" == "trunk":
if os.environ.get("GITHUB_REF_NAME") == "trunk":
# We don't need to compare trunk coverage to itself
exit(0)

Expand All @@ -114,8 +121,8 @@ jobs:
branch_coverage = json.load(local)

on = None
if "${{ github.event_name }}" == "pull_request":
on = "PR artichoke/roe#${{ github.event.number }}"
if os.environ.get("GITHUB_EVENT_NAME") == "pull_request":
on = "PR artichoke/roe#" + os.environ.get("GITHUB_EVENT_NUMBER")

print_report(branch_coverage, on=on)

Expand Down