Skip to content
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

add build number to inputs #199

Conversation

brianatgather
Copy link

For monorepos the github actions job level path filters are cumbersome to the point that my predecessors opted to make all coverage tests just be their own workflows. This has the artifact of every commit and the associated job triggers multi-pushing reports under different build ids where from our perspective they are part of the same commit/run.

This PR let's use overload build-number for those cases

@afinetooth
Copy link
Member

afinetooth commented Oct 10, 2024

@brianatgather sorry for the delayed response. Trying to process some of these older PRs.

This PR is good and makes sense---thanks your for your contribution. That said, I need to pass it to engineering to approve the parameter name, which is relevant to some planned changes.

In the meantime, I wanted to let you know (and anyone else with the use case of needing to override the build number), that this is available now through the use of Coveralls environment variables.

In this case, you'd want to set COVERALLS_SERVICE_NUMBER:

A common alternative build number used to tie all GitHub Actions workflows together is the commit SHA (${{ github.sha }}), so a configuration like the one below will override the default build number our action sources from the CI environment (ie. ${{ github.run_id }} from GitHub Actions):

    - name: Coveralls Parallel Upload
      uses: coverallsapp/github-action@v2
      env:
        COVERALLS_SERVICE_NUMBER: ${{ github.sha }} # default: ${{ github.run_id }}
      with:
        parallel: true
        flag_name: my-flag-name-1

In which case, you'll want to make sure to pass that, or whatever you used, to the "Parallel finished" step:

    - name: Coveralls Finished
      uses: coverallsapp/github-action@v2
      env:
        COVERALLS_SERVICE_NUMBER: ${{ github.sha }}
      with:
        parallel-finished: true
        carryforward: "my-flag-name-1,my-flag-name-2"

@afinetooth
Copy link
Member

Hi @brianatgather, I moved your changes to PR #228, where I rebased it on top of main which now contains some tests.

@afinetooth afinetooth closed this Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants