From 3f80d96ea83b6328ccafa5960807d66b9b58b4fc Mon Sep 17 00:00:00 2001 From: Nicholas McDonnell <50747025+mcdonnnj@users.noreply.github.com> Date: Sat, 3 Apr 2021 17:34:19 -0400 Subject: [PATCH 1/2] Use secrets.GITHUB_TOKEN for coveralls in GHA workflow coveralls-python has better integration with running in GitHub Actions now, so we can use the automatically generated GITHUB_TOKEN secret instead of manually setting a COVERALLS_REPO_TOKEN secret for each repository. --- .github/workflows/build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0134014..02ea543 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -75,7 +75,8 @@ jobs: - name: Upload coverage report run: coveralls env: - COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} + COVERALLS_SERVICE_NAME: github + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} if: success() build: runs-on: ubuntu-latest From 30a1c14cebf6cb74b2270e8bf9aa4ec829c99645 Mon Sep 17 00:00:00 2001 From: Nicholas McDonnell <50747025+mcdonnnj@users.noreply.github.com> Date: Sat, 3 Apr 2021 17:38:42 -0400 Subject: [PATCH 2/2] Update coveralls GHA configuration for parallelization We already ran our tests in parallel for each major version of Python a project supports. This change should better differentiate each test job run in the reports submitted. --- .github/workflows/build.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 02ea543..695e8cc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -75,9 +75,39 @@ jobs: - name: Upload coverage report run: coveralls env: + COVERALLS_FLAG_NAME: "py${{ matrix.python-version }}" + COVERALLS_PARALLEL: true COVERALLS_SERVICE_NAME: github GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} if: success() + coveralls-finish: + runs-on: ubuntu-latest + needs: test + steps: + - uses: actions/checkout@v2 + - id: setup-python + uses: actions/setup-python@v2 + with: + python-version: 3.9 + - uses: actions/cache@v2 + env: + BASE_CACHE_KEY: "${{ github.job }}-${{ runner.os }}-\ + py${{ steps.setup-python.outputs.python-version }}-" + with: + path: ${{ env.PIP_CACHE_DIR }} + key: "${{ env.BASE_CACHE_KEY }}\ + ${{ hashFiles('**/requirements-test.txt') }}-\ + ${{ hashFiles('**/requirements.txt') }}" + restore-keys: | + ${{ env.BASE_CACHE_KEY }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install --upgrade --requirement requirements-test.txt + - name: Finished coveralls reports + run: coveralls --finish + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} build: runs-on: ubuntu-latest needs: [lint, test]