Skip to content

Commit

Permalink
fix(CI): Enable check (#186)
Browse files Browse the repository at this point in the history
* fix: Enable check

Signed-off-by: Ce Gao <cegao@tensorchord.ai>

* fix: Fix

Signed-off-by: Ce Gao <cegao@tensorchord.ai>

* fix: Update license

Signed-off-by: Ce Gao <cegao@tensorchord.ai>

* fix: Add license

Signed-off-by: Ce Gao <cegao@tensorchord.ai>

* fix: Update

Signed-off-by: Ce Gao <cegao@tensorchord.ai>
  • Loading branch information
gaocegege committed May 23, 2022
1 parent 4ce2890 commit 0964149
Show file tree
Hide file tree
Showing 12 changed files with 153 additions and 6 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,19 @@ jobs:
${{ runner.OS }}-
- name: Check Go modules
run: |
-compat=1.17 && git add go.*
go mod tidy -compat=1.17 && git add go.* &&
git diff --cached --exit-code || (echo 'Please run "go mod tidy" to sync Go modules' && exit 1);
- name: Verify gofmt
run: |
make fmt && git add pkg cmd
make fmt && git add pkg cmd &&
git diff --cached --exit-code || (echo 'Please run "make fmt" to verify gofmt' && exit 1);
- name: Verify govet
run: |
make vet && git add pkg cmd
make vet && git add pkg cmd &&
git diff --cached --exit-code || (echo 'Please run "make vet" to verify govet' && exit 1);
- name: Add license
run: |
make addlicense && git add pkg cmd &&
git diff --cached --exit-code || (echo 'Please run "make vet" to verify govet' && exit 1);
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
Expand Down Expand Up @@ -70,7 +74,7 @@ jobs:
uses: docker/setup-buildx-action@v2
- name: Verify mockgen
run: |
make generate && git add pkg
make generate && git add pkg &&
git diff --cached --exit-code || (echo 'Please run "make generate" to verify generate' && exit 1);
- name: Test
run: make test
Expand Down
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export GOFLAGS ?= -count=1
#

# All targets.
.PHONY: lint test build container push addlicense debug debug-local build-local generate clean test-local
.PHONY: lint test build container push addlicense debug debug-local build-local generate clean test-local addlicense-install mockgen-install

build: build-local

Expand All @@ -107,6 +107,9 @@ $(GOLANGCI_LINT):
mockgen-install:
go install github.com/golang/mock/mockgen@v1.6.0

addlicense-install:
go install github.com/google/addlicense@latest

build-local:
@for target in $(TARGETS); do \
CGO_ENABLED=$(CGO_ENABLED) go build -trimpath -v -o $(OUTPUT_DIR)/$${target} \
Expand All @@ -128,7 +131,7 @@ debug-local:
$(CMD_DIR)/$${target}; \
done

addlicense:
addlicense: addlicense-install
addlicense -c "The envd Authors" **/*.go **/**/*.go **/**/**/*.go

test-local:
Expand Down
14 changes: 14 additions & 0 deletions pkg/editor/jupyter/util_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright 2022 The envd Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package jupyter

import (
Expand Down
14 changes: 14 additions & 0 deletions pkg/editor/vscode/util.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright 2022 The envd Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package vscode

import (
Expand Down
14 changes: 14 additions & 0 deletions pkg/home/manager_suite_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright 2022 The envd Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package home

import (
Expand Down
14 changes: 14 additions & 0 deletions pkg/home/manager_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright 2022 The envd Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package home

import (
Expand Down
14 changes: 14 additions & 0 deletions pkg/lang/ir/editor.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright 2022 The envd Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package ir

import (
Expand Down
14 changes: 14 additions & 0 deletions pkg/lang/ir/python.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright 2022 The envd Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package ir

import (
Expand Down
14 changes: 14 additions & 0 deletions pkg/lang/ir/shell.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright 2022 The envd Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package ir

import (
Expand Down
14 changes: 14 additions & 0 deletions pkg/lang/ir/system.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright 2022 The envd Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package ir

import (
Expand Down
14 changes: 14 additions & 0 deletions pkg/shell/zsh_suite_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright 2022 The envd Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package shell

import (
Expand Down
14 changes: 14 additions & 0 deletions pkg/shell/zsh_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright 2022 The envd Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package shell

import (
Expand Down

0 comments on commit 0964149

Please sign in to comment.