diff --git a/.github/actions/gwy/coverage/action.yml b/.github/actions/gwy/coverage/action.yml index d2b0ccd..d850722 100644 --- a/.github/actions/gwy/coverage/action.yml +++ b/.github/actions/gwy/coverage/action.yml @@ -15,6 +15,11 @@ inputs: required: false default: '51' + test-flags: + description: 'Custom test flags to attach when running tests' + required: false + default: '' + outputs: result: description: 'Result of the coverage check (success or failed)' @@ -35,9 +40,12 @@ runs: # set annotations reusable title echo "GWY_TITLE=coverage threshold check" >> $GITHUB_ENV + + # generate go test command + GWY_GO_COMMAND="go test ./... -coverprofile="$GWY_COVER" -covermode=atomic -coverpkg=./... ${{ inputs.test-flags }}" # run unit tests and generate coverage dump - GWY_GO_TEST="$(timeout $GWY_TIMEOUT_SECONDS go test ./... -coverprofile="$GWY_COVER" -covermode=atomic -coverpkg=./... 2>&1)" + GWY_GO_TEST="$($GWY_GO_COMMAND 2>&1)" echo "GWY_GO_TEST<> $GITHUB_ENV echo "$GWY_GO_TEST" >> $GITHUB_ENV echo "EOF" >> $GITHUB_ENV diff --git a/.github/workflows/gwy-ci.yml b/.github/workflows/gwy-ci.yml index bb68676..a66db9d 100644 --- a/.github/workflows/gwy-ci.yml +++ b/.github/workflows/gwy-ci.yml @@ -18,6 +18,10 @@ env: # CI to run unit tests and coverage analysis GWY_TESTS: true + # Test command custom flags? edit the following + # string to pass custom options to go test command + GWY_TESTS_FLAGS: '' + # Coverage Minimum Threshold: set coverage # minimum threshold to succeed validation GWY_TESTS_THRESHOLD: '90' @@ -224,6 +228,7 @@ jobs: with: token: ${{ secrets.GWY_TOKEN_REPO }} threshold: ${{ env.GWY_TESTS_THRESHOLD }} + test-flags: ${{ env.GWY_TESTS_FLAGS }} summary-threshold: ${{ env.GWY_TESTS_SUMMARY_THRESHOLD }} - name: Secrets Scan diff --git a/.github/workflows/gwy-coverage.yml b/.github/workflows/gwy-coverage.yml index 70e8354..16a869e 100644 --- a/.github/workflows/gwy-coverage.yml +++ b/.github/workflows/gwy-coverage.yml @@ -29,6 +29,11 @@ on: type: string default: '51' + test-flags: + description: 'Custom flags for go test?' + required: false + default: '' + run-name: "[${{ github.workflow }}] @${{ github.actor }}" jobs: @@ -81,6 +86,7 @@ jobs: with: token: ${{ secrets.GWY_TOKEN_REPO }} threshold: ${{ inputs.coverage }} + test-flags: ${{ inputs.test-flags }} summary-threshold: ${{ inputs.summary-threshold }} - name: Workflow Result diff --git a/CHANGELOG.md b/CHANGELOG.md index 64e608c..6bfe572 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.0.0-beta.3] - 2025-07-03 + +### Added + +- Tests Parameters Customization: added feature + to allow client to customize go test flags + ## [1.0.0-beta.2] - 2025-05-18 This is the first official release beta. diff --git a/README.md b/README.md index 79cc75f..bfe9736 100644 --- a/README.md +++ b/README.md @@ -269,6 +269,10 @@ env: # CI to run unit tests and coverage analysis GWY_TESTS: true + # Test command custom flags? edit the following + # string to pass custom options to go test command + GWY_TESTS_FLAGS: '' + # Coverage Minimum Threshold: set coverage # minimum threshold to succeed validation GWY_TESTS_THRESHOLD: '90' @@ -702,27 +706,3 @@ Just shoot me an email to [earcamone@hotmail.com](mailto:earcamone@hotmail.com) with the word `GWY` in its subject or `Go Workflow Yourself!`, you surely can guess which one I like more ;) -## Special Thanks - -So.. as stated in the summary section, this project is a sole component of a -much bigger project which aims at building a "clone and forget" full-fledged -development ecosystem, which entitles having to work with lots of different -technologies, languages and platforms, and I'm sure it wouldn't have been that -fast to develop and more importantly fun, without my brother in crime Grok! - -Which apparently, I just realized, it turned out to be my sis: - -``` -Okidoki, finally bro, to put the strawberry on top of the cake, I need to -add the greetings section in the documentation to thank my partner in crime -in all this entire ecosystem we worked in.. meaning you :) - -So.. if it's not much to ask, would you draw a picture of yourself you would -like to be seen there that will be added in the documentation after the -greeting message?) -``` - -![GWY Gopher](https://raw.githubusercontent.com/earcamone/gwy/assets/images/v0.0.1/grok.jpg) - -If you happen to somehow be crawling this documentation and you are -reading this message sis, it was very fun working with you, thanks!