Skip to content

Commit

Permalink
Multiple fixes; go1.17 compat and github actions improvements
Browse files Browse the repository at this point in the history
- Use go1.17 for github actions.
- Update for go1.17. gofmt adds the go:build statements.
- Use go mod edit instead of go get for testing other packages. There's two
  benefits:
  - This removes the round trip to pkg.go.dev and use the already present local
    checkout.
  - The go get periph.io/x/conn/v3@${GITHUB_SHA} command worked if a maintainer
    push a branch, but fails for a PR. This is because the go get command does a
    clone with all the branches, so it finds the commit even if it's not in main.
    For a PR, one has to pull a specific refs/pull/ID/head ref that is not a
    branch, thus go get cannot find it because git clone doesn't know about it.
    The only way to work around is to git clone manually.
- Remove 'go version' and 'go env' since they are already run as part of
  setup-go@v2.
  • Loading branch information
maruel committed Sep 12, 2021
1 parent b2a8d7d commit a2a3020
Show file tree
Hide file tree
Showing 37 changed files with 41 additions and 7 deletions.
12 changes: 5 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
# Do not forget to bump every 6 months!
gover: ["1.16"]
gover: ["1.17"]
runs-on: "${{matrix.os}}"
name: "go${{matrix.gover}}.x on ${{matrix.os}}"
steps:
Expand All @@ -36,10 +36,6 @@ jobs:
- name: Turn off git core.autocrlf
run: git config --global core.autocrlf false
- uses: actions/checkout@v2
- name: 'go version'
run: go version
- name: 'go env'
run: go env
- name: "Debug"
run: |
echo HOME = $HOME
Expand Down Expand Up @@ -198,7 +194,8 @@ jobs:
cd ..
git clone https://github.com/periph/devices
cd devices
go get periph.io/x/host/v3@${GITHUB_SHA}
go mod edit -replace=periph.io/x/host/v3=../host
go get ./...
go test -short ./...
- name: 'Test on periph.io/x/cmd'
Expand All @@ -207,7 +204,8 @@ jobs:
cd ..
git clone https://github.com/periph/cmd
cd cmd
go get periph.io/x/host/v3@${GITHUB_SHA}
go mod edit -replace=periph.io/x/host/v3=../host
go get ./...
go test -short ./...
- name: 'Send comments'
Expand Down
1 change: 1 addition & 0 deletions allwinner/allwinner_arm64.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed under the Apache License, Version 2.0
// that can be found in the LICENSE file.

//go:build arm64
// +build arm64

package allwinner
Expand Down
1 change: 1 addition & 0 deletions allwinner/allwinner_other.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed under the Apache License, Version 2.0
// that can be found in the LICENSE file.

//go:build !arm && !arm64
// +build !arm,!arm64

package allwinner
Expand Down
1 change: 1 addition & 0 deletions am335x/am335x_other.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed under the Apache License, Version 2.0
// that can be found in the LICENSE file.

//go:build !arm
// +build !arm

package am335x
Expand Down
1 change: 1 addition & 0 deletions bcm283x/bcm283x_arm64.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed under the Apache License, Version 2.0
// that can be found in the LICENSE file.

//go:build arm64
// +build arm64

package bcm283x
Expand Down
1 change: 1 addition & 0 deletions bcm283x/bcm283x_other.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed under the Apache License, Version 2.0
// that can be found in the LICENSE file.

//go:build !arm && !arm64
// +build !arm,!arm64

package bcm283x
Expand Down
1 change: 1 addition & 0 deletions beagle/beagle_other.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed under the Apache License, Version 2.0
// that can be found in the LICENSE file.

//go:build !arm
// +build !arm

package beagle
Expand Down
1 change: 1 addition & 0 deletions beagle/black/black_other.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed under the Apache License, Version 2.0
// that can be found in the LICENSE file.

//go:build !arm
// +build !arm

package black
Expand Down
1 change: 1 addition & 0 deletions beagle/bone/bone_other.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed under the Apache License, Version 2.0
// that can be found in the LICENSE file.

//go:build !arm
// +build !arm

package bone
Expand Down
1 change: 1 addition & 0 deletions beagle/green/green_other.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed under the Apache License, Version 2.0
// that can be found in the LICENSE file.

//go:build !arm
// +build !arm

package green
Expand Down
1 change: 1 addition & 0 deletions chip/chip_other.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed under the Apache License, Version 2.0
// that can be found in the LICENSE file.

//go:build !arm
// +build !arm

package chip
Expand Down
1 change: 1 addition & 0 deletions cpu/cpu_other.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed under the Apache License, Version 2.0
// that can be found in the LICENSE file.

//go:build !linux
// +build !linux

package cpu
Expand Down
1 change: 1 addition & 0 deletions distro/distro_arm64.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed under the Apache License, Version 2.0
// that can be found in the LICENSE file.

//go:build arm64
// +build arm64

package distro
Expand Down
1 change: 1 addition & 0 deletions distro/distro_nonarm.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed under the Apache License, Version 2.0
// that can be found in the LICENSE file.

//go:build !arm && !arm64
// +build !arm,!arm64

package distro
Expand Down
1 change: 1 addition & 0 deletions distro/distro_nonlinux.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed under the Apache License, Version 2.0
// that can be found in the LICENSE file.

