-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add GitHub Actions Workflows + Renovate configuration
- Loading branch information
1 parent
e5248ae
commit d0930ac
Showing
6 changed files
with
112 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: Build project | ||
on: [ push, pull_request ] | ||
jobs: | ||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out source code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version-file: 'go.mod' | ||
|
||
- name: Test | ||
run: make test |
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,20 @@ | ||
name: Ensure generated files are up-to-date | ||
on: [ push, pull_request ] | ||
jobs: | ||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out source code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version-file: 'go.mod' | ||
|
||
- name: Run `make generate` | ||
run: make generate | ||
|
||
- name: Check for no untracked files | ||
run: git status && git diff-index --quiet HEAD -- |
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,17 @@ | ||
name: Lint project | ||
on: [push, pull_request] | ||
jobs: | ||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out source code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version-file: 'go.mod' | ||
|
||
- name: Run `make lint-ci` | ||
run: make lint-ci |
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,20 @@ | ||
name: Ensure `go mod tidy` has been run | ||
on: [ push, pull_request ] | ||
jobs: | ||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out source code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version-file: 'go.mod' | ||
|
||
- name: Install `tidied` | ||
run: go install gitlab.com/jamietanna/tidied@latest | ||
|
||
- name: Check for no untracked files | ||
run: tidied -verbose |
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,32 @@ | ||
GOBASE=$(shell pwd) | ||
GOBIN=$(GOBASE)/bin | ||
|
||
help: | ||
@echo "This is a helper makefile for oapi-codegen" | ||
@echo "Targets:" | ||
@echo " generate: regenerate all generated files" | ||
@echo " test: run all tests" | ||
@echo " gin_example generate gin example server code" | ||
@echo " tidy tidy go mod" | ||
|
||
$(GOBIN)/golangci-lint: | ||
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOBIN) v1.54.0 | ||
|
||
.PHONY: tools | ||
tools: $(GOBIN)/golangci-lint | ||
|
||
lint: tools | ||
$(GOBIN)/golangci-lint run ./... | ||
|
||
lint-ci: tools | ||
$(GOBIN)/golangci-lint run ./... --out-format=github-actions --timeout=5m | ||
|
||
generate: | ||
go generate ./... | ||
|
||
test: | ||
go test -cover ./... | ||
|
||
tidy: | ||
@echo "tidy..." | ||
go mod tidy |
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,6 @@ | ||
{ | ||
"$schema": "https://docs.renovatebot.com/renovate-schema.json", | ||
"extends": [ | ||
"local>oapi-codegen/renovate-config" | ||
] | ||
} |