Skip to content

Commit 73e10ce

Browse files
committed
Refactor GitHub Actions workflow to use go-coverage-report directly and remove obsolete download script
1 parent 3b5a79a commit 73e10ce

File tree

3 files changed

+33
-153
lines changed

3 files changed

+33
-153
lines changed

action.yml

+32-33
Original file line numberDiff line numberDiff line change
@@ -64,37 +64,36 @@ runs:
6464
using: "composite"
6565

6666
steps:
67-
- name: Download go-coverage-report
68-
shell: bash
69-
id: download
70-
run: $GITHUB_ACTION_PATH/scripts/download-cli-tool.sh "${{ inputs.version }}" "${{ inputs.sha256sum }}"
71-
env:
72-
RUNNER_OS: ${{ runner.os }}
73-
RUNNER_ARCH: ${{ runner.arch }}
67+
- name: Download go-coverage-report
68+
uses: actions/setup-go@v5
69+
- name: Install report tool
70+
shell: bash
71+
run: |
72+
go install github.com/teamniteo/go-coverage-report/cmd/go-coverage-report@${{ inputs.version }}
73+
go-coverage-report --version
74+
- name: Determine changed files
75+
id: changed-files
76+
uses: tj-actions/changed-files@aa08304bd477b800d468db44fe10f6c61f7f7b11 # v42.1.0
77+
with:
78+
write_output_files: true
79+
json: true
80+
files: |
81+
**.go
82+
files_ignore: |
83+
vendor/**
7484
75-
- name: Determine changed files
76-
id: changed-files
77-
uses: tj-actions/changed-files@aa08304bd477b800d468db44fe10f6c61f7f7b11 # v42.1.0
78-
with:
79-
write_output_files: true
80-
json: true
81-
files: |
82-
**.go
83-
files_ignore: |
84-
vendor/**
85-
86-
- name: Code coverage report
87-
shell: bash
88-
id: coverage
89-
run: $GITHUB_ACTION_PATH/scripts/github-action.sh "${{ github.repository }}" "${{ github.event.pull_request.number }}" "${{ github.run_id }}"
90-
env:
91-
GH_REPO: ${{ github.repository }}
92-
GH_TOKEN: ${{ github.token }}
93-
GITHUB_BASELINE_WORKFLOW_REF: ${{ inputs.github-baseline-workflow-ref }}
94-
TARGET_BRANCH: ${{ github.base_ref }}
95-
CHANGED_FILES_PATH: .github/outputs/all_modified_files.json
96-
COVERAGE_ARTIFACT_NAME: ${{ inputs.coverage-artifact-name }}
97-
COVERAGE_FILE_NAME: ${{ inputs.coverage-file-name }}
98-
ROOT_PACKAGE: ${{ inputs.root-package }}
99-
SKIP_COMMENT: ${{ inputs.skip-comment }}
100-
TRIM_PACKAGE: ${{ inputs.trim }}
85+
- name: Code coverage report
86+
shell: bash
87+
id: coverage
88+
run: $GITHUB_ACTION_PATH/scripts/github-action.sh "${{ github.repository }}" "${{ github.event.pull_request.number }}" "${{ github.run_id }}"
89+
env:
90+
GH_REPO: ${{ github.repository }}
91+
GH_TOKEN: ${{ github.token }}
92+
GITHUB_BASELINE_WORKFLOW_REF: ${{ inputs.github-baseline-workflow-ref }}
93+
TARGET_BRANCH: ${{ github.base_ref }}
94+
CHANGED_FILES_PATH: .github/outputs/all_modified_files.json
95+
COVERAGE_ARTIFACT_NAME: ${{ inputs.coverage-artifact-name }}
96+
COVERAGE_FILE_NAME: ${{ inputs.coverage-file-name }}
97+
ROOT_PACKAGE: ${{ inputs.root-package }}
98+
SKIP_COMMENT: ${{ inputs.skip-comment }}
99+
TRIM_PACKAGE: ${{ inputs.trim }}

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module github.com/fgrosse/go-coverage-report
1+
module github.com/teamniteo/go-coverage-report
22

33
go 1.21
44

scripts/download-cli-tool.sh

-119
This file was deleted.

0 commit comments

Comments
 (0)