Skip to content

Commit

Permalink
Merge pull request #165 from artichoke/terraform/update-file-.github-…
Browse files Browse the repository at this point in the history
…workflows-code-coverage.yaml

chore: Update `.github/workflows/code-coverage.yaml` in `artichoke/st…
  • Loading branch information
lopopolo authored Feb 2, 2025
2 parents 09ec460 + 5e6f29a commit 537afaa
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 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 @@ -61,7 +63,7 @@ jobs:
run: grcov strftime-ruby*.profraw --source-dir . --keep-only 'src/**/*.rs' --binary-path target/debug -t covdir --filter covered -o target/coverage/coverage.json

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
uses: aws-actions/configure-aws-credentials@4fc4975a852c8cd99761e2de1f4ba73402e44dd9 # v4.0.3
if: github.ref == 'refs/heads/trunk'
with:
aws-region: us-west-2
Expand All @@ -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/strftime-ruby/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/strftime-ruby#${{ github.event.number }}"
if os.environ.get("GITHUB_EVENT_NAME") == "pull_request":
on = "PR artichoke/strftime-ruby#" + os.environ.get("GITHUB_EVENT_NUMBER")
print_report(branch_coverage, on=on)
Expand Down

0 comments on commit 537afaa

Please sign in to comment.