UTEST: Refine coverage script.

pull/3101/merge
winlin 3 years ago
parent cd85a96255
commit 7d0d2af817

@ -116,6 +116,8 @@ jobs:
# For coverage
- name: Run SRS covergae
if: ${{ startsWith(github.ref, 'refs/heads/') || startsWith(github.ref, 'refs/pull/') }}
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: |
# The hash of commit.
SRS_SHA=${{ github.sha }}
@ -126,7 +128,8 @@ jobs:
# The github.ref is, for example, refs/pull/2536/merge
SRS_PR=$(echo ${{ github.ref }}| awk -F 'refs/pull/' '{print $2}'| awk -F '/' '{print $1}')
echo "For ref=${{ github.ref }}, sha=${{ github.sha }}, SRS_BRANCH=$SRS_BRANCH, SRS_PR=$SRS_PR, SRS_SHA=$SRS_SHA, SRS_PROJECT=$SRS_PROJECT"
docker run --rm --env SRS_BRANCH=$SRS_BRANCH --env SRS_PR=$SRS_PR --env SRS_SHA=$SRS_SHA --env SRS_PROJECT=$SRS_PROJECT \
docker run --rm --env CODECOV_TOKEN=$CODECOV_TOKEN \
--env SRS_BRANCH=$SRS_BRANCH --env SRS_PR=$SRS_PR --env SRS_SHA=$SRS_SHA --env SRS_PROJECT=$SRS_PROJECT \
srs:cov bash -c 'make utest && ./objs/srs_utest && bash auto/codecov.sh'
multile-archs:

@ -36,9 +36,7 @@ fi
# Note: The right path is like:
# https://codecov.io/gh/ossrs/srs/src/3.0release/trunk/src/protocol/srs_rtmp_stack.cpp
# https://codecov.io/gh/ossrs/srs/src/20fbb4466fdc8ba5d810b8570df6004063212838/trunk/src/protocol/srs_rtmp_stack.cpp
# Remark: It takes a few minutes to sync with github, so it might not available when CircleCI is done.
# https://circleci.com/gh/ossrs/srs/tree/3.0release
cd $workdir &&
export CODECOV_TOKEN="493bba46-c468-4e73-8b45-8cdd8ff62d96" &&
bash <(curl -s https://codecov.io/bash) $CODECOV_ARGS &&
export CODECOV_TOKEN="$CODECOV_TOKEN" &&
bash <(curl -s https://codecov.io/bash) $CODECOV_ARGS -f '!*gtest*' -f '!*c++*' -f '!*ffmpeg-*-fit*' &&
echo "Done" && exit 0

Loading…
Cancel
Save