Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: vektra/mockery
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v2.30.2
Choose a base ref
...
head repository: vektra/mockery
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
Showing with 8,900 additions and 2,116 deletions.
  1. +2 −2 .github/ISSUE_TEMPLATE.md
  2. +3 −12 .github/PULL_REQUEST_TEMPLATE.md
  3. +11 −3 .github/workflows/documentation.yml
  4. +0 −27 .github/workflows/golangci-lint.yml
  5. +0 −42 .github/workflows/release.yml
  6. +33 −0 .github/workflows/reusable-testing.yml
  7. +98 −0 .github/workflows/tag-and-release.yml
  8. +15 −0 .github/workflows/testing-dispatch.yml
  9. +3 −31 .github/workflows/testing.yml
  10. +3 −1 .gitignore
  11. +20 −2 .golangci.yml
  12. +16 −16 .goreleaser.yml
  13. +99 −3 .mockery.yaml
  14. +1 −1 CONTRIBUTING.md
  15. +3 −1 Dockerfile
  16. +1 −24 README.md
  17. +39 −20 Taskfile.yml
  18. +166 −161 cmd/mockery.go
  19. +8 −9 cmd/mockery_test.go
  20. +11 −8 cmd/showconfig.go
  21. +3 −3 codecov.yml
  22. +1 −0 docs/assets/images/logos/amazon.svg
  23. BIN docs/assets/images/logos/cerbos.png
  24. +1 −0 docs/assets/images/logos/datadog.svg
  25. +1 −0 docs/assets/images/logos/go-task.svg
  26. +16 −0 docs/assets/images/logos/google.svg
  27. +57 −0 docs/assets/images/logos/grafana.svg
  28. +1 −0 docs/assets/images/logos/hashicorp.svg
  29. BIN docs/assets/images/logos/ignite-cli.png
  30. BIN docs/assets/images/logos/jaeger.png
  31. +11 −0 docs/assets/images/logos/mongodb.svg
  32. +167 −0 docs/assets/images/logos/seatgeek.svg
  33. +15 −0 docs/assets/images/logos/splunk.svg
  34. +1 −0 docs/assets/images/logos/tendermint.svg
  35. +14 −0 docs/assets/images/logos/uber.svg
  36. +1 −1 docs/changelog.md
  37. +242 −102 docs/configuration.md
  38. +146 −0 docs/deprecations.md
  39. +22 −3 docs/examples.md
  40. +98 −113 docs/features.md
  41. +68 −21 docs/index.md
  42. +38 −4 docs/installation.md
  43. +6 −0 docs/javascripts/tablesort.js
  44. +71 −6 docs/migrating_to_packages.md
  45. +12 −9 docs/notes.md
  46. +2 −2 docs/requirements.txt
  47. +21 −38 docs/running.md
  48. +24 −0 docs/stylesheets/extra.css
  49. +6 −0 e2e/.mockery-disable-func-mock.yaml
  50. +10 −2 e2e/run_all.sh
  51. +24 −0 e2e/test_disable_func_mocks.sh
  52. +11 −0 e2e/test_disable_include_auto_generated.sh
  53. +2 −6 e2e/test_infinite_mocking.sh
  54. +5 −0 e2e/test_missing_interface/.mockery.yml
  55. +15 −0 e2e/test_missing_interface/run.sh
  56. +2 −5 e2e/test_mockery_generation.sh
  57. +9 −0 e2e/test_recursive_package_with_only_autogenerated_files.sh
  58. +32 −28 go.mod
  59. +71 −494 go.sum
  60. +2 −1 go.work
  61. +1,032 −14 go.work.sum
  62. +26 −7 mkdocs.yml
  63. +1 −0 mockery-tools.env
  64. +10 −2 mocks/github.com/vektra/mockery/v2/pkg/{TypesPackage.go → TypesPackage_mock.go}
  65. +5 −1 mocks/github.com/vektra/mockery/v2/pkg/fixtures/{A.go → A_mock.go}
  66. +15 −3 mocks/github.com/vektra/mockery/v2/pkg/fixtures/{AsyncProducer.go → AsyncProducer_mock.go}
  67. +4 −0 mocks/github.com/vektra/mockery/v2/pkg/fixtures/{Blank.go → Blank_mock.go}
  68. +9 −1 mocks/github.com/vektra/mockery/v2/pkg/fixtures/{ConsulLock.go → ConsulLock_mock.go}
  69. +8 −2 mocks/github.com/vektra/mockery/v2/pkg/fixtures/{EmbeddedGet.go → EmbeddedGet_mock.go}
  70. +58 −3 mocks/github.com/vektra/mockery/v2/pkg/fixtures/{Example.go → Example_mock.go}
  71. +18 −4 ...vektra/mockery/v2/pkg/fixtures/{ExpecterAndRolledVariadic.go → ExpecterAndRolledVariadic_mock.go}
  72. +18 −2 mocks/github.com/vektra/mockery/v2/pkg/fixtures/{Expecter.go → Expecter_mock.go}
  73. +9 −1 mocks/github.com/vektra/mockery/v2/pkg/fixtures/{Fooer.go → Fooer_mock.go}
  74. +4 −0 mocks/github.com/vektra/mockery/v2/pkg/fixtures/{FuncArgsCollision.go → FuncArgsCollision_mock.go}
  75. +78 −0 mocks/github.com/vektra/mockery/v2/pkg/fixtures/GenericInterface_mock.go
  76. +8 −2 mocks/github.com/vektra/mockery/v2/pkg/fixtures/{GetGeneric.go → GetGeneric_mock.go}
  77. +5 −1 mocks/github.com/vektra/mockery/v2/pkg/fixtures/{GetInt.go → GetInt_mock.go}
  78. +9 −1 ...ra/mockery/v2/pkg/fixtures/{HasConflictingNestedImports.go → HasConflictingNestedImports_mock.go}
  79. +11 −3 ...ithub.com/vektra/mockery/v2/pkg/fixtures/{ImportsSameAsPackage.go → ImportsSameAsPackage_mock.go}
  80. +78 −0 mocks/github.com/vektra/mockery/v2/pkg/fixtures/InstantiatedGenericInterface_mock.go
  81. +90 −0 mocks/github.com/vektra/mockery/v2/pkg/fixtures/Issue766_mock.go
  82. +4 −0 mocks/github.com/vektra/mockery/v2/pkg/fixtures/{KeyManager.go → KeyManager_mock.go}
  83. +4 −0 mocks/github.com/vektra/mockery/v2/pkg/fixtures/{MapFunc.go → MapFunc_mock.go}
  84. +1 −1 mocks/github.com/vektra/mockery/v2/pkg/fixtures/{MapToInterface.go → MapToInterface_mock.go}
  85. +4 −0 mocks/github.com/vektra/mockery/v2/pkg/fixtures/{MyReader.go → MyReader_mock.go}
  86. +77 −0 mocks/github.com/vektra/mockery/v2/pkg/fixtures/PanicOnNoReturnValue_mock.go
  87. +79 −0 mocks/github.com/vektra/mockery/v2/pkg/fixtures/ReplaceGenericSelf_mock.go
  88. +179 −0 mocks/github.com/vektra/mockery/v2/pkg/fixtures/ReplaceGeneric_mock.go
  89. +4 −0 mocks/github.com/vektra/mockery/v2/pkg/fixtures/{Requester2.go → Requester2_mock.go}
  90. +5 −1 mocks/github.com/vektra/mockery/v2/pkg/fixtures/{Requester3.go → Requester3_mock.go}
  91. +2 −2 mocks/github.com/vektra/mockery/v2/pkg/fixtures/{Requester4.go → Requester4_mock.go}
  92. +4 −0 ...m/vektra/mockery/v2/pkg/fixtures/{RequesterArgSameAsImport.go → RequesterArgSameAsImport_mock.go}
  93. +4 −0 ...ockery/v2/pkg/fixtures/{RequesterArgSameAsNamedImport.go → RequesterArgSameAsNamedImport_mock.go}
  94. +1 −1 ...hub.com/vektra/mockery/v2/pkg/fixtures/{RequesterArgSameAsPkg.go → RequesterArgSameAsPkg_mock.go}
  95. +4 −0 mocks/github.com/vektra/mockery/v2/pkg/fixtures/{RequesterArray.go → RequesterArray_mock.go}
  96. +4 −0 mocks/github.com/vektra/mockery/v2/pkg/fixtures/{RequesterElided.go → RequesterElided_mock.go}
  97. +24 −8 mocks/github.com/vektra/mockery/v2/pkg/fixtures/{RequesterGenerics.go → RequesterGenerics_mock.go}
  98. +5 −1 mocks/github.com/vektra/mockery/v2/pkg/fixtures/{RequesterIface.go → RequesterIface_mock.go}
  99. +4 −0 mocks/github.com/vektra/mockery/v2/pkg/fixtures/{RequesterNS.go → RequesterNS_mock.go}
  100. +4 −0 mocks/github.com/vektra/mockery/v2/pkg/fixtures/{RequesterPtr.go → RequesterPtr_mock.go}
  101. +8 −0 ...hub.com/vektra/mockery/v2/pkg/fixtures/{RequesterReturnElided.go → RequesterReturnElided_mock.go}
  102. +4 −0 mocks/github.com/vektra/mockery/v2/pkg/fixtures/{RequesterSlice.go → RequesterSlice_mock.go}
  103. +16 −0 .../mockery/v2/pkg/fixtures/{RequesterVariadicOneArgument.go → RequesterVariadicOneArgument_mock.go}
  104. +16 −0 mocks/github.com/vektra/mockery/v2/pkg/fixtures/{RequesterVariadic.go → RequesterVariadic_mock.go}
  105. +4 −0 mocks/github.com/vektra/mockery/v2/pkg/fixtures/{Requester.go → Requester_mock.go}
  106. +4 −0 mocks/github.com/vektra/mockery/v2/pkg/fixtures/{SendFunc.go → SendFunc_mock.go}
  107. +2 −2 mocks/github.com/vektra/mockery/v2/pkg/fixtures/{Sibling.go → Sibling_mock.go}
  108. +4 −0 mocks/github.com/vektra/mockery/v2/pkg/fixtures/{StructWithTag.go → StructWithTag_mock.go}
  109. +1 −1 mocks/github.com/vektra/mockery/v2/pkg/fixtures/{UnsafeInterface.go → UnsafeInterface_mock.go}
  110. +79 −0 mocks/github.com/vektra/mockery/v2/pkg/fixtures/UsesAny_mock.go
  111. +1 −1 mocks/github.com/vektra/mockery/v2/pkg/fixtures/{UsesOtherPkgIface.go → UsesOtherPkgIface_mock.go}
  112. +78 −0 mocks/github.com/vektra/mockery/v2/pkg/fixtures/VariadicNoReturnInterface_mock.go
  113. +80 −0 mocks/github.com/vektra/mockery/v2/pkg/fixtures/VariadicReturnFunc_mock.go
  114. +82 −0 mocks/github.com/vektra/mockery/v2/pkg/fixtures/Variadic_mock.go
  115. +123 −0 ...thub.com/vektra/mockery/v2/pkg/fixtures/buildtag/comment/IfaceWithCustomBuildTagInComment_mock.go
  116. +64 −0 mocks/github.com/vektra/mockery/v2/pkg/fixtures/requesterUnexported_mock.go
  117. +0 −64 mocks/github.com/vektra/mockery/v2/pkg/fixtures/requester_unexported.go
  118. +7 −1 overrides/main.html
  119. +357 −182 pkg/config/config.go
  120. +390 −60 pkg/config/config_test.go
  121. +3 −0 pkg/fixtures/12345678/http/http.go
  122. +5 −0 pkg/fixtures/any_keyword.go
  123. +8 −0 pkg/fixtures/auto_generated/auto_generated.go
  124. +1 −0 pkg/fixtures/buildtag/comment/custom2_iface.go
  125. +4 −0 pkg/fixtures/constraints/constraints.go
  126. +6 −0 pkg/fixtures/empty_return/interface.go
  127. +38 −0 pkg/fixtures/empty_return/interface_test.go
  128. +98 −0 pkg/fixtures/empty_return/mock_EmptyReturn_test.go
  129. +125 −0 pkg/fixtures/example_project/mock_root_test.go
  130. +14 −6 pkg/fixtures/example_project/{mock_Stringer_test.go → mock_stringer_test.go}
  131. +3 −0 pkg/fixtures/example_project/pkg_with_submodules/go.mod
  132. +5 −0 pkg/fixtures/example_project/pkg_with_submodules/string.go
  133. +3 −0 pkg/fixtures/example_project/pkg_with_submodules/submodule/go.mod
  134. +5 −0 pkg/fixtures/example_project/pkg_with_submodules/submodule/string.go
  135. +5 −0 pkg/fixtures/example_project/pkg_with_submodules/subpkg/string.go
  136. +3 −0 pkg/fixtures/example_project/pkg_with_submodules/subpkg/submodule/go.mod
  137. +5 −0 pkg/fixtures/example_project/pkg_with_submodules/subpkg/submodule/string.go
  138. +9 −0 pkg/fixtures/example_project/replace_type/README.md
  139. +11 −0 pkg/fixtures/example_project/replace_type/rt.go
  140. +9 −0 pkg/fixtures/example_project/replace_type/rti/internal/rti.go
  141. +5 −0 pkg/fixtures/example_project/replace_type/rti/rt1/rt1.go
  142. +5 −0 pkg/fixtures/example_project/replace_type/rti/rt2/rt2.go
  143. +3 −2 pkg/fixtures/example_project/string_test.go
  144. +4 −0 pkg/fixtures/expecter.go
  145. +14 −0 pkg/fixtures/generic.go
  146. +40 −0 pkg/fixtures/iface_new_type/iface_new_type_test.go
  147. +13 −0 pkg/fixtures/iface_new_type/interface.go
  148. +64 −0 pkg/fixtures/iface_new_type/mock_interface_1_test.go
  149. +64 −0 pkg/fixtures/iface_new_type/mock_interface_2_test.go
  150. +64 −0 pkg/fixtures/iface_new_type/mock_interface_3_test.go
  151. +64 −0 pkg/fixtures/iface_new_type/mock_interface_4_test.go
  152. +5 −0 pkg/fixtures/iface_new_type/subpkg/interface.go
  153. +7 −0 pkg/fixtures/iface_typed_param/getter_iface_typed_param.go
  154. +29 −0 pkg/fixtures/iface_typed_param/main_test.go
  155. +83 −0 pkg/fixtures/iface_typed_param/mock_getter_iface_typed_param_test.go
  156. +7 −0 pkg/fixtures/index_list_expr/index_list_expression.go
  157. +35 −0 pkg/fixtures/index_list_expr/index_list_expression_test.go
  158. +81 −0 pkg/fixtures/index_list_expr/mock_generic_multiple_types_test.go
  159. +79 −0 pkg/fixtures/index_list_expr/mock_index_list_expr_test.go
  160. +7 −0 pkg/fixtures/instantiated_generic_interface.go
  161. +5 −0 pkg/fixtures/issue845/interface.go
  162. +40 −0 pkg/fixtures/issue845/interface_test.go
  163. +77 −0 pkg/fixtures/issue845/mock_WithFix_test.go
  164. +77 −0 pkg/fixtures/issue845/mock_WithoutFix_test.go
  165. +7 −0 pkg/fixtures/issue_766.go
  166. +18 −0 pkg/fixtures/method_args/same_name_arg_and_type/entity.go
  167. +69 −0 pkg/fixtures/method_args/same_name_arg_and_type/entity_test.go
  168. +176 −0 pkg/fixtures/method_args/same_name_arg_and_type/mock_interfaceA_test.go
  169. +80 −0 pkg/fixtures/method_args/same_name_arg_and_type/mock_interfaceB0_test.go
  170. +77 −0 pkg/fixtures/method_args/same_name_arg_and_type/mock_interfaceB_test.go
  171. +5 −0 pkg/fixtures/panic_err.go
  172. +29 −0 pkg/fixtures/panic_err_test.go
  173. +5 −1 pkg/fixtures/recursive_generation/Foo_mock.go
  174. +5 −1 pkg/fixtures/recursive_generation/subpkg1/Foo_mock.go
  175. +5 −1 pkg/fixtures/recursive_generation/subpkg2/Foo_mock.go
  176. +77 −0 pkg/fixtures/recursive_generation/subpkg_with_only_autogenerated_files/Foo_mock.go
  177. +6 −0 pkg/fixtures/recursive_generation/subpkg_with_only_autogenerated_files/foo.go
  178. +1 −1 pkg/fixtures/requester_unexported.go
  179. +2 −0 pkg/fixtures/same_name_imports.go
  180. +2 −3 pkg/fixtures/test/expecter_test.go
  181. +30 −0 pkg/fixtures/test/generic_test.go
  182. +35 −0 pkg/fixtures/test/issue_766_test.go
  183. +18 −0 pkg/fixtures/test/variadic_return_func_test.go
  184. +16 −0 pkg/fixtures/type_alias/interface.go
  185. +44 −0 pkg/fixtures/type_alias/interface_test.go
  186. +70 −0 pkg/fixtures/type_alias/mock_Interface2WithResolvedAlias_test.go
  187. +71 −0 pkg/fixtures/type_alias/mock_Interface2WithUnresolvedAlias_test.go
  188. +77 −0 pkg/fixtures/type_alias/mock_InterfaceWithResolvedAlias_test.go
  189. +80 −0 pkg/fixtures/type_alias/mock_InterfaceWithUnresolvedAlias_test.go
  190. +5 −0 pkg/fixtures/type_alias/subpkg/interface.go
  191. +7 −0 pkg/fixtures/variadic.go
  192. +5 −0 pkg/fixtures/variadic_return_func.go
  193. +221 −50 pkg/generator.go
  194. +151 −11 pkg/generator_test.go
  195. +86 −6 pkg/logging/logging.go
  196. +62 −0 pkg/logging/logging_test.go
  197. +41 −28 pkg/outputter.go
  198. +54 −6 pkg/outputter_test.go
  199. +151 −39 pkg/parse.go
  200. +57 −7 pkg/parse_test.go
  201. +6 −2 pkg/walker.go
  202. +4 −3 pkg/walker_test.go
  203. +71 −0 tools/cmd/root.go
  204. +213 −0 tools/cmd/tag.go
  205. +152 −105 tools/go.mod
  206. +373 −270 tools/go.sum
  207. +13 −0 tools/main.go
  208. +2 −1 tools/tools.go
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PLEASE READ
-------------

DO NOT submit tickets without _first_ using the latest version of Golang, clearing your local golang package cache, and re-building mockery using the _latest_ Golang version and the _latest_ version of mockery. Please provide evidence this has been done in your issue. Failure to provide this evidence will likely result in your issue being closed.
DO NOT submit tickets without _first_ using the latest version of Go, clearing your local golang package cache, and re-building mockery using the _latest_ Go version and the _latest_ version of mockery. Please provide evidence this has been done in your issue. Failure to provide this evidence will likely result in your issue being closed.

Description
-------------
@@ -13,7 +13,7 @@ Mockery Version

[version of mockery being used]

Golang Version
Go Version
--------------

[version of golang being used]
15 changes: 3 additions & 12 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -12,19 +12,11 @@ Please include a summary of the changes and the related issue. Please also inclu
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] This change requires a documentation update

Version of Golang used when building/testing:
Version of Go used when building/testing:
---------------------------------------------

- [ ] 1.11
- [ ] 1.12
- [ ] 1.13
- [ ] 1.14
- [ ] 1.15
- [ ] 1.16
- [ ] 1.17
- [ ] 1.18
- [ ] 1.19
- [ ] 1.20
- [ ] 1.22
- [ ] 1.23

How Has This Been Tested?
---------------------------
@@ -41,4 +33,3 @@ Checklist
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes

14 changes: 11 additions & 3 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
name: documentation
on:
push:
tags:
- 'v*.*.*'
branches: [ master, v3 ]
permissions:
contents: write
jobs:
@@ -19,5 +18,14 @@ jobs:
path: .cache
- run: sudo apt-get install -y libcairo2-dev libfreetype6-dev libffi-dev libjpeg-dev libpng-dev libz-dev
- run: pip install -r docs/requirements.txt
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
- name: Setup doc deploy
run: |
git config --global user.name vektra-bot
git config --global user.email vektra-bot@vektra.github.io
git fetch origin gh-pages --depth=1
- name: Deploy docs
run: "mike deploy --push --update-aliases ${{ github.ref_name }} latest"
run: "mike deploy --push --update-aliases $(grep VERSION mockery-tools.env | cut -d'=' -f 2 | cut -d'.' -f1-2) latest latest-v2"
env:
GOOGLE_ANALYTICS_KEY: ${{ secrets.GOOGLE_ANALYTICS_KEY }}
27 changes: 0 additions & 27 deletions .github/workflows/golangci-lint.yml

This file was deleted.

42 changes: 0 additions & 42 deletions .github/workflows/release.yml

This file was deleted.

33 changes: 33 additions & 0 deletions .github/workflows/reusable-testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Reusable Go Test

on:
workflow_call:
inputs:
ref:
required: false
type: string
default: ""

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ["macos-latest", "ubuntu-latest"]
go_vers: ["1.23", "1.24"]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
ref: ${{ inputs.ref }}

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go_vers }}

- name: Download dependencies
run: go mod download -x

- name: Test
run: go run github.com/go-task/task/v3/cmd/task test.ci
98 changes: 98 additions & 0 deletions .github/workflows/tag-and-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
name: Test and maybe create a new release

on:
push:
branches: [master, v3]
permissions:
contents: write
jobs:
test:
uses: ./.github/workflows/reusable-testing.yml
tag:
runs-on: ubuntu-latest
needs: test
outputs:
tag_result: ${{ steps.tag.outputs.tag_result }}
requested_version: ${{ steps.tag.outputs.requested_version }}
previous_version: ${{ steps.tag.outputs.previous_version }}
steps:
- run: sudo apt update && sudo apt install -y git && git --version
- uses: actions/checkout@v2
with:
# We need entire history of tags
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: ./tools/go.mod
check-latest: true
cache-dependency-path: "**/*.sum"

- name: Install Task
uses: arduino/setup-task@v2
with:
version: 3.x
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Run tagging commands
id: tag
run: |
set +e
task -x tag 1>/tmp/versions.txt
printf "versions: $(cat /tmp/versions.txt)\n"
echo "requested_version=$(cut -d',' -f 1 /tmp/versions.txt)" >> $GITHUB_OUTPUT
echo "previous_version=$(cut -d',' -f 2 /tmp/versions.txt)" >> $GITHUB_OUTPUT
tag_result="$?"
echo "tag_result=$tag_result" >> $GITHUB_OUTPUT
# The range between 8 and 63 inclusive is reserved for custom
# error codes that contain specific meaning.
if [ $tag_result -lt 8 -o $tag_result -gt 63 ]; then
exit $tag_result
fi
exit 0
- name: Push tags
run: task tag.push
if: steps.tag.outputs.tag_result == 0

release:
needs: tag
if: needs.tag.outputs.tag_result == 0
runs-on: ubuntu-latest
env:
DOCKER_CLI_EXPERIMENTAL: "enabled"

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.21'

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: GoReleaser
uses: goreleaser/goreleaser-action@v2.7.0
with:
args: release --clean
version: "<2"
env:
GITHUB_TOKEN: ${{ secrets.GORELEASER_GITHUB_TOKEN }}
HOMEBREW_TAP_TOKEN: ${{ secrets.GORELEASER_HOMEBREW_TAP_TOKEN }}
GORELEASER_CURRENT_TAG: ${{ needs.tag.outputs.requested_version }}
#GORELEASER_PREVIOUS_TAG: ${{ needs.tag.outputs.previous_version }}
15 changes: 15 additions & 0 deletions .github/workflows/testing-dispatch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Go Test (manual run)

on:
workflow_dispatch:
inputs:
ref:
description: "Tag/commit to checkout."
type: string
required: true

jobs:
test:
uses: ./.github/workflows/reusable-testing.yml
with:
ref: ${{ inputs.ref }}
34 changes: 3 additions & 31 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,9 @@
name: Go Test

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
branches: [ master, v3 ]

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ macos-latest, ubuntu-latest]
go_vers: ['1.20']
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go_vers }}

- name: Download dependencies
run: go mod download -x

- name: Test
run: go run github.com/go-task/task/v3/cmd/task test.ci

- name: Upload coverage to codecov
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.txt
verbose: true
test:
uses: ./.github/workflows/reusable-testing.yml
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -6,4 +6,6 @@ ve
.cache
coverage.txt
site/
.task/
.task/
tools/tools
*.lua
22 changes: 20 additions & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -6,23 +6,41 @@ linters:
# https://golangci-lint.run/usage/linters/#enabled-by-default
enable:
- errcheck
- gofumpt
- gosimple
- govet
- ineffassign
- staticcheck
- typecheck
- contextcheck
- durationcheck
- exportloopref
- copyloopvar
- gocheckcompilerdirectives
- gosec
- loggercheck
- nilerr
- prealloc
- predeclared
- reassign
- revive
- testifylint
linters-settings:
revive:
enable-all-rules: false
rules:
- name: 'var-naming'
staticcheck:
checks:
- all
- '-SA1024'
testifylint:
disable-all: true
enable:
- compares
- empty
- expected-actual
- len
issues:
exclude-rules:
- linters:
- revive
text: "var-naming: don't use an underscore in package name"
Loading