Skip to content

Commit

Permalink
*: Upload test junit results
Browse files Browse the repository at this point in the history
  • Loading branch information
serathius committed Jun 28, 2021
1 parent 2a0f8f0 commit 1b62d8a
Show file tree
Hide file tree
Showing 3 changed files with 123 additions and 20 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Build
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target:
- linux-amd64
- linux-386
- darwin-amd64
- windows-amd64
- linux-arm
- linux-arm64
- linux-ppc64le
- linux-s390x
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: "^1.16"
- env:
TARGET: ${{ matrix.target }}
run: |
echo "${TARGET}"
case "${TARGET}" in
linux-amd64)
GOARCH=amd64 PASSES='build' ./test.sh
;;
linux-386)
GOARCH=386 PASSES='build' ./test.sh
;;
darwin-amd64)
GO_BUILD_FLAGS='-v -mod=readonly' GOOS=darwin GOARCH=amd64 ./build.sh
;;
windows-amd64)
GO_BUILD_FLAGS='-v -mod=readonly' GOOS=windows GOARCH=amd64 ./build.sh
;;
linux-arm)
GO_BUILD_FLAGS='-v -mod=readonly' GOARCH=arm ./build.sh
;;
linux-arm64)
GO_BUILD_FLAGS='-v -mod=readonly' GOARCH=arm64 ./build.sh
;;
linux-ppc64le)
GO_BUILD_FLAGS='-v -mod=readonly' GOARCH=ppc64le ./build.sh
;;
linux-s390x)
GO_BUILD_FLAGS='-v -mod=readonly' GOARCH=s390x ./build.sh
;;
*)
echo "Failed to find target"
exit 1
;;
esac
38 changes: 38 additions & 0 deletions .github/workflows/static-analysis.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Static Analysis
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target:
- linux-amd64-fmt
- linux-amd64-bom
- linux-amd64-dep
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: "^1.16"
- run: date
- env:
TARGET: ${{ matrix.target }}
JUNIT_REPORT_DIR: "."
run: |
echo "${TARGET}"
case "${TARGET}" in
linux-amd64-fmt)
GOARCH=amd64 PASSES='fmt' ./test.sh
;;
linux-amd64-bom)
GOARCH=amd64 PASSES='bom' ./test.sh
;;
linux-amd64-dep)
GOARCH=amd64 PASSES='dep' ./test.sh
;;
*)
echo "Failed to find target"
exit 1
;;
esac
49 changes: 29 additions & 20 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@ jobs:
fail-fast: false
matrix:
target:
- linux-amd64-fmt
- linux-amd64-integration-1-cpu
- linux-amd64-integration-2-cpu
- linux-amd64-integration-4-cpu
- linux-amd64-unit-4-cpu-race
- all-build
- linux-386-unit-1-cpu
steps:
- uses: actions/checkout@v2
Expand All @@ -25,36 +23,47 @@ jobs:
run: |
echo "${TARGET}"
case "${TARGET}" in
linux-amd64-fmt)
GOARCH=amd64 PASSES='fmt bom dep' ./test.sh
;;
linux-amd64-integration-1-cpu)
GOARCH=amd64 CPU=1 PASSES='integration' RACE='false' ./test.sh
GOARCH=amd64 CPU=1 PASSES='integration' RACE='false' JUNIT_REPORT_DIR=. ./test.sh
;;
linux-amd64-integration-2-cpu)
GOARCH=amd64 CPU=2 PASSES='integration' RACE='false' ./test.sh
GOARCH=amd64 CPU=2 PASSES='integration' RACE='false' JUNIT_REPORT_DIR=. ./test.sh
;;
linux-amd64-integration-4-cpu)
GOARCH=amd64 CPU=4 PASSES='integration' RACE='false' ./test.sh
GOARCH=amd64 CPU=4 PASSES='integration' RACE='false' JUNIT_REPORT_DIR=. ./test.sh
;;
linux-amd64-unit-4-cpu-race)
GOARCH=amd64 PASSES='unit' RACE='true' CPU='4' ./test.sh -p=2
;;
all-build)
GOARCH=amd64 PASSES='build' ./test.sh
GOARCH=386 PASSES='build' ./test.sh
GO_BUILD_FLAGS='-v -mod=readonly' GOOS=darwin GOARCH=amd64 ./build.sh
GO_BUILD_FLAGS='-v -mod=readonly' GOOS=windows GOARCH=amd64 ./build.sh
GO_BUILD_FLAGS='-v -mod=readonly' GOARCH=arm ./build.sh
GO_BUILD_FLAGS='-v -mod=readonly' GOARCH=arm64 ./build.sh
GO_BUILD_FLAGS='-v -mod=readonly' GOARCH=ppc64le ./build.sh
GO_BUILD_FLAGS='-v -mod=readonly' GOARCH=s390x ./build.sh
GOARCH=amd64 PASSES='unit' RACE='true' CPU='4' JUNIT_REPORT_DIR=. ./test.sh -p=2
;;
linux-386-unit-1-cpu)
GOARCH=386 PASSES='unit' RACE='false' CPU='1' ./test -p=4
GOARCH=386 PASSES='unit' RACE='false' CPU='1' JUNIT_REPORT_DIR=. ./test -p=4
;;
*)
echo "Failed to find target"
exit 1
;;
esac
- name: Upload Unit Test Results
if: always()
uses: actions/upload-artifact@v2
with:
name: Unit Test Results ${{ matrix.target }}
path: junit_*.xml

publish-test-results:
name: "Publish Unit Tests Results"
needs: test
runs-on: ubuntu-latest
# the test job might be skipped, we don't need to run this job then
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
with:
files: artifacts/**/*.xml

0 comments on commit 1b62d8a

Please sign in to comment.