Skip to content
Open
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
fetch-depth: 0

- name: golangci-lint
uses: golangci/golangci-lint-action@v2
uses: golangci/golangci-lint-action@v3
with:
version: latest

Expand All @@ -28,12 +28,14 @@ jobs:
fetch-depth: 0

- name: Install Go
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: "1.20"
go-version: "1.21"

- name: Test
run: go test ./...
uses: gomicro/forge-action@main
with:
step: test

deploy:
name: Deploy
Expand Down
18 changes: 16 additions & 2 deletions forge.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
project:
name: train
envs:
DOCKER_PASSWORD: $DOCKER_PASSWORD
DOCKER_USERNAME: $DOCKER_USERNAME
steps:
build:
help: Build the project
Expand All @@ -14,7 +17,18 @@ steps:
-o {{.Project}} .
clean:
help: Clean up all generated files
cmd: go clean
cmds:
- go clean
- rm -f coverage.txt
coverage:
help: generate coverage
cmd: docker run -v $PWD:/src gomicro/gocover
deploy:
help: deploy the artifacts
cmds:
- echo "Logging into Docker Hub"
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- "VERSION={{.ShortSha}} goreleaser release"
fmt:
help: Run gofmt
cmd: go fmt ./...
Expand All @@ -34,7 +48,7 @@ steps:
GOOS: '{{.Os}}'
cmd: >
go install -ldflags
"-X 'github.com/gomicro/train/cmd.Version=dev-$(git rev-parse --short HEAD)'
"-X 'github.com/gomicro/train/cmd.Version=dev-{{.ShortSha}}'
-X 'github.com/gomicro/train/cmd.clientID=$TRAIN_CLIENT_ID'
-X 'github.com/gomicro/train/cmd.clientSecret=$TRAIN_CLIENT_SECRET'"
test:
Expand Down