Browse Source

Add GHA workflow to run test_crosscompile and go test (#141)

* Add GHA workflow to run test_crosscompile and go test
* crosscompile job doesn't need setup-go
* Test more go versions
* Test 1.6
* Remove 1.13 and add comment of testing strategy
Fraser Waters 4 months ago
parent
commit
7de28cee0d

+ 17 - 0
.github/workflows/crosscompile.yml

@@ -0,0 +1,17 @@
+name: Crosscompile
+
+on:
+  push:
+    branches:
+    - master
+
+jobs:
+  test:
+    name: Run ./test_crosscompile.sh
+    runs-on: ubuntu-latest
+
+    steps:
+    - name: Checkout repo
+      uses: actions/checkout@v2
+    - name: Run ./test_crosscompile.sh
+      run: ./test_crosscompile.sh

+ 39 - 0
.github/workflows/test.yml

@@ -0,0 +1,39 @@
+name: Test
+
+on:
+  push:
+    branches:
+    - master
+  pull_request:
+    branches:
+    - master
+
+jobs:
+  test:
+    name: "Test go ${{ matrix.go_version }} on ${{ matrix.platform }}"
+    runs-on: ${{ matrix.platform }}
+
+    strategy:
+        matrix:
+          platform:
+            - ubuntu-latest
+            - macos-latest
+          go_version:
+            # Test the oldest release we targeted and the two currently supported releases (https://go.dev/doc/devel/release#policy)
+            - 1.6.x
+            - 1.17.x
+            - 1.18.x
+
+    steps:
+    - name: Set up Go ${{ matrix.go_version }}
+      uses: actions/setup-go@v2
+      with:
+        go-version: ${{ matrix.go_version }}
+        check-latest: true
+    - name: Checkout repo
+      uses: actions/checkout@v2
+
+    - name: Build
+      run: go build -v
+    - name: Test
+      run: go test -v

+ 1 - 1
ioctl.go

@@ -1,5 +1,5 @@
 //go:build !windows && !solaris
-//+build !windows,!solaris
+// +build !windows,!solaris
 
 package pty
 

+ 2 - 2
ioctl_bsd.go

@@ -1,5 +1,5 @@
-//go:build (darwin || dragonfly || freebsd || netbsd || openbsd)
-//+build darwin dragonfly freebsd netbsd openbsd
+//go:build darwin || dragonfly || freebsd || netbsd || openbsd
+// +build darwin dragonfly freebsd netbsd openbsd
 
 package pty
 

+ 1 - 1
ioctl_solaris.go

@@ -1,5 +1,5 @@
 //go:build solaris
-//+build solaris
+// +build solaris
 
 package pty
 

+ 1 - 1
pty_darwin.go

@@ -1,5 +1,5 @@
 //go:build darwin
-//+build darwin
+// +build darwin
 
 package pty
 

+ 1 - 1
pty_dragonfly.go

@@ -1,5 +1,5 @@
 //go:build dragonfly
-//+build dragonfly
+// +build dragonfly
 
 package pty
 

+ 1 - 1
pty_freebsd.go

@@ -1,5 +1,5 @@
 //go:build freebsd
-//+build freebsd
+// +build freebsd
 
 package pty
 

+ 1 - 1
pty_linux.go

@@ -1,5 +1,5 @@
 //go:build linux
-//+build linux
+// +build linux
 
 package pty
 

+ 1 - 1
pty_netbsd.go

@@ -1,5 +1,5 @@
 //go:build netbsd
-//+build netbsd
+// +build netbsd
 
 package pty
 

+ 1 - 1
pty_openbsd.go

@@ -1,5 +1,5 @@
 //go:build openbsd
-//+build openbsd
+// +build openbsd
 
 package pty
 

+ 1 - 1
pty_solaris.go

@@ -1,5 +1,5 @@
 //go:build solaris
-//+build solaris
+// +build solaris
 
 package pty
 

+ 1 - 1
pty_unsupported.go

@@ -1,5 +1,5 @@
 //go:build !linux && !darwin && !freebsd && !dragonfly && !netbsd && !openbsd && !solaris
-//+build !linux,!darwin,!freebsd,!dragonfly,!netbsd,!openbsd,!solaris
+// +build !linux,!darwin,!freebsd,!dragonfly,!netbsd,!openbsd,!solaris
 
 package pty
 

+ 1 - 1
run.go

@@ -1,5 +1,5 @@
 //go:build !windows
-//+build !windows
+// +build !windows
 
 package pty
 

+ 1 - 1
types.go

@@ -1,5 +1,5 @@
 //go:build ignore
-//+build ignore
+// +build ignore
 
 package pty
 

+ 1 - 1
types_dragonfly.go

@@ -1,5 +1,5 @@
 //go:build ignore
-//+build ignore
+// +build ignore
 
 package pty
 

+ 1 - 1
types_freebsd.go

@@ -1,5 +1,5 @@
 //go:build ignore
-//+build ignore
+// +build ignore
 
 package pty
 

+ 1 - 1
types_netbsd.go

@@ -1,5 +1,5 @@
 //go:build ignore
-//+build ignore
+// +build ignore
 
 package pty
 

+ 1 - 1
types_openbsd.go

@@ -1,5 +1,5 @@
 //go:build ignore
-//+build ignore
+// +build ignore
 
 package pty
 

+ 1 - 1
winsize_unix.go

@@ -1,5 +1,5 @@
 //go:build !windows
-//+build !windows
+// +build !windows
 
 package pty
 

+ 1 - 1
winsize_unsupported.go

@@ -1,5 +1,5 @@
 //go:build windows
-//+build windows
+// +build windows
 
 package pty
 

+ 1 - 1
ztypes_386.go

@@ -1,5 +1,5 @@
 //go:build 386
-//+build 386
+// +build 386
 
 // Created by cgo -godefs - DO NOT EDIT
 // cgo -godefs types.go

+ 1 - 1
ztypes_amd64.go

@@ -1,5 +1,5 @@
 //go:build amd64
-//+build amd64
+// +build amd64
 
 // Created by cgo -godefs - DO NOT EDIT
 // cgo -godefs types.go

+ 1 - 1
ztypes_arm.go

@@ -1,5 +1,5 @@
 //go:build arm
-//+build arm
+// +build arm
 
 // Created by cgo -godefs - DO NOT EDIT
 // cgo -godefs types.go

+ 1 - 1
ztypes_arm64.go

@@ -1,5 +1,5 @@
 //go:build arm64
-//+build arm64
+// +build arm64
 
 // Created by cgo -godefs - DO NOT EDIT
 // cgo -godefs types.go

+ 1 - 1
ztypes_dragonfly_amd64.go

@@ -1,5 +1,5 @@
 //go:build amd64 && dragonfly
-//+build amd64,dragonfly
+// +build amd64,dragonfly
 
 // Created by cgo -godefs - DO NOT EDIT
 // cgo -godefs types_dragonfly.go

+ 1 - 1
ztypes_freebsd_386.go

@@ -1,5 +1,5 @@
 //go:build 386 && freebsd
-//+build 386,freebsd
+// +build 386,freebsd
 
 // Created by cgo -godefs - DO NOT EDIT
 // cgo -godefs types_freebsd.go

+ 1 - 1
ztypes_freebsd_amd64.go

@@ -1,5 +1,5 @@
 //go:build amd64 && freebsd
-//+build amd64,freebsd
+// +build amd64,freebsd
 
 // Created by cgo -godefs - DO NOT EDIT
 // cgo -godefs types_freebsd.go

+ 1 - 1
ztypes_freebsd_arm.go

@@ -1,5 +1,5 @@
 //go:build arm && freebsd
-//+build arm,freebsd
+// +build arm,freebsd
 
 // Created by cgo -godefs - DO NOT EDIT
 // cgo -godefs types_freebsd.go

+ 1 - 1
ztypes_freebsd_arm64.go

@@ -1,5 +1,5 @@
 //go:build arm64 && freebsd
-//+build arm64,freebsd
+// +build arm64,freebsd
 
 // Code generated by cmd/cgo -godefs; DO NOT EDIT.
 // cgo -godefs types_freebsd.go

+ 2 - 2
ztypes_mipsx.go

@@ -1,6 +1,6 @@
 //go:build (mips || mipsle || mips64 || mips64le) && linux
-//+build linux
-//+build mips mipsle mips64 mips64le
+// +build mips mipsle mips64 mips64le
+// +build linux
 
 // Created by cgo -godefs - DO NOT EDIT
 // cgo -godefs types.go

+ 2 - 2
ztypes_netbsd_32bit_int.go

@@ -1,6 +1,6 @@
 //go:build (386 || amd64 || arm || arm64) && netbsd
-//+build netbsd
-//+build 386 amd64 arm arm64
+// +build 386 amd64 arm arm64
+// +build netbsd
 
 package pty
 

+ 2 - 2
ztypes_openbsd_32bit_int.go

@@ -1,6 +1,6 @@
 //go:build (386 || amd64 || arm || arm64 || mips64) && openbsd
-//+build openbsd
-//+build 386 amd64 arm arm64 mips64
+// +build 386 amd64 arm arm64 mips64
+// +build openbsd
 
 package pty
 

+ 1 - 1
ztypes_ppc64.go

@@ -1,5 +1,5 @@
 //go:build ppc64
-//+build ppc64
+// +build ppc64
 
 // Created by cgo -godefs - DO NOT EDIT
 // cgo -godefs types.go

+ 1 - 1
ztypes_ppc64le.go

@@ -1,5 +1,5 @@
 //go:build ppc64le
-//+build ppc64le
+// +build ppc64le
 
 // Created by cgo -godefs - DO NOT EDIT
 // cgo -godefs types.go

+ 1 - 1
ztypes_riscvx.go

@@ -1,5 +1,5 @@
 //go:build riscv || riscv64
-//+build riscv riscv64
+// +build riscv riscv64
 
 // Code generated by cmd/cgo -godefs; DO NOT EDIT.
 // cgo -godefs types.go

+ 1 - 1
ztypes_s390x.go

@@ -1,5 +1,5 @@
 //go:build s390x
-//+build s390x
+// +build s390x
 
 // Created by cgo -godefs - DO NOT EDIT
 // cgo -godefs types.go