generated from kyma-project/template-repository
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add a reusable unit test github action workflow (#54)
- Loading branch information
1 parent
34bc2dc
commit ee85ea0
Showing
1 changed file
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# This workflow defines a reusable Go unit test flow, that relies on the existence of the make target "test". | ||
|
||
name: Unit Test (reusable) | ||
|
||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
unit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version-file: "go.mod" # This uses the Go version defined in the mod file, in contrast to setting a defined version. | ||
|
||
- name: Sync Go dependencies | ||
run: | | ||
go mod vendor | ||
- name: Run tests | ||
run: | | ||
make test |