Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup CI in GitHub Action #2

Merged
merged 1 commit into from
May 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: CI
on:
push:
branches:
- 'main'
- 'release-**'
pull_request:
jobs:
ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.22"
- name: Lint
uses: golangci/golangci-lint-action@v6
with:
version: latest
- name: Install protoc
uses: arduino/setup-protoc@v3
with:
version: "26.1"
- name: Install protoc-gen-go
run: |
go install google.golang.org/protobuf/cmd/[email protected]
go install google.golang.org/grpc/cmd/[email protected]
- name: Verify codegen
run: |
make gen
if [ -n "$(git status --porcelain)" ]; then
echo $(git diff)
echo "codegen is out of date. Please run \"make gen\" to update."
exit 1
else
echo "codegen is up to date."
fi
23 changes: 23 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
run:
timeout: 5m
go: 1.22

linters:
enable:
- revive
- goconst
- gofmt
- goimports
- misspell
- unparam
disable:
- deadcode

issues:
exclude-use-default: false
exclude-rules:
- path: _test.go
linters:
- errcheck
exclude:
- (comment on exported (method|function|type|const)|should have( a package)? comment|comment should be of the form)
12 changes: 6 additions & 6 deletions wacker/wacker.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ type (
)

const (
PROGRAM_STATUS_RUNNING uint32 = 0
PROGRAM_STATUS_FINISHED uint32 = 1
PROGRAM_STATUS_ERROR uint32 = 2
PROGRAM_STATUS_STOPPED uint32 = 3
ProgramStatusRunning uint32 = 0
ProgramStatusFinished uint32 = 1
ProgramStatusError uint32 = 2
ProgramStatusStopped uint32 = 3

PROGRAM_TYPE_WASI uint32 = 0
PROGRAM_TYPE_HTTP uint32 = 1
ProgramTypeWASI uint32 = 0
ProgramTypeHTTP uint32 = 1
)

type Options struct {
Expand Down