89 lines
1.9 KiB
YAML
89 lines
1.9 KiB
YAML
name: Go
|
|
|
|
on:
|
|
push:
|
|
branches: [ master ]
|
|
pull_request:
|
|
branches: [ master ]
|
|
|
|
|
|
jobs:
|
|
build:
|
|
strategy:
|
|
matrix:
|
|
go-version: [1.15.x, 1.16.x, 1.17.x]
|
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
env:
|
|
CGO_ENABLED: 0
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v2
|
|
with:
|
|
go-version: ${{ matrix.go-version }}
|
|
|
|
- name: Checkout code
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Vet
|
|
run: go vet ./...
|
|
|
|
- name: Test
|
|
run: go test ./...
|
|
|
|
- name: Test Noasm
|
|
run: go test -tags=noasm&&go test -no-avx512&&go test -no-avx512 -no-avx2&&go test -no-avx512 -no-avx2 -no-ssse3
|
|
|
|
- name: Test Race
|
|
env:
|
|
CGO_ENABLED: 1
|
|
run: go test -cpu="1,4" -short -race -v .
|
|
|
|
build-special:
|
|
env:
|
|
CGO_ENABLED: 0
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v2
|
|
with:
|
|
go-version: 1.17.x
|
|
|
|
- name: Checkout code
|
|
uses: actions/checkout@v2
|
|
|
|
- name: fmt
|
|
run: diff <(gofmt -d .) <(printf "")
|
|
|
|
- name: Test 386
|
|
run: GOOS=linux GOARCH=386 go test -short ./...
|
|
|
|
- name: Build examples
|
|
run: go build examples/simple-decoder.go&&go build examples/simple-encoder.go&&go build examples/stream-decoder.go&&go build examples/stream-encoder.go
|
|
|
|
- name: Test Races, noasm, 1 cpu
|
|
env:
|
|
CGO_ENABLED: 1
|
|
run: go test -tags=noasm -cpu=1 -short -race .
|
|
|
|
- name: Test Races, noasm, 4 cpu
|
|
env:
|
|
CGO_ENABLED: 1
|
|
run: go test -tags=noasm -cpu=4 -short -race .
|
|
|
|
- name: Test Races, no avx512
|
|
env:
|
|
CGO_ENABLED: 1
|
|
run: go test -no-avx512 -short -race .
|
|
|
|
- name: Test Races, no avx2
|
|
env:
|
|
CGO_ENABLED: 1
|
|
run: go test -no-avx512 -no-avx2 -short -race .
|
|
|
|
- name: Test Races, no ssse3
|
|
env:
|
|
CGO_ENABLED: 1
|
|
run: go test -no-avx512 -no-avx2 -no-ssse3 -short -race .
|
|
|