Files
webrtc/.github/workflows/test.yaml
Pion 5b7732e52f Update CI configs to v0.4.9
Update lint scripts and CI configs.
2020-10-23 22:15:44 -07:00

133 lines
3.3 KiB
YAML

name: Test
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
go: ["1.14", "1.15"]
name: Go ${{ matrix.go }}
steps:
- uses: actions/checkout@v2
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go }}
- name: Set test packages
run: echo ::set-env name=TEST_PACKAGES::$(go list ./... | grep -v examples)
- name: Run test
run: |
go test \
-coverprofile=cover.out -covermode=atomic \
-tags quic \
-v -race ${TEST_PACKAGES}
- uses: codecov/codecov-action@v1
with:
file: ./cover.out
name: codecov-umbrella
fail_ci_if_error: true
flags: go
test-i386:
runs-on: ubuntu-latest
strategy:
matrix:
go: ["1.14", "1.15"]
name: Go i386 ${{ matrix.go }}
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: |
~/go/pkg/mod
~/.cache
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Set test packages
run: echo ::set-env name=TEST_PACKAGES::$(go list ./... | grep -v examples)
- name: Run test
run: |
docker run \
-u $(id -u):$(id -g) \
-e "GO111MODULE=on" \
-e "CGO_ENABLED=0" \
-v $GITHUB_WORKSPACE:/go/src/github.com/pion/$(basename $GITHUB_WORKSPACE) \
-v $HOME/go/pkg/mod:/go/pkg/mod \
-v $HOME/.cache:/.cache \
-w /go/src/github.com/pion/$(basename $GITHUB_WORKSPACE) \
i386/golang:${{matrix.go}}-alpine \
/usr/local/go/bin/go test \
-tags quic \
-v ${TEST_PACKAGES}
test-wasm:
runs-on: ubuntu-latest
name: WASM
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '12.x'
- uses: actions/cache@v2
with:
path: |
~/go/pkg/mod
~/.cache
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Set test packages
run: echo ::set-env name=TEST_PACKAGES::$(go list ./... | grep -v examples)
- name: Download Go
run: curl -sSfL https://dl.google.com/go/go${GO_VERSION}.linux-amd64.tar.gz | tar -C ~ -xzf -
env:
GO_VERSION: 1.15
- name: Set Go Root
run: echo ::set-env name=GOROOT::${HOME}/go
- name: Set Go Path
run: echo ::set-env name=GOPATH::${HOME}/go
- name: Update Path
run: echo ::set-env name=PATH::${GOROOT}/bin:${PATH}
- name: Set Go WASM Exec
run: echo ::set-env name=GO_JS_WASM_EXEC::${PWD}/test-wasm/go_js_wasm_exec
- name: Insall NPM modules
run: yarn install
- name: Run Tests
run: |
GOOS=js GOARCH=wasm go test \
-coverprofile=cover.out -covermode=atomic \
-exec="${GO_JS_WASM_EXEC}" \
-v ${TEST_PACKAGES}
- uses: codecov/codecov-action@v1
with:
file: ./cover.out
name: codecov-umbrella
fail_ci_if_error: true
flags: wasm