mirror of
https://github.com/livekit/livekit.git
synced 2026-04-05 03:45:44 +00:00
Generated by renovateBot Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
66 lines
1.8 KiB
YAML
66 lines
1.8 KiB
YAML
name: Test
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
branches: [ master ]
|
|
pull_request:
|
|
branches: [ master ]
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: shogo82148/actions-setup-redis@v1
|
|
with:
|
|
redis-version: '6.x'
|
|
auto-start: true
|
|
- run: redis-cli ping
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v4
|
|
with:
|
|
go-version: '1.18'
|
|
|
|
- name: Set up gotestfmt
|
|
run: go install github.com/gotesttools/gotestfmt/v2/cmd/gotestfmt@v2.4.1
|
|
|
|
- name: Replace mutexes
|
|
run: |
|
|
go get github.com/sasha-s/go-deadlock
|
|
grep -rl sync.Mutex ./pkg | xargs sed -i 's/sync\.Mutex/deadlock\.Mutex/g'
|
|
grep -rl sync.RWMutex ./pkg | xargs sed -i 's/sync\.RWMutex/deadlock\.RWMutex/g'
|
|
go install golang.org/x/tools/cmd/goimports
|
|
grep -rl deadlock.Mutex ./pkg | xargs goimports -w
|
|
grep -rl deadlock.RWMutex ./pkg | xargs goimports -w
|
|
go mod tidy
|
|
|
|
- name: Mage Build
|
|
uses: magefile/mage-action@v2
|
|
with:
|
|
version: latest
|
|
args: build
|
|
|
|
# - name: Static Check
|
|
# uses: dominikh/staticcheck-action@v1.3.0
|
|
# with:
|
|
# checks: '["all", "-ST1000", "-ST1003", "-ST1020", "-ST1021", "-ST1022", "-SA1019"]'
|
|
# min-go-version: 1.18
|
|
# version: 2022.1.3
|
|
# install-go: false
|
|
|
|
- name: Test
|
|
run: |
|
|
set -euo pipefail
|
|
MallocNanoZone=0 go test -race -json -v ./... 2>&1 | tee /tmp/gotest.log | gotestfmt
|
|
|
|
# Upload the original go test log as an artifact for later review.
|
|
- name: Upload test log
|
|
uses: actions/upload-artifact@v3
|
|
if: always()
|
|
with:
|
|
name: test-log
|
|
path: /tmp/gotest.log
|
|
if-no-files-found: error
|