63 lines
1.4 KiB
YAML
63 lines
1.4 KiB
YAML
name: test
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
pull_request:
|
|
|
|
jobs:
|
|
native-os-build:
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest, windows-latest, macOS-latest]
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
steps:
|
|
- uses: actions/checkout@v1
|
|
- uses: actions/setup-go@v1
|
|
with:
|
|
go-version: "1.13"
|
|
- name: Build native
|
|
run: GOARCH=amd64 go build -v ./...
|
|
shell: bash
|
|
- name: Install socat
|
|
if: matrix.os == 'ubuntu-latest'
|
|
run: sudo apt-get install socat
|
|
shell: bash
|
|
- name: Run unit tests
|
|
run: go test -v -race ./...
|
|
shell: bash
|
|
- name: Cross-build for 386
|
|
if: matrix.os != 'macOS-latest'
|
|
run: GOARCH=386 go build -v ./...
|
|
shell: bash
|
|
- name: Cross-build for arm
|
|
if: matrix.os != 'macOS-latest'
|
|
run: GOARCH=arm go build -v ./...
|
|
shell: bash
|
|
|
|
cross-os-build:
|
|
strategy:
|
|
matrix:
|
|
go-os-pairs:
|
|
- "freebsd amd64"
|
|
- "openbsd amd64"
|
|
- "openbsd 386"
|
|
- "openbsd arm"
|
|
- "linux ppc64le"
|
|
|
|
runs-on: "ubuntu-latest"
|
|
|
|
steps:
|
|
- uses: actions/checkout@v1
|
|
- uses: actions/setup-go@v1
|
|
with:
|
|
go-version: "1.13"
|
|
- name: Cross-build
|
|
run: |
|
|
set ${{ matrix.go-os-pairs }}
|
|
GOOS=$1 GOARCH=$2 go build -v ./...
|
|
shell: bash
|