Skip to content

fix: return ConnectionStateDisconnected room ConnectionState if engine is nil #3238

fix: return ConnectionStateDisconnected room ConnectionState if engine is nil

fix: return ConnectionStateDisconnected room ConnectionState if engine is nil #3238

Workflow file for this run

# Copyright 2023 LiveKit, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: Test
permissions:
contents: read
on:
schedule:
- cron: '0 3 * * 1,5' # 03:00 each Mon and Fri
workflow_dispatch:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
- name: Set up SoX resampler and Opus
run: |
sudo apt-get update
sudo apt-get install -y libsoxr-dev libopus-dev libopusfile-dev opus-tools
- name: Set up Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7
with:
# Test against the module minimum declared in go.mod, never a newer toolchain
go-version-file: go.mod
# setup-go's own cache restores on an exact key only, so any go.sum
# change is a full cold build. Restored below instead.
cache: false
# The run_id suffix never pre-exists, so a push always writes a fresh
# entry rather than one frozen at the go.sum that first created it.
- name: Restore Go caches
id: go-cache
uses: actions/cache/restore@2c8a9bd7457de244a408f35966fab2fb45fda9c8 # v6
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: go-${{ runner.os }}-${{ hashFiles('go.sum') }}-${{ github.run_id }}
restore-keys: |
go-${{ runner.os }}-${{ hashFiles('go.sum') }}-
go-${{ runner.os }}-
- name: Set up gotestfmt
run: go install github.com/gotesttools/gotestfmt/v2/cmd/gotestfmt@latest
- name: Replace mutexes
run: |
go get github.com/sasha-s/go-deadlock
grep -rl sync.Mutex . | grep .go$ | xargs sed -i 's/sync\.Mutex/deadlock\.Mutex/g'
grep -rl sync.RWMutex . | grep .go$ | xargs sed -i 's/sync\.RWMutex/deadlock\.RWMutex/g'
go install golang.org/x/tools/cmd/goimports@latest
grep -rl deadlock.Mutex . | grep .go$ | xargs goimports -w
grep -rl deadlock.RWMutex . | grep .go$ | xargs goimports -w
go mod tidy
- name: Mage Build
uses: magefile/mage-action@a662bd8c29d8106879588cfff83b2faf6e6f59db # v4
with:
version: latest
args: build
- name: Lint
uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9
with:
version: v2.11.4
- name: Mage Test
uses: magefile/mage-action@a662bd8c29d8106879588cfff83b2faf6e6f59db # v4
with:
version: latest
args: test
env:
TestFlags: "-v"
# Only main writes. Pull requests read main's entry, which keeps ~1 GB
# per PR run out of the repo's 10 GB cache budget.
- name: Save Go caches
if: github.event_name == 'push'
uses: actions/cache/save@2c8a9bd7457de244a408f35966fab2fb45fda9c8 # v6
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ steps.go-cache.outputs.cache-primary-key }}