fix: maven,版本号要是读不出来,就算了,累了,能用就得了 #976
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
name: Test | |
on: | |
push: | |
tags: | |
- v* | |
branches: | |
- master | |
- v* | |
- dev* | |
- ci* | |
- feat* | |
- fix* | |
- refactor* | |
paths: | |
- "**/*.go" | |
- "go.mod" | |
- "go.sum" | |
- ".github/workflows/*.yml" | |
pull_request: | |
paths: | |
- "**/*.go" | |
- "go.mod" | |
- "go.sum" | |
- ".github/workflows/*.yml" | |
types: | |
- opened | |
- reopened | |
- synchronize | |
env: | |
DEFAULT_MAVEN_REPO: https://repo1.maven.org/maven2/ | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
env: | |
CGO_ENABLED: '0' | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: 1.21.5 | |
cache: true | |
- uses: denoland/setup-deno@v1 | |
with: | |
deno-version: v1.x | |
- name: Download dependencies | |
run: go mod download | |
- name: Install Go tools | |
run: | | |
cd /tmp | |
go install golang.org/x/tools/cmd/[email protected] | |
- name: Go mod tidy | |
run: go mod tidy | |
- name: Regenerate code | |
run: go generate -v ./... | |
- name: Reformat code | |
run: go fmt ./... | |
- name: Check difference | |
run: git diff --color --exit-code . | |
- name: Go vet | |
run: go vet ./... | |
- name: Install gotestfmt | |
run: go install github.com/gotesttools/gotestfmt/v2/cmd/gotestfmt@latest | |
- name: Run tests | |
run: | | |
set -euo pipefail | |
go generate ./... | |
go test -json -v ./... 2>&1 | tee /tmp/gotest.log | gotestfmt |