//go:build !linux
// +build !linux

package distro
Expand Down
1 change: 1 addition & 0 deletions fs/fs_other.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed under the Apache License, Version 2.0
// that can be found in the LICENSE file.

//go:build !linux
// +build !linux

package fs
Expand Down
1 change: 1 addition & 0 deletions fs/ioctl_mips_like.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed under the Apache License, Version 2.0
// that can be found in the LICENSE file.

//go:build mips || mipsle
// +build mips mipsle

package fs
Expand Down
1 change: 1 addition & 0 deletions fs/ioctl_other.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed under the Apache License, Version 2.0
// that can be found in the LICENSE file.

//go:build !mips && !mipsle
// +build !mips,!mipsle

package fs
Expand Down
1 change: 1 addition & 0 deletions ftdi/debug.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed under the Apache License, Version 2.0
// that can be found in the LICENSE file.

//go:build periph_host_ftdi_debug
// +build periph_host_ftdi_debug

package ftdi
Expand Down
1 change: 1 addition & 0 deletions ftdi/no_debug.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed under the Apache License, Version 2.0
// that can be found in the LICENSE file.

//go:build !periph_host_ftdi_debug
// +build !periph_host_ftdi_debug

package ftdi
Expand Down
1 change: 1 addition & 0 deletions mt7688/mt7688_mips_like.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed under the Apache License, Version 2.0
// that can be found in the LICENSE file.

//go:build mips || mipsle
// +build mips mipsle

package mt7688
Expand Down
1 change: 1 addition & 0 deletions mt7688/mt7688_other.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed under the Apache License, Version 2.0
// that can be found in the LICENSE file.

//go:build !mipsle
// +build !mipsle

package mt7688
Expand Down
1 change: 1 addition & 0 deletions netlink/netlink_other.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed under the Apache License, Version 2.0
// that can be found in the LICENSE file.

//go:build !linux
// +build !linux

package netlink
Expand Down
1 change: 1 addition & 0 deletions odroidc1/odroidc1_other.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed under the Apache License, Version 2.0
// that can be found in the LICENSE file.

//go:build !arm
// +build !arm

package odroidc1
Expand Down
1 change: 1 addition & 0 deletions pine64/pine64_arm64.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed under the Apache License, Version 2.0
// that can be found in the LICENSE file.

//go:build arm64
// +build arm64

package pine64
Expand Down
1 change: 1 addition & 0 deletions pine64/pine64_other.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed under the Apache License, Version 2.0
// that can be found in the LICENSE file.

//go:build !arm && !arm64
// +build !arm,!arm64

package pine64
Expand Down
1 change: 1 addition & 0 deletions pmem/mem_other.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed under the Apache License, Version 2.0
// that can be found in the LICENSE file.

//go:build !linux
// +build !linux

package pmem
Expand Down
1 change: 1 addition & 0 deletions pru/pru_other.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed under the Apache License, Version 2.0
// that can be found in the LICENSE file.

//go:build !arm
// +build !arm

package pru
Expand Down
1 change: 1 addition & 0 deletions rpi/rpi_arm64.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed under the Apache License, Version 2.0
// that can be found in the LICENSE file.

//go:build arm64
// +build arm64

package rpi
Expand Down
1 change: 1 addition & 0 deletions rpi/rpi_other.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed under the Apache License, Version 2.0
// that can be found in the LICENSE file.

//go:build !arm && !arm64
// +build !arm,!arm64

package rpi
Expand Down
1 change: 1 addition & 0 deletions serial/serial_fast.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed under the Apache License, Version 2.0
// that can be found in the LICENSE file.

//go:build freebsd || linux || netbsd || solaris
// +build freebsd linux netbsd solaris

package serial
Expand Down
1 change: 1 addition & 0 deletions serial/serial_not_win.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed under the Apache License, Version 2.0
// that can be found in the LICENSE file.

//go:build !windows
// +build !windows

package serial
Expand Down
1 change: 1 addition & 0 deletions serial/serial_other.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed under the Apache License, Version 2.0
// that can be found in the LICENSE file.

//go:build !freebsd && !linux && !netbsd && !solaris && !darwin && !dragonfly && !openbsd
// +build !freebsd,!linux,!netbsd,!solaris,!darwin,!dragonfly,!openbsd

package serial
Expand Down
1 change: 1 addition & 0 deletions serial/serial_slow.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed under the Apache License, Version 2.0
// that can be found in the LICENSE file.

//go:build darwin || dragonfly || openbsd
// +build darwin dragonfly openbsd

package serial
Expand Down
1 change: 1 addition & 0 deletions serial/serial_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed under the Apache License, Version 2.0
// that can be found in the LICENSE file.

//go:build windows
// +build windows

package serial
Expand Down
1 change: 1 addition & 0 deletions sysfs/fs_other.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed under the Apache License, Version 2.0
// that can be found in the LICENSE file.

//go:build !linux
// +build !linux

package sysfs
Expand Down
1 change: 1 addition & 0 deletions sysfs/sysfs_other.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed under the Apache License, Version 2.0
// that can be found in the LICENSE file.

//go:build !linux
// +build !linux

package sysfs
Expand Down

0 comments on commit a2a3020

Please sign in to comment.