Skip to content

Commit 26dd724

Browse files
committed
test
1 parent dd70f04 commit 26dd724

File tree

3 files changed

+76
-70
lines changed

3 files changed

+76
-70
lines changed

.github/workflows/action-test.yml

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,42 @@
11
name: action-test
22
on: [push]
33
jobs:
4-
build-dev-image:
5-
name: build dev image
6-
permissions:
7-
packages: write
8-
runs-on: ubuntu-latest
9-
steps:
10-
- name: checkout
11-
uses: actions/checkout@v4
12-
13-
- name: login to GitHub container registry
14-
uses: docker/login-action@v3
15-
with:
16-
registry: ghcr.io
17-
username: ${{ github.repository_owner }}
18-
password: ${{ secrets.GITHUB_TOKEN }}
19-
20-
- name: build and push
21-
uses: docker/build-push-action@v6
22-
with:
23-
push: true
24-
build-args: |
25-
VERSION=dev
26-
tags: |
27-
ghcr.io/vladopajic/go-test-coverage:dev
28-
29-
- uses: actions/delete-package-versions@v5
30-
with:
31-
owner: vladopajic
32-
package-name: go-test-coverage
33-
package-type: container
34-
min-versions-to-keep: 5
35-
delete-only-untagged-versions: true
4+
# build-dev-image:
5+
# name: build dev image
6+
# permissions:
7+
# packages: write
8+
# runs-on: ubuntu-latest
9+
# steps:
10+
# - name: checkout
11+
# uses: actions/checkout@v4
12+
13+
# - name: login to GitHub container registry
14+
# uses: docker/login-action@v3
15+
# with:
16+
# registry: ghcr.io
17+
# username: ${{ github.repository_owner }}
18+
# password: ${{ secrets.GITHUB_TOKEN }}
19+
20+
# - name: build and push
21+
# uses: docker/build-push-action@v6
22+
# with:
23+
# push: true
24+
# build-args: |
25+
# VERSION=dev
26+
# tags: |
27+
# ghcr.io/vladopajic/go-test-coverage:dev
28+
29+
# - uses: actions/delete-package-versions@v5
30+
# with:
31+
# owner: vladopajic
32+
# package-name: go-test-coverage
33+
# package-type: container
34+
# min-versions-to-keep: 5
35+
# delete-only-untagged-versions: true
3636
test:
3737
name: test
3838
runs-on: ubuntu-latest
39-
needs: build-dev-image
39+
#needs: build-dev-image
4040

4141
steps:
4242
- name: checkout
@@ -50,11 +50,11 @@ jobs:
5050
- name: generate test coverage
5151
run: go test ./... -coverprofile=./cover.out -covermode=atomic
5252

53-
- name: set action image version to dev
54-
run: |
55-
yq e -i '.runs.image = "docker://ghcr.io/vladopajic/go-test-coverage:dev"' action.yml
56-
image=$(yq '.runs.image' action.yml)
57-
echo "Image: $image"
53+
# - name: set action image version to dev
54+
# run: |
55+
# yq e -i '.runs.image = "docker://ghcr.io/vladopajic/go-test-coverage:dev"' action.yml
56+
# image=$(yq '.runs.image' action.yml)
57+
# echo "Image: $image"
5858

5959
## Test 1
6060

action.yml

Lines changed: 37 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
name: go-test-coverage
22
author: vladopajic
33
description: go-test-coverage is a tool designed to report issues when test coverage falls below a specified threshold.
4+
branding:
5+
icon: 'code'
6+
color: 'blue'
7+
48
inputs:
59
# Config
610
config:
@@ -16,7 +20,7 @@ inputs:
1620
debug:
1721
description: Prints additional debugging output when running action.
1822
required: false
19-
default: false
23+
default: true
2024
type: boolean
2125

2226
# Individual properties
@@ -136,33 +140,35 @@ outputs:
136140
description: Deprecated! Text label for the badge.
137141

138142
runs:
139-
using: docker
140-
# VERSION: when changing version update version in other places
141-
image: docker://ghcr.io/vladopajic/go-test-coverage:v2.14.1
142-
args:
143-
- --config=${{ inputs.config || '''''' }}
144-
- --profile=${{ inputs.profile || '''''' }}
145-
- --source-dir=${{ inputs.source-dir || '''''' }}
146-
- --debug=${{ inputs.debug }}
147-
- --github-action-output=true
148-
- --threshold-file=${{ inputs.threshold-file }}
149-
- --threshold-package=${{ inputs.threshold-package }}
150-
- --threshold-total=${{ inputs.threshold-total }}
151-
- --breakdown-file-name=${{ inputs.breakdown-file-name || '''''' }}
152-
- --diff-base-breakdown-file-name=${{ inputs.diff-base-breakdown-file-name || '''''' }}
153-
- --badge-file-name=${{ inputs.badge-file-name || '''''' }}
154-
- --cdn-key=${{ inputs.cdn-key || '''''' }}
155-
- --cdn-secret=${{ inputs.cdn-secret || '''''' }}
156-
- --cdn-region=${{ inputs.cdn-region || '''''' }}
157-
- --cdn-endpoint=${{ inputs.cdn-endpoint || '''''' }}
158-
- --cdn-file-name=${{ inputs.cdn-file-name || '''''' }}
159-
- --cdn-bucket-name=${{ inputs.cdn-bucket-name || '''''' }}
160-
- --cdn-force-path-style=${{ inputs.cdn-force-path-style }}
161-
- --git-token=${{ inputs.git-token || '''''' }}
162-
- --git-branch=${{ inputs.git-branch || '''''' }}
163-
- --git-repository=${{ inputs.git-repository || ''''''}}
164-
- --git-file-name=${{ inputs.git-file-name || '''''' }}
165-
166-
branding:
167-
icon: 'code'
168-
color: 'blue'
143+
using: composite
144+
steps:
145+
- uses: actions/setup-go@v5
146+
with:
147+
go-version: '1.24'
148+
149+
- name: run go-test-coverage
150+
shell: bash
151+
run: |
152+
go run github.com/vladopajic/go-test-coverage/v2@78970591c7bd59dc59031d62c210798ef618d1e0 \
153+
--config=${{ inputs.config || '***' }} \
154+
--profile=${{ inputs.profile || '***' }} \
155+
--source-dir=${{ inputs.source-dir || '***' }} \
156+
--debug=${{ inputs.debug }} \
157+
--github-action-output=true \
158+
--threshold-file=${{ inputs.threshold-file }} \
159+
--threshold-package=${{ inputs.threshold-package }} \
160+
--threshold-total=${{ inputs.threshold-total }} \
161+
--breakdown-file-name=${{ inputs.breakdown-file-name || '***' }} \
162+
--diff-base-breakdown-file-name=${{ inputs.diff-base-breakdown-file-name || '***' }} \
163+
--badge-file-name=${{ inputs.badge-file-name || '***' }} \
164+
--cdn-key=${{ inputs.cdn-key || '***' }} \
165+
--cdn-secret=${{ inputs.cdn-secret || '***' }} \
166+
--cdn-region=${{ inputs.cdn-region || '***' }} \
167+
--cdn-endpoint=${{ inputs.cdn-endpoint || '***' }} \
168+
--cdn-file-name=${{ inputs.cdn-file-name || '***' }} \
169+
--cdn-bucket-name=${{ inputs.cdn-bucket-name || '***' }} \
170+
--cdn-force-path-style=${{ inputs.cdn-force-path-style }} \
171+
--git-token=${{ inputs.git-token || '***' }} \
172+
--git-branch=${{ inputs.git-branch || '***' }} \
173+
--git-repository=${{ inputs.git-repository || '***'}} \
174+
--git-file-name=${{ inputs.git-file-name || '***' }}

main_config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212

1313
const (
1414
// default value of string variables passed by CI
15-
ciDefaultString = `''`
15+
ciDefaultString = `***`
1616
// default value of int variables passed by CI
1717
ciDefaultInt = -1
1818
)

0 commit comments

Comments
 (0)