@@ -108,8 +108,27 @@ jobs:
108108 - name : cargo test
109109 run : cargo test --locked --all-features --all-targets
110110 coverage :
111- # use llvm-cov to build and collect coverage and outputs in a format that is compatible with
112- # codecov.io
111+ # use llvm-cov to build and collect coverage and outputs in a format that
112+ # is compatible with codecov.io
113+ #
114+ # note that codecov as of v4 requires that CODECOV_TOKEN from
115+ #
116+ # https://app.codecov.io/gh/<user or org>/<project>/settings
117+ #
118+ # is set in two places on your repo:
119+ #
120+ # - https://github.com/jonhoo/guardian/settings/secrets/actions
121+ # - https://github.com/jonhoo/guardian/settings/secrets/dependabot
122+ #
123+ # (the former is needed for codecov uploads to work with Dependabot PRs)
124+ #
125+ # PRs coming from forks of your repo will not have access to the token, but
126+ # for those, codecov allows uploading coverage reports without a token.
127+ # it's all a little weird and inconvenient. see
128+ #
129+ # https://github.com/codecov/feedback/issues/112
130+ #
131+ # for lots of more discussion
113132 runs-on : ubuntu-latest
114133 name : ubuntu / stable / coverage
115134 steps :
@@ -127,7 +146,11 @@ jobs:
127146 run : cargo generate-lockfile
128147 - name : cargo llvm-cov
129148 run : cargo llvm-cov --locked --all-features --lcov --output-path lcov.info
149+ - name : record Rust version
150+ run : echo "RUST=$(rustc --version)" >> "$GITHUB_ENV"
130151 - name : Upload to codecov.io
131- uses : codecov/codecov-action@v3
152+ uses : codecov/codecov-action@v4
132153 with :
133154 fail_ci_if_error : true
155+ token : ${{ secrets.CODECOV_TOKEN }}
156+ env_vars : OS,RUST
0 commit comments