From bff4f8801d290b680611cc8cdbe7322da5d6a501 Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Tue, 6 Oct 2020 17:28:39 +0530 Subject: [PATCH] CI: enable unit tests for macos Signed-off-by: Mayank Shah --- .github/workflows/darwin.yaml | 23 +++++++++++++++++++++++ .github/workflows/ubuntu.yml | 2 +- .github/workflows/windows.yaml | 4 ++-- Makefile | 4 ++++ 4 files changed, 30 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/darwin.yaml diff --git a/.github/workflows/darwin.yaml b/.github/workflows/darwin.yaml new file mode 100644 index 000000000..8b02addd4 --- /dev/null +++ b/.github/workflows/darwin.yaml @@ -0,0 +1,23 @@ +name: MacOS Build & Unit Test +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] +jobs: + build: + name: Build + runs-on: macos-latest + steps: + - name: Set up Go 1.x + uses: actions/setup-go@v2 + with: + go-version: ^1.13 + id: go + - name: Check out code into the Go module directory + uses: actions/checkout@v2 + - name: Build Test + run: | + make blob-darwin + - name: Run unit tests on MacOS + run: go test -v -race ./pkg/... diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 78cf2054a..961e15a10 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -1,4 +1,4 @@ -name: Linux tests +name: Linux Tests on: push: branches: [ master ] diff --git a/.github/workflows/windows.yaml b/.github/workflows/windows.yaml index 2aa903b5d..72b96f485 100644 --- a/.github/workflows/windows.yaml +++ b/.github/workflows/windows.yaml @@ -1,4 +1,4 @@ -name: Windows Test +name: Windows Tests on: push: branches: [ master ] @@ -20,4 +20,4 @@ jobs: uses: actions/checkout@v2 - name: Run Windows Unit Tests run: | - go test -v -race ./pkg/... \ No newline at end of file + go test -v -race ./pkg/... diff --git a/Makefile b/Makefile index f81ba64e9..3bce07ad1 100644 --- a/Makefile +++ b/Makefile @@ -85,6 +85,10 @@ blob: blob-windows: CGO_ENABLED=0 GOOS=windows go build -a -ldflags ${LDFLAGS} -o _output/blobplugin.exe ./pkg/blobplugin +.PHONT: blob-darwin +blob-darwin: + CGO_ENABLED=0 GOOS=darwin go build -a -ldflags ${LDFLAGS} -o _output/blobplugin ./pkg/blobplugin + .PHONY: container container: blob docker build --no-cache -t $(IMAGE_TAG) -f ./pkg/blobplugin/dev.Dockerfile .