Skip to content

Commit

Permalink
dev: coverage uses deployment env
Browse files Browse the repository at this point in the history
  • Loading branch information
da2ce7 committed Sep 12, 2023
1 parent 08f0b86 commit 677853d
Showing 1 changed file with 36 additions and 4 deletions.
40 changes: 36 additions & 4 deletions .github/workflows/coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,55 @@ name: Coverage

on:
push:
pull_request:
branches:
- develop
pull_request_target:
branches:
- develop

env:
CARGO_TERM_COLOR: always

jobs:
secrets:
name: Secrets
environment: coverage
runs-on: ubuntu-latest

outputs:
continue: ${{ steps.check.outputs.continue }}

steps:
- id: check
name: Check
env:
CODECOV_TOKEN: "${{ secrets.CODECOV_TOKEN }}"
if: "${{ env.CODECOV_TOKEN != '' }}"
run: echo "continue=true" >> $GITHUB_OUTPUT

report:
name: Report
environment: coverage
needs: secrets
if: needs.secrets.outputs.continue == 'true'
runs-on: ubuntu-latest
env:
CARGO_INCREMENTAL: "0"
RUSTFLAGS: "-Z profile -C codegen-units=1 -C inline-threshold=0 -C link-dead-code -C overflow-checks=off -C panic=abort -Z panic_abort_tests"
RUSTDOCFLAGS: "-Z profile -C codegen-units=1 -C inline-threshold=0 -C link-dead-code -C overflow-checks=off -C panic=abort -Z panic_abort_tests"

steps:
- id: checkout
name: Checkout Repository
uses: actions/checkout@v3
- id: checkout_push
if: github.event_name == 'push'
name: Checkout Repository (Push)
uses: actions/checkout@v4

- id: checkout_pull_request_target
if: github.event_name == 'pull_request_target'
name: Checkout Repository (Pull Request Target)
uses: actions/checkout@v4
with:
ref: "refs/pull/${{ github.event.pull_request.number }}/head"

- id: setup
name: Setup Toolchain
Expand Down Expand Up @@ -58,6 +89,7 @@ jobs:
name: Upload Coverage Report
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ${{ steps.coverage.outputs.report }}
verbose: true
fail_ci_if_error: true

0 comments on commit 677853d

Please sign in to comment.