Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Test all GOOS/GOARCH combinations by looping over "go tool dist list"; this just tests if it compiles. - Add a Vagrant box to test Debian 6 / Linux 2.6.32; this was adapted from @horahoradev's patch at #434. - Update the minimum version requirements: we test Linux 2.6.32 now and turns out that's also the minimum version [Go supports] in recent releases, so just set it to that. Need Go 1.16 for retract in go.mod. I don't know, maybe we can just remove the retract? Latest Debian ships with Go 1.15. [Go supports]: golang/go#45964 - Test both Go 1.16 and 1.18 (the lowest supported version and newest version). I guess we could also test 1.17, but the CI already takes somewhat long and I can't recall ever having a situation where an intermediate version failed. - Test macOS 11 and 12; macOS 10.15 will (probably) end support in November, so probably not worth supporting this. GitHub will [remove] support for this at the end of August. [remove]: https://github.blog/changelog/2022-07-20-github-actions-the-macos-10-15-actions-runner-image-is-being-deprecated-and-will-be-removed-by-8-30-22/ - Test OpenBSD, NetBSD. - Move "lint" to its own YAML file. Future work: - Actually run tests for all systems Go supports. Bit pointless right now as many of these don't do anything. Currently untested are Solaris, illumios, plan9, AIX, Android, iOS, DragonflyBSD, WASM. Some of these might be difficult (AIX, iOS, Android), but haven't looked in to it. I tried setting up Solaris with the vmactions/solaris, but it doesn't seem to have an easy way to install Go. - GitHub only [supports] Windows Server 2019 and 2022; probabably also want to test Server 2016, but GitHub dropped support for this. Can maybe use AppVeyor(?) [supports]: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#choosing-github-hosted-runners - Could maybe test older versions of BSD, too. Not sure of it's worth it.
- Loading branch information
Showing
6 changed files
with
123 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Vagrant.configure("2") do |config| | ||
config.vm.box = "threatstack/debian6" | ||
config.vm.box_version = "1.0.0" | ||
|
||
config.vm.define 'debian6' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: test | ||
on: | ||
push: | ||
pull_request: | ||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: setup Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: '1.18' | ||
|
||
- name: checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: gofmt | ||
run: | | ||
test -z "$(gofmt -s -d . | tee /dev/stderr)" | ||
- name: vet | ||
run: | | ||
go vet ./... | ||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v3 | ||
continue-on-error: true | ||
with: | ||
version: latest | ||
skip-go-installation: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: vagrant | ||
on: | ||
push: | ||
pull_request: | ||
jobs: | ||
test: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
image: | ||
- debian6 | ||
runs-on: macos-12 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: setup Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: '1.18' | ||
|
||
- name: test | ||
run: | | ||
cp -f .github/workflows/Vagrantfile.${{ matrix.image }} Vagrantfile | ||
GOOS=linux GOARCH=amd64 go test -o fsnotify.test -c ./... | ||
vagrant up | ||
vagrant ssh -c "/vagrant/fsnotify.test" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters