Skip to content
This repository is currently being migrated. It's locked while the migration is in progress.

Commit

Permalink
Setup github actions for linting and go tests
Browse files Browse the repository at this point in the history
  • Loading branch information
darkowlzz committed Jan 5, 2021
1 parent 7d2a507 commit d0131ef
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 2 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Lint and test

on: [push, pull_request]

jobs:
lint:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: golangci-lint
uses: golangci/golangci-lint-action@v2.3.0
with:
args: --timeout=5m

go-test:
name: go tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: '1.15.5'
- name: go-test
run: make test
10 changes: 10 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
linters:
enable:
- gofmt
- goimports
- unconvert
- gocyclo
- nakedret
- scopelint
- whitespace
- nolintlint
3 changes: 1 addition & 2 deletions controllers/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"k8s.io/client-go/kubernetes/scheme"
"k8s.io/client-go/rest"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/envtest"
"sigs.k8s.io/controller-runtime/pkg/envtest/printer"
Expand All @@ -21,7 +20,7 @@ import (
// These tests use Ginkgo (BDD-style Go testing framework). Refer to
// http://onsi.github.io/ginkgo/ to learn more about Ginkgo.

var cfg *rest.Config
// var cfg *rest.Config
var k8sClient client.Client
var testEnv *envtest.Environment

Expand Down

0 comments on commit d0131ef

Please sign in to comment.