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

[pull] main from coverallsapp:main #3

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
os: [ubuntu-latest, windows-latest, macos-latest]
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]
coverage_reporter_version: ['v0.6.14', 'latest', '']
steps:
- name: Checkout code
uses: actions/checkout@v3
Expand All @@ -40,10 +41,11 @@ jobs:
uses: ./
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
fail-on-error: ${{ matrix.fail_on_error }}
debug: true
fail-on-error: ${{ matrix.fail_on_error }}
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`
coverage-reporter-version: ${{ matrix.coverage_reporter_version != '' && matrix.coverage_reporter_version || '' }}
env:
CI: true
continue-on-error: ${{ matrix.fail_on_error }}
continue-on-error: true
32 changes: 32 additions & 0 deletions .github/workflows/update-major-version-tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Update Major Version Tag

on:
release:
types: [published]

jobs:
update-major-version-tag:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Extract Major Version
id: extract_major_version
run: |
# Extract the major version part (e.g., "v2" from "v2.3.1")
echo "release_tag=${{ github.event.release.tag_name }}" >> $GITHUB_ENV
major_version=$(echo "${{ github.event.release.tag_name }}" | grep -oE "^v[0-9]+")
echo "major_version=$major_version" >> $GITHUB_ENV

- name: Update Major Version Tag
run: |
git fetch --tags
git tag -f ${{ env.major_version }} ${{ github.event.release.tag_name }}
git push origin ${{ env.major_version }} --force

- name: Fetch Updated Tags
run: git fetch --tags --force

- name: Verify Tag
run: git show ${{ env.major_version }}
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,11 @@ This action's step needs to run after your test suite has outputted a coverage r
| `fail-on-error` | _optional_ | Default: `true`. Set to `false` to avoid CI failure when upload fails due to any errors. |
| `coverage-reporter-version` | _optional_ | Default: `latest`. Version of coverage-reporter to use. Make sure to prefix the version number with 'v'. For example: v0.6.9. Not available currently on macOS. |

### Outputs:

* `coveralls-api-result`: JSON response from the Coveralls API with a status code and url for the Job on Coveralls.
<!-- Leaving this here until we decide whether to bring back `coveralls-api-result` in v2 -->
<!-- Please submit any questions, suggestions, requests to: [email protected] -->
<!-- ### Outputs: -->
<!-- * `coveralls-api-result`: JSON response from the Coveralls API with a status code and url for the Job on Coveralls. -->
<!-- // Leaving this here until we decide whether to bring back `coveralls-api-result` in v2 -->

### Standard Example:

Expand Down
10 changes: 7 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,11 @@ runs:
shell: bash
run: |
echo "The coverage-reporter-version parameter is not available on macOS." >&2
exit 1
if [[ "${{ inputs.fail-on-error }}" == "true" ]]; then
exit 1
else
exit 0
fi

- name: Install coveralls reporter (Linux)
if: runner.os == 'Linux'
Expand All @@ -120,7 +124,7 @@ runs:
cd ~/bin/

# Determine which version of coverage-reporter to download
if [ "$COVERAGE_REPORTER_VERSION" == "latest" ]; then
if [ -z "$COVERAGE_REPORTER_VERSION" ] || [ "$COVERAGE_REPORTER_VERSION" == "latest" ]; then
asset_path="latest/download"
else
asset_path="download/${COVERAGE_REPORTER_VERSION}"
Expand Down Expand Up @@ -167,7 +171,7 @@ runs:
# Try to download the binary and checksum file
New-Item -Path $env:HOME\bin -ItemType directory -Force
Push-Location $env:HOME\bin
if($env:COVERAGE_REPORTER_VERSION -eq "latest") {
if ([string]::IsNullOrEmpty($env:COVERAGE_REPORTER_VERSION) -or $env:COVERAGE_REPORTER_VERSION -eq "latest") {
Invoke-WebRequest -Uri "https://github.com/coverallsapp/coverage-reporter/releases/latest/download/coveralls-windows.exe" -OutFile "coveralls.exe"
Invoke-WebRequest -Uri "https://github.com/coverallsapp/coverage-reporter/releases/latest/download/coveralls-checksums.txt" -OutFile "sha256sums.txt"
} else {
Expand Down