-
Notifications
You must be signed in to change notification settings - Fork 25
41 lines (41 loc) · 1018 Bytes
/
testing.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
on:
pull_request:
branches:
- main
name: Build Test
jobs:
build:
name: Build & Test
runs-on: ubuntu-20.04
strategy:
matrix:
include:
- goarch: amd64
goos: linux
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
steps:
- uses: actions/checkout@v2
with:
ref: 'dev'
- uses: actions/setup-go@v4
with:
go-version: '1.22'
cache-dependency-path: subdir/go.sum
- name: generate resources
run: |
mkdir -p {build/data,build/static}
go generate ./...
- name: Test
id: gotest
run: |
export GOPATH="$HOME/go/"
export PATH=$PATH:$GOPATH/bin
go install github.com/jstemmer/go-junit-report/v2@latest
go test -v 2>&1 ./... | go-junit-report -set-exit-code > report.xml
- name: Publish Unit Test Results
uses: EnricoMi/[email protected]
if: always()
with:
files: "./report.xml"