Skip to content

Commit

Permalink
Setup CI in GitHub Action
Browse files Browse the repository at this point in the history
  • Loading branch information
iawia002 committed May 9, 2024
1 parent cfa5ca9 commit 47e84da
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 6 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
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
- 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: |
export PATH="$PATH:$(go env GOPATH)/bin"
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

0 comments on commit 47e84da

Please sign in to comment.