🥽 add hook of PreMethodExecuteHook #11
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: Go Test | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
check: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: 1.18 | |
- name: gofmt | |
run: find . -name "*.go" | xargs gofmt -s -l -e | |
- name: govet | |
run: go list ./... | xargs go vet -composites=false | |
build: | |
runs-on: ubuntu-latest | |
needs: check | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: 1.18 | |
- name: Run tests | |
env: | |
SKIP_TESTS: 1 | |
run: go test ./... | |
- name: Handle test failures | |
if: failure() | |
run: | | |
echo "Tests failed. Please check the test results." | |
exit 1 |