mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-01-02 19:26:44 +00:00
Run coveralls --finish
to indicate completion
This commit is contained in:
parent
32b2e93302
commit
626eba53b8
77
.github/workflows/ci.yml
vendored
77
.github/workflows/ci.yml
vendored
@ -129,80 +129,21 @@ jobs:
|
|||||||
# a single report, we have to tell Coveralls when we've uploaded all of the
|
# a single report, we have to tell Coveralls when we've uploaded all of the
|
||||||
# data files. This does it. We make sure it runs last by making it depend
|
# data files. This does it. We make sure it runs last by making it depend
|
||||||
# on *all* of the coverage-collecting jobs.
|
# on *all* of the coverage-collecting jobs.
|
||||||
|
#
|
||||||
|
# See notes about parallel builds on GitHub Actions at
|
||||||
|
# https://coveralls-python.readthedocs.io/en/latest/usage/configuration.html
|
||||||
finish-coverage-report:
|
finish-coverage-report:
|
||||||
# There happens to just be one coverage-collecting job at the moment. If
|
needs: coverage
|
||||||
# the coverage reports are broken and someone added more
|
runs-on: ubuntu-latest
|
||||||
# coverage-collecting jobs to this workflow but didn't update this, that's
|
container: python:3-slim
|
||||||
# why.
|
|
||||||
needs:
|
|
||||||
- "coverage"
|
|
||||||
runs-on: "ubuntu-latest"
|
|
||||||
steps:
|
steps:
|
||||||
- name: "Check out Tahoe-LAFS sources"
|
- name: "Indicate completion to coveralls.io"
|
||||||
uses: "actions/checkout@v2"
|
|
||||||
|
|
||||||
- name: "Finish Coveralls Reporting"
|
|
||||||
run: |
|
run: |
|
||||||
# coveralls-python does have a `--finish` option but it doesn't seem
|
pip3 install --upgrade coveralls==3.0.1
|
||||||
# to work, at least for us.
|
python3 -m coveralls --finish
|
||||||
# https://github.com/coveralls-clients/coveralls-python/issues/248
|
|
||||||
#
|
|
||||||
# But all it does is this simple POST so we can just send it
|
|
||||||
# ourselves. The only hard part is guessing what the POST
|
|
||||||
# parameters mean. And I've done that for you already.
|
|
||||||
#
|
|
||||||
# Since the build is done I'm going to guess that "done" is a fine
|
|
||||||
# value for status.
|
|
||||||
#
|
|
||||||
# That leaves "build_num". The coveralls documentation gives some
|
|
||||||
# hints about it. It suggests using $CIRCLE_WORKFLOW_ID if your job
|
|
||||||
# is on CircleCI. CircleCI documentation says this about
|
|
||||||
# CIRCLE_WORKFLOW_ID:
|
|
||||||
#
|
|
||||||
# Observation of the coveralls.io web interface, logs from the
|
|
||||||
# coveralls command in action, and experimentation suggests the
|
|
||||||
# value for PRs is something more like:
|
|
||||||
#
|
|
||||||
# <GIT MERGE COMMIT HASH>-PR-<PR NUM>
|
|
||||||
#
|
|
||||||
# For branches, it's just the git branch tip hash.
|
|
||||||
|
|
||||||
# For pull requests, refs/pull/<PR NUM>/merge was just checked out
|
|
||||||
# by so HEAD will refer to the right revision. For branches, HEAD
|
|
||||||
# is also the tip of the branch.
|
|
||||||
REV=$(git rev-parse HEAD)
|
|
||||||
|
|
||||||
# We can get the PR number from the "context".
|
|
||||||
#
|
|
||||||
# https://docs.github.com/en/free-pro-team@latest/developers/webhooks-and-events/webhook-events-and-payloads#pull_request
|
|
||||||
#
|
|
||||||
# (via <https://github.community/t/github-ref-is-inconsistent/17728/3>).
|
|
||||||
#
|
|
||||||
# If this is a pull request, `github.event` is a `pull_request`
|
|
||||||
# structure which has `number` right in it.
|
|
||||||
#
|
|
||||||
# If this is a push, `github.event` is a `push` instead but we only
|
|
||||||
# need the revision to construct the build_num.
|
|
||||||
|
|
||||||
PR=${{ github.event.number }}
|
|
||||||
|
|
||||||
if [ "${PR}" = "" ]; then
|
|
||||||
BUILD_NUM=$REV
|
|
||||||
else
|
|
||||||
BUILD_NUM=$REV-PR-$PR
|
|
||||||
fi
|
|
||||||
REPO_NAME=$GITHUB_REPOSITORY
|
|
||||||
|
|
||||||
curl \
|
|
||||||
-k \
|
|
||||||
https://coveralls.io/webhook?repo_token=$COVERALLS_REPO_TOKEN \
|
|
||||||
-d \
|
|
||||||
"payload[build_num]=$BUILD_NUM&payload[status]=done&payload[repo_name]=$REPO_NAME"
|
|
||||||
env:
|
env:
|
||||||
# Some magic value required for some magic reason.
|
# Some magic value required for some magic reason.
|
||||||
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
|
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
|
||||||
# Help coveralls identify our project.
|
|
||||||
COVERALLS_REPO_TOKEN: "JPf16rLB7T2yjgATIxFzTsEgMdN1UNq6o"
|
|
||||||
|
|
||||||
integration:
|
integration:
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
Loading…
Reference in New Issue
Block a user