Merge pull request #205 from creydr/dependabot/go_modules/k8s.io/api-… #524
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: 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 -coverprofile cover.out 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: Upload coverage to Codecov | |
if: always() | |
uses: codecov/codecov-action@v1 | |
with: | |
file: ./cover.out | |
name: codecov go${{ matrix.go-version }} | |
verbose: true | |
- 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: Publish Unit Test Results | |
uses: EnricoMi/publish-unit-test-result-action@v1.5 | |
with: | |
check_name: Unit Test Results | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
files: artifacts/**/test-report-go*.xml |