Skip to content

Commit

Permalink
CI: Add MacOS unit test workflow
Browse files Browse the repository at this point in the history
Signed-off-by: Mayank Shah <[email protected]>
  • Loading branch information
mayankshah1607 committed Oct 5, 2020
1 parent eef5de2 commit 2ce1888
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 11 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/darwin.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
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 azuredisk-darwin
- name: Run unit tests on MacOS
run: go test -v -race ./pkg/...
11 changes: 4 additions & 7 deletions .github/workflows/build-test.yml → .github/workflows/linux.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
name: Go

name: Linux Build & Unit Tests
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:

build:
name: Build
runs-on: ubuntu-latest
Expand All @@ -22,9 +19,9 @@ jobs:
- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: Test
run: sudo go test -covermode=count -coverprofile=profile.cov ./pkg/...

- name: Build Test
run: |
make azuredisk
- name: Send coverage
env:
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
name: Go

name: Windows Build & Unit Tests
on:
push:
branches: [ master ]
Expand All @@ -20,9 +19,9 @@ jobs:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v2
- name: Build
- name: Build Test
run: |
go build -a -o _output/azurediskplugin.exe ./pkg/azurediskplugin
make azuredisk-windows
- name: Run Windows Unit Tests
run: |
# start the CSI Proxy before running tests on windows
Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ azuredisk:
azuredisk-windows:
CGO_ENABLED=0 GOOS=windows go build -a -ldflags ${LDFLAGS} -o _output/azurediskplugin.exe ./pkg/azurediskplugin

.PHONY: azuredisk-darwin
azuredisk-darwin:
CGO_ENABLED=0 GOOS=darwin go build -a -ldflags ${LDFLAGS} -o _output/azurediskplugin ./pkg/azurediskplugin

.PHONY: container
container: azuredisk
docker build --no-cache -t $(IMAGE_TAG) -f ./pkg/azurediskplugin/dev.Dockerfile .
Expand Down

0 comments on commit 2ce1888

Please sign in to comment.