diff --git a/.github/workflows/unit-test-reusable.yml b/.github/workflows/unit-test-reusable.yml new file mode 100644 index 0000000..79276f7 --- /dev/null +++ b/.github/workflows/unit-test-reusable.yml @@ -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