Skip to content

Commit

Permalink
ci: add test workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
matty-rose committed Oct 9, 2021
1 parent 84b8d9c commit 139c57b
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Test GHA Docs
on:
pull_request:
branches:
- main
push:
branches:
- main
env:
GO_VERSION: 1.17
GOTESTSUM_VERSION: 1.7.0
TASK_VERSION: 3.9.0
jobs:
test:
name: test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]
with:
fetch-depth: "0"
- name: Setup go
uses: actions/[email protected]
with:
go-version: ${{ env.GO_VERSION }}
- name: Install Task
uses: arduino/setup-task@v1
with:
version: ${{ env.TASK_VERSION }}
- name: Setup gotestsum
uses: autero1/[email protected]
with:
gotestsum_version: ${{ env.GOTESTSUM_VERSION }}
- name: Run tests
run: |
task test
continue-on-error: true
- name: Publish Test Report
uses: mikepenz/action-junit-report@v2
if: github.event_name == 'pull_request'
with:
fail_on_failure: true
report_paths: junit.xml
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,6 @@ build/
# vendor/

dist/

# Test report
junit.xml
5 changes: 5 additions & 0 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ tasks:
cmds:
- go mod verify

test:
desc: Runs test suite.
cmds:
- gotestsum --format testname --junitfile junit.xml

run:
desc: Runs application.
cmds:
Expand Down

0 comments on commit 139c57b

Please sign in to comment.