-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
46 additions
and
41 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 |
---|---|---|
|
@@ -24,64 +24,69 @@ jobs: | |
with: | ||
go_version_file: backend/go.mod | ||
workdir: backend | ||
fail_on_error: true | ||
fail_level: error | ||
Check failure on line 27 in .github/workflows/backend-ci.yml GitHub Actions / actionlint[actionlint] .github/workflows/backend-ci.yml#L27
Raw output
|
||
filter_mode: nofilter | ||
golangci_lint_flags: --timeout=10m | ||
format: | ||
name: Format | ||
generate: | ||
name: Generate | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Generate a token | ||
id: token | ||
uses: actions/create-github-app-token@v1 | ||
with: | ||
app-id: ${{ secrets.PUSHER_APP_ID }} | ||
private-key: ${{ secrets.PUSHER_PRIVATE_KEY }} | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
token: ${{ steps.token.outputs.token }} | ||
- name: Setup Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version-file: backend/go.mod | ||
cache-dependency-path: backend/go.sum | ||
- name: Mod Tidy | ||
run: go mod tidy | ||
- name: Install Format Tools | ||
run: | | ||
go install golang.org/x/tools/cmd/[email protected] | ||
go install mvdan.cc/[email protected] | ||
- name: Run Format Tools | ||
run: | | ||
find . -type f -name '*.go' -not -path "*/internal/proto/*" | while IFS='' read -r file; do goimports -l -w "$file"; done | ||
gofumpt -l -w . | ||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Setup Go | ||
uses: actions/setup-go@v5 | ||
go-version: 1.23 | ||
cache: false | ||
- uses: actions/cache/restore@v4 | ||
id: go-cache | ||
with: | ||
path: | | ||
~/.cache/go-build | ||
~/go/pkg/mod | ||
key: go-${{ hashFiles('backend/go.sum') }} | ||
restore-keys: | | ||
go- | ||
- name: Go Generate | ||
run: go generate -x ./... | ||
- name: Check Diff | ||
run: git diff --exit-code | ||
- uses: actions/cache/save@v4 | ||
if: steps.go-cache.outputs.cache-hit != 'true' && github.ref == 'refs/heads/main' | ||
with: | ||
go-version-file: backend/go.mod | ||
cache-dependency-path: backend/go.sum | ||
- name: Mod Download | ||
run: go mod download | ||
- name: Build | ||
run: CGO_ENABLED=0 go build -ldflags "-s -w" -trimpath . | ||
path: | | ||
~/.cache/go-build | ||
~/go/pkg/mod | ||
key: ${{ steps.go-cache.outputs.cache-primary-key }} | ||
test: | ||
name: Test | ||
runs-on: ubuntu-latest | ||
needs: build | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Setup Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version-file: backend/go.mod | ||
cache-dependency-path: backend/go.sum | ||
go-version: 1.23 | ||
cache: false | ||
- uses: actions/cache/restore@v4 | ||
id: go-cache | ||
with: | ||
path: | | ||
~/.cache/go-build | ||
~/go/pkg/mod | ||
key: go-${{ hashFiles('backend/go.sum') }} | ||
restore-keys: | | ||
go- | ||
- name: Go Modules | ||
if: steps.go-cache.outputs.cache-hit != 'true' | ||
run: go mod download -x | ||
- name: Run Test | ||
run: go test ./... -v | ||
run: go test -race -shuffle on -parallel 8 -v ./... | ||
- uses: actions/cache/save@v4 | ||
if: steps.go-cache.outputs.cache-hit != 'true' && github.ref == 'refs/heads/main' | ||
with: | ||
path: | | ||
~/.cache/go-build | ||
~/go/pkg/mod | ||
key: ${{ steps.go-cache.outputs.cache-primary-key }} |