From 61e1336cacabff765481fe2883ddea806a483c8f Mon Sep 17 00:00:00 2001 From: Miranda Mundt Date: Tue, 4 Aug 2020 14:13:34 -0600 Subject: [PATCH 1/5] Mirroring codecov logic on Pyomo --- .github/workflows/pr_master_test.yml | 47 ++++++++++++++++++++++++---- 1 file changed, 41 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pr_master_test.yml b/.github/workflows/pr_master_test.yml index d6211b0..1af92ed 100644 --- a/.github/workflows/pr_master_test.yml +++ b/.github/workflows/pr_master_test.yml @@ -3,7 +3,7 @@ name: GitHub CI on: push: branches: - - master + - workflow_logic pull_request: branches: - master @@ -173,10 +173,9 @@ jobs: env: CODECOV_NAME: ${{matrix.TARGET}}/${{matrix.python}}${{matrix.NAME}} run: | - [ ! -d ${GITHUB_WORKSPACE}/cache/download ] && mkdir -pv ${GITHUB_WORKSPACE}/cache/download + coverage combine coverage report -i coverage xml -i - ls -la set +e # Always attempt to update the codecov script, but fall back on # the previously cached script if it fails @@ -191,18 +190,54 @@ jobs: echo "Pausing $DELAY seconds before re-attempting download" sleep $DELAY done - ls -la ${GITHUB_WORKSPACE}/cache/ i=0 while : ; do ((i+=1)) echo "Uploading coverage to codecov (attempt ${i})" bash $CODECOV -Z -X gcov -X s3 -f coverage.xml if test $? == 0; then + echo "PASS" > ${GITHUB_WORKSPACE}/codecov.result + break + elif test $i -ge 2; then + # Do not fail the build just because the codecov upload fails + echo "FAIL" > ${GITHUB_WORKSPACE}/codecov.result break - elif test $i -ge 5; then - exit 1 fi DELAY=$(( RANDOM % 30 + 30)) echo "Pausing $DELAY seconds before re-attempting upload" sleep $DELAY done + + - name: Record build artifacts + uses: actions/upload-artifact@v2 + with: + name: ${{github.job}}_${{env.GHA_JOBNAME}} + path: | + codecov.result + # In general, do not record test results as artifacts to + # manage total artifact storage + # TEST-*.xml + + post: + name: post-build + needs: build + runs-on: ubuntu-latest + steps: + - name: Download build artifacts + uses: actions/download-artifact@v2 + with: + path: artifacts + + - name: Check codecov upload success + run: | + FAIL=`grep FAIL artifacts/*/codecov.result | wc -l` + ALL=`ls -1 artifacts/*/codecov.result | wc -l` + # Fail is more than 1/9 codecov uploads fail + echo "$FAIL of $ALL codecov uploads failed" + if test $FAIL -gt 0; then + grep FAIL artifacts/*/codecov.result | sed 's/^/ /' + if test $(( $FAIL * 9 )) -gt $ALL; then + echo "More than 1/9 codecov uploads failed:" + exit 1 + fi + fi From 40c1d60f325848fddbd69f07c4ad80779c886a0b Mon Sep 17 00:00:00 2001 From: Miranda Mundt Date: Tue, 4 Aug 2020 14:14:09 -0600 Subject: [PATCH 2/5] Setting push back to master --- .github/workflows/pr_master_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr_master_test.yml b/.github/workflows/pr_master_test.yml index 1af92ed..5695b22 100644 --- a/.github/workflows/pr_master_test.yml +++ b/.github/workflows/pr_master_test.yml @@ -3,7 +3,7 @@ name: GitHub CI on: push: branches: - - workflow_logic + - master pull_request: branches: - master From f5e1f111206651b0e540f9ef16fe9d923830f68d Mon Sep 17 00:00:00 2001 From: Miranda Mundt Date: Tue, 4 Aug 2020 14:14:54 -0600 Subject: [PATCH 3/5] Depends on name is incorrect --- .github/workflows/pr_master_test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr_master_test.yml b/.github/workflows/pr_master_test.yml index 5695b22..dce8d7f 100644 --- a/.github/workflows/pr_master_test.yml +++ b/.github/workflows/pr_master_test.yml @@ -3,7 +3,7 @@ name: GitHub CI on: push: branches: - - master + - workflow_logic pull_request: branches: - master @@ -18,7 +18,7 @@ env: coverage xlrd jobs: - pyomo-tests: + build: name: ${{ matrix.TARGET }}/${{ matrix.python }}${{ matrix.NAME }} runs-on: ${{ matrix.os }} strategy: From a39d1119eff1d38324ed22331919e28c414717da Mon Sep 17 00:00:00 2001 From: Miranda Mundt Date: Tue, 4 Aug 2020 14:22:24 -0600 Subject: [PATCH 4/5] No coverage to combine --- .github/workflows/pr_master_test.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr_master_test.yml b/.github/workflows/pr_master_test.yml index dce8d7f..fbe4de7 100644 --- a/.github/workflows/pr_master_test.yml +++ b/.github/workflows/pr_master_test.yml @@ -173,7 +173,8 @@ jobs: env: CODECOV_NAME: ${{matrix.TARGET}}/${{matrix.python}}${{matrix.NAME}} run: | - coverage combine + [ ! -d ${GITHUB_WORKSPACE}/cache/download ] && mkdir -pv ${GITHUB_WORKSPACE}/cache/download + coverage combine || echo "Nothing to combine." coverage report -i coverage xml -i set +e From f36d6ba2a2034cd6d2d567617a9b2fe51b3b7bae Mon Sep 17 00:00:00 2001 From: Miranda Mundt Date: Tue, 4 Aug 2020 16:04:17 -0600 Subject: [PATCH 5/5] Resetting to master --- .github/workflows/pr_master_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr_master_test.yml b/.github/workflows/pr_master_test.yml index fbe4de7..b25fc92 100644 --- a/.github/workflows/pr_master_test.yml +++ b/.github/workflows/pr_master_test.yml @@ -3,7 +3,7 @@ name: GitHub CI on: push: branches: - - workflow_logic + - master pull_request: branches: - master