diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 568363b1..3a6802f1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,7 +14,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, windows-latest, macos-latest] - action: [report, done] # Note: We're also testing 'install' since it's implicitly in each of these two actions + action: [report, done, build-number-report, build-number-done] # Note: We're also testing 'install' since it's implicit in each action fail_on_error: [true, false] steps: - name: Checkout code @@ -36,13 +36,14 @@ jobs: run: | echo "Running on Windows" - - name: Run Test Action + - name: Test Action uses: ./ with: github-token: ${{ secrets.GITHUB_TOKEN }} fail-on-error: ${{ matrix.fail_on_error }} debug: true - parallel-finished: ${{ matrix.action == 'done' }} # Only set 'parallel-finished' to true when testing 'done' + build-number: ${{ (matrix.action == 'build-number-report' || matrix.action == 'build-number-done') && github.sha || '' }} # Only set 'build-number' to `${{ github.sha }}` when testing `build-number-report` or `build-number-done` + parallel-finished: ${{ matrix.action == 'done' || matrix.action == 'build-number-done' }} # Only set `parallel-finished` to `true` when testing `done` or `build-number-done` env: CI: true continue-on-error: ${{ matrix.fail_on_error }} diff --git a/action.yml b/action.yml index ab37dc7f..e9032638 100644 --- a/action.yml +++ b/action.yml @@ -22,6 +22,9 @@ inputs: flag-name: description: 'Job flag name, e.g. "Unit", "Functional", or "Integration". Will be shown in the Coveralls UI.' required: false + build-number: + description: 'Override the build number autodetected from CI. This is useful if your CI tool assigns a different build number per each parallel build.' + required: false parallel: description: 'Set to true if you are running parallel jobs, then use "parallel-finished: true" for the last action.' required: false @@ -195,6 +198,7 @@ runs: coveralls done ${{ inputs.debug == 'true' && '--debug' || '' }} ${{ inputs.measure == 'true' && '--measure' || '' }} + ${{ inputs.build-number && format('--build-number {0}', inputs.build-number) || '' }} ${{ inputs.fail-on-error == 'false' && '--no-fail' || '' }} env: COVERALLS_DEBUG: ${{ inputs.debug }} @@ -216,6 +220,7 @@ runs: ${{ inputs.fail-on-error == 'false' && '--no-fail' || '' }} ${{ inputs.allow-empty == 'true' && '--allow-empty' || '' }} ${{ inputs.base-path && format('--base-path {0}', inputs.base-path) || '' }} + ${{ inputs.build-number && format('--build-number {0}', inputs.build-number) || '' }} ${{ inputs.format && format('--format {0}', inputs.format) || '' }} ${{ inputs.file || inputs.path-to-lcov }} ${{ inputs.files }}