chore: add gormlint and useany testdata directories to dependency dow… #19
This file contains hidden or 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
# This workflow will build and test the project | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go | |
name: Go | |
on: | |
workflow_dispatch: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
permissions: | |
contents: read | |
jobs: | |
build-then-test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version-file: "go.mod" | |
cache: true | |
- name: Build | |
run: go build -v ./... | |
- name: Download test dependencies | |
run: | | |
for dir in errhandle/testdata mustreceive/testdata gormlint/testdata useany/testdata; do | |
if [[ -f "$dir/go.mod" ]]; then | |
echo "Downloading dependencies for $dir" | |
cd "$dir" && go mod download && cd - | |
fi | |
done | |
- name: Test | |
run: go test -p=1 -count=1 -failfast -coverprofile=coverage.txt -coverpkg=github.com/qor5/... ./... |