Skip to content

Commit

Permalink
add workflow for tests
Browse files Browse the repository at this point in the history
add coverage report to make test
  • Loading branch information
zt-9 committed Sep 5, 2024
1 parent e34a18c commit d2bbc7c
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
36 changes: 36 additions & 0 deletions .github/workflows/pr_main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: pr_main
on:
push:
branches:
- main
paths-ignore:
- 'README.md'
pull_request:
branches:
- main
paths-ignore:
- 'README.md'

permissions:
contents: read
# Optional: allow read access to pull request. Use with `only-new-issues` option.
pull-requests: read
# Optional: allow write access to checks to allow the action to annotate code in the PR.
checks: write

jobs:
test:
runs-on: ubuntu-latest
name: test
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.22.4'

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Create Docker network for running Testcontianers
run: docker network create testcontainer-network
- name: Run go tests
run: make test
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ clean:
# run all tests
.PHONY: test
test:
go test -v ./...
go test ./... -cover

.PHONY: fmt
fmt:
Expand Down

0 comments on commit d2bbc7c

Please sign in to comment.