Merge pull request #259 from nunnatsa/fix-258 #875
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
on: [push, pull_request] | |
name: build | |
jobs: | |
unit_test: | |
if: (github.repository == 'kubernetes-sigs/cluster-api-provider-kubevirt') | |
strategy: | |
matrix: | |
go-version: [1.18.x] | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Install Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: ${{ matrix.go-version }} | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Test | |
run: make test | |
- name: Build | |
run: make manager | |
coverage: | |
if: (github.repository == 'kubernetes-sigs/cluster-api-provider-kubevirt') | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: 1.18.x | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Test with coverage | |
env: | |
TEST_ARGS: -covermode atomic -outputdir=./coverprofiles -coverprofile=cover.coverprofile | |
run: |- | |
mkdir -p coverprofiles | |
make test | |
- name: Push to coveralls.io | |
env: | |
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: |- | |
GO111MODULE=off go get github.com/mattn/goveralls | |
$(go env GOPATH)/bin/goveralls -coverprofile=coverprofiles/cover.coverprofile -service=github | |
go-linter: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: golangci-lint | |
uses: golangci/golangci-lint-action@v3 | |
with: # TODO: remove this when the deprecated function will be removed (issue #85) | |
args: --exclude SA1019 --timeout=5m -E ginkgolinter | |
check-gen: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: 1.18.x | |
- uses: actions/checkout@v2 | |
- name: Check that 'make generate' has being call | |
run: make check-gen | |