Skip to content

Commit

Permalink
add a reusable unit test github action workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
friedrichwilken committed Jan 17, 2024
1 parent 34bc2dc commit 91a7491
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/unit-test-reusable.yml
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

0 comments on commit 91a7491

Please sign in to comment.