From 2431e0b14034673ea430f2e96b165620647f7981 Mon Sep 17 00:00:00 2001 From: winlin Date: Sun, 15 Aug 2021 17:49:03 +0800 Subject: [PATCH] Acitons: Support pullrequest CI --- .github/workflows/test.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index da05795f2..3dd2f54be 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -32,6 +32,7 @@ jobs: run: docker build --tag srs:cov -f trunk/Dockerfile.cov . # For coverage - name: Run SRS covergae + if: ${{ startsWith(github.ref, 'refs/heads/') || startsWith(github.ref, 'refs/pull/') }} run: | # The hash of commit. SRS_SHA=${{ github.sha }} @@ -39,8 +40,8 @@ jobs: SRS_PROJECT=/srs # The github.ref is, for example, refs/heads/3.0release SRS_BRANCH=$(echo ${{ github.ref }}| awk -F 'refs/heads/' '{print $2}'| awk -F '/' '{print $1}') - # The github.ref is, for example, refs/remotes/pull/2536/merge - SRS_PR=$(echo ${{ github.ref }}| awk -F 'refs/remotes/pull/' '{print $2}'| awk -F '/' '{print $1}') + # 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 \ srs:cov bash -c 'make && ./objs/srs_utest && bash auto/coverage.sh' \ No newline at end of file