-
Notifications
You must be signed in to change notification settings - Fork 178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is there a way to post coverage from Github Actions in parallel mode? #294
Comments
Hey, it's unlikely you are experiencing this problem still, but I was! ProblemI want to run my partitioned test suite and post a coverage report of the merged partitions. The SolutionCombination of This psuedo-sample github action below shows how it worked for us.
test:
needs: build
runs-on: ubuntu-latest
name: Test-OTP ${{matrix.otp}}/Elixir ${{matrix.elixir}}/${{matrix.test_partition}}
strategy:
matrix:
test_partition: [1, 2]
otp: [26.1.1]
elixir: [1.15.6]
services:
db: …
steps:
- name: Install OTP and Elixir
- other setup like cache etc…
- name: Run Tests and Generate Coverage Report
run: |
MIX_TEST_PARTITION=${{ matrix.test_partition }} mix coveralls.lcov --partitions 2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload Parallel Coverage Report
uses: coverallsapp/github-action@v2
with:
flag-name: run-${{matrix.test_partition}}
parallel: true
finish:
needs: test
if: ${{ always() }}
runs-on: ubuntu-latest
steps:
- name: Close parallel build
uses: coverallsapp/github-action@v2
with:
parallel-finished: true
carryforward: "run-1,run-2" Fun keywords that may help others find this:
|
@shamshirz thanks a lot! When I initially tackled this issue, I constructed the request to Coveralls in the following way: Would you mind sharing your thoughts on whether your suggested approach might be more effective than mine? |
tl;dr I think yours is equally good 👍 No complaint Mine: I don't think it makes much difference. If it could've gotten the Ultimately, I ended up going back to a non-parallel approach and we only update the coverage badge after merges into main, rather than doing the coverage check as part of each PR. |
Hi there!
Is there a way to post coverage from Github Actions in parallel mode?
Something like
mix coveralls.github --parallel true
and then setup another job sending the webhook to https://coveralls.io/webhook?repo_token=…I know that
mix coveralls.post
does allow thisparallel
option.The text was updated successfully, but these errors were encountered: