Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #39 from jzelinskie/v1-examples
README: update examples to v1
- Loading branch information
Showing
21 changed files
with
136 additions
and
251 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,64 +1,69 @@ | ||
--- | ||
name: "build" | ||
on: | ||
push: | ||
branches: | ||
- "master" | ||
- "master" | ||
pull_request: | ||
branches: | ||
- "!dependabot/*" | ||
- "*" | ||
- "!dependabot/*" | ||
- "*" | ||
jobs: | ||
lint: | ||
lint: | ||
name: "Lint" | ||
runs-on: "ubuntu-latest" | ||
steps: | ||
- uses: "actions/setup-go@v2" | ||
with: | ||
go-version: ^1.16 | ||
- name: "Install linting tools" | ||
run: | | ||
- uses: "actions/setup-go@v2" | ||
with: | ||
go-version: "^1.16" | ||
- name: "Install linting tools" | ||
# This is done before checking out, as to not modify go.mod | ||
go install mvdan.cc/gofumpt/gofumports@latest | ||
go install github.com/mgechev/revive@latest | ||
go install golang.org/x/tools/cmd/stringer@latest | ||
- uses: "actions/checkout@v2" | ||
- name: "Go Mod Tidy" | ||
run: "go mod tidy && bash -c '[ $(git status --porcelain | tee /dev/fd/2 | wc -c) -eq 0 ]'" | ||
- name: "Formatting (gofumpt)" | ||
run: | | ||
GOFUMPT_OUTPUT="$(find . -iname '*.go' -type f | grep -v pb.go | grep -v 'pb.*.go' | xargs gofumports -d)" | ||
if [ -n "$GOFUMPT_OUTPUT" ]; then | ||
echo "All the following files are not correctly formatted" | ||
echo "${GOFUMPT_OUTPUT}" | ||
exit 1 | ||
fi | ||
- name: "Linting (revive)" | ||
run: "bash -c '[ $(find . -iname '*.go' -type f | grep -v 'pb.*.go' | xargs revive | tee /dev/fd/2 | wc -c) -eq 0 ]'" | ||
run: "go install mvdan.cc/gofumpt/gofumports@v0.1.1" | ||
- uses: "actions/checkout@v2" | ||
- uses: "bewuethr/yamllint-action@v1.1.1" | ||
with: | ||
config-file: ".yamllint" | ||
- name: "Go Mod Tidy" | ||
run: "go mod tidy && bash -c '[ $(git status --porcelain | tee /dev/fd/2 | wc -c) -eq 0 ]'" | ||
- name: "Formatting (gofumpt)" | ||
run: | | ||
GOFUMPT_OUTPUT="$(find . -iname '*.go' -type f | grep -v pb.go | grep -v 'pb.*.go' | xargs gofumports -d)" | ||
if [ -n "$GOFUMPT_OUTPUT" ]; then | ||
echo "All the following files are not correctly formatted" | ||
echo "${GOFUMPT_OUTPUT}" | ||
exit 1 | ||
fi | ||
- uses: "golangci/golangci-lint-action@v2" | ||
with: | ||
version: "v1.43" | ||
skip-go-installation: true | ||
skip-pkg-cache: true | ||
skip-build-cache: false | ||
|
||
test: | ||
name: "Test" | ||
runs-on: "ubuntu-latest" | ||
steps: | ||
- uses: "actions/checkout@v2" | ||
- uses: "actions/setup-go@v2" | ||
with: | ||
go-version: "^1.16" | ||
- uses: "authzed/action-testserver@v3" | ||
- name: "go test" | ||
run: "go test -tags integration ./..." | ||
- uses: "actions/checkout@v2" | ||
- uses: "actions/setup-go@v2" | ||
with: | ||
go-version: "^1.16" | ||
- uses: "authzed/action-testserver@v3" | ||
- name: "go test" | ||
run: "go test -tags integration ./..." | ||
|
||
protobuf: | ||
name: "Generate Protobufs" | ||
runs-on: "ubuntu-latest" | ||
steps: | ||
- uses: "actions/setup-go@v2" | ||
with: | ||
go-version: "^1.16" | ||
- name: "Install local Go Protobuf plugins" | ||
run: "go install github.com/envoyproxy/protoc-gen-validate@v0.6.1" | ||
- uses: "actions/checkout@v2" | ||
- uses: "bufbuild/buf-setup-action@v0.6.0" | ||
with: | ||
version: "1.0.0-rc6" | ||
- name: "Generate & Diff Protos" | ||
run: "./buf.gen.yaml && git diff && bash -c '[ $(git status --porcelain | tee /dev/fd/2 | wc -c) -eq 0 ]'" | ||
- uses: "actions/setup-go@v2" | ||
with: | ||
go-version: "^1.16" | ||
- name: "Install local Go Protobuf plugins" | ||
run: "go install github.com/envoyproxy/protoc-gen-validate@v0.6.1" | ||
- uses: "actions/checkout@v2" | ||
- uses: "bufbuild/buf-setup-action@v0.6.0" | ||
with: | ||
version: "1.0.0-rc8" | ||
- name: "Generate & Diff Protos" | ||
run: "./buf.gen.yaml && git diff && bash -c '[ $(git status --porcelain | tee /dev/fd/2 | wc -c) -eq 0 ]'" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- | ||
run: | ||
timeout: "5m" | ||
skip-dirs: | ||
- "proto" | ||
output: | ||
sort-results: true | ||
linters-settings: | ||
goimports: | ||
local-prefixes: "github.com/authzed/authzed-go" | ||
linters: | ||
enable: | ||
- "deadcode" | ||
- "errcheck" | ||
- "gofumpt" | ||
- "goimports" | ||
- "gosimple" | ||
- "govet" | ||
- "ineffassign" | ||
- "revive" | ||
- "rowserrcheck" | ||
- "staticcheck" | ||
- "structcheck" | ||
- "typecheck" | ||
- "unused" | ||
- "varcheck" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# vim: ft=yaml | ||
--- | ||
yaml-files: | ||
- "*.yaml" | ||
- "*.yml" | ||
- ".yamllint" | ||
extends: "default" | ||
rules: | ||
quoted-strings: "enable" | ||
line-length: "disable" |
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
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
Oops, something went wrong.