Skip to content
This repository has been archived by the owner on Sep 19, 2024. It is now read-only.

Commit

Permalink
Add go test with result publication action
Browse files Browse the repository at this point in the history
  • Loading branch information
creydr committed Nov 22, 2020
1 parent 89cbb4f commit 7f890ce
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Test
on:
push:
tags:
- v*
branches:
- master
pull_request:
jobs:
test:
strategy:
matrix:
go-version: ["1.15", "1.14", "1.13"]
os: ["ubuntu-latest"]
runs-on: ${{ matrix.os }}
steps:
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v2
- name: Download go-junit-report
run: go get -u github.com/jstemmer/go-junit-report
- name: Test
run: go test ./... -v 2>&1 | go-junit-report > test-report-go${{ matrix.go-version }}.xml
- name: Upload Unit Test Results
if: always()
uses: actions/upload-artifact@v2
with:
name: Unit Test Results (Go ${{ matrix.go-version }})
path: test-report-go${{ matrix.go-version }}.xml
- name: "Check test results"
run: cat test-report-go${{ matrix.go-version }}.xml
publish-test-results:
name: "Publish Unit Tests Results"
needs: test
runs-on: ubuntu-latest
if: success() || failure()
steps:
- name: Download Artifacts
uses: actions/download-artifact@v2
with:
path: artifacts
- name: "check uploads"
run: ls -la *
- name: Publish Unit Test Results
uses: EnricoMi/[email protected]
with:
check_name: Unit Test Results
github_token: ${{ secrets.GITHUB_TOKEN }}
files: artifacts/test-report-go*.xml

0 comments on commit 7f890ce

Please sign in to comment.