Skip to content
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
30 changes: 30 additions & 0 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,34 @@ env:
GO_VERSION: "1.23.0"

jobs:
go-fmt:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref || github.ref }}

- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}

- name: Format Go code
run: go fmt ./...

- name: Commit and push changes
uses: stefanzweifel/git-auto-commit-action@v7
with:
commit_message: "style: auto-format go code"

go-mod:
needs: go-fmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref || github.ref }}
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
Expand All @@ -23,9 +47,12 @@ jobs:
git diff --exit-code go.sum

golangci-lint:
needs: go-fmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref || github.ref }}
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
Expand All @@ -35,6 +62,7 @@ jobs:
version: latest

tests:
needs: go-fmt
strategy:
matrix:
os:
Expand All @@ -49,6 +77,8 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref || github.ref }}
- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.golang }}
Expand Down
18 changes: 12 additions & 6 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
{
"yaml.schemas": {
"assets/oapi-configuration-schema.json": "pkg/api/config.yaml"
},
"go.lintTool": "golangci-lint",
"go.lintFlags": [],
}
"yaml.schemas": {
"assets/oapi-configuration-schema.json": "pkg/api/config.yaml"
},
"go.lintTool": "golangci-lint",
"go.lintFlags": [],

"[go]": {
"editor.defaultFormatter": "golang.go",
"editor.formatOnSave": true
},
"go.formatTool": "gofmt"
}
Loading
Loading