Update action workflows #2
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: Tests | |
on: | |
pull_request: | |
push: | |
branches: 'main' | |
jobs: | |
test: | |
runs-on: | |
labels: ubuntu-latest-m | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: '1.22' | |
- name: Install dependencies | |
run: go get . | |
- name: Build | |
run: go build -v ./... | |
- name: Install tparse | |
run: go install github.com/mfridman/tparse@latest | |
- name: Unit Tests | |
run: go test --cover $(go list ./... | grep -v /integration | grep -v /database | grep -v /cmd | grep -v /viewer ) -json 2>&1 | tee unit.out && tparse -all --file=unit.out | |
- name: Integration Tests | |
shell: 'script -q -e -c "bash {0}"' | |
run: go test ./integration/... -json -timeout 1800s 2>&1 | tee integration.out && tparse -all --file=integration.out | |
- name: Database Tests | |
shell: 'script -q -e -c "bash {0}"' | |
run: go test ./database/... -json -timeout 1800s 2>&1 | tee database.out && tparse -all --file=database.out | |
- name: Cmd Tests | |
shell: 'script -q -e -c "bash {0}"' | |
run: go test ./cmd/... -json -timeout 1800s 2>&1 | tee cmd.out && tparse -all --file=cmd.out | |
- name: Viewer Tests | |
shell: 'script -q -e -c "bash {0}"' | |
run: go test ./viewer/... -json -timeout 1800s 2>&1 | tee viewer.out && tparse -all --file=viewer.out | |
- name: Upload test output on failure | |
uses: actions/upload-artifact@v4 | |
if: ${{ failure() }} | |
with: | |
name: media | |
path: | | |
integration.out | |
unit.out | |
database.out | |
cmd.out | |
viewer.out | |