86 Commits

Author SHA1 Message Date
Daniel Martí 9ad412ea0b cmd: bump gioui.org dependency, use -modfile properly on CI
A simple 'go test -modfile=<path>' won't work properly for the
end-to-end tests, since they run 'go build' under the hood as well.

To properly propagate the flag, we need to use GOFLAGS. Since -modfile
is always relative to the current directory, we can't use it to test
many packages at once, nor can we use it via 'go test ./gogio'.

While at it, document this distinction in go.local.mod to prevent others
getting confused like I did.

Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
2020-05-10 20:32:53 +02:00
Daniel Martí ec34eb4919 cmd: add a go.local.mod for development
It's essentially a copy of go.mod, but with the gioui.org module replaed
with the parent directory. Useful when wanting to try a change in the
root module as part of a gogio invocation or end-to-end test, such as
either of the following:

	$ cd cmd; go test -modfile=go.local.mod ./...
	$ cd cmd/gogio; go build -modfile=../go.local.mod

Since go.sum can essentially be shared, and since it seems to work with
the go tool, use a symlink. The way the -modfile flag works, if given
foo.mod, it will use the sum file at foo.sum. The only caveat is that
'go mod tidy -modfile=go.mod.local' will try to remove gioui.org lines,
since that module is replaced. So tidy shouldn't be used with -modfile.

In the future, the only upkeep needed for go.local.mod is to update the
external dependencies to mirror changes in go.mod. This is not automated
nor checked by CI, but it could be in the future if it becomes
repetitive or error-prone.

Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
2020-05-06 08:41:00 +02:00
Elias Naur 0542796463 .builds: add webassembly build test
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2020-04-01 13:32:18 +02:00
Chris Waldon daecdcaabf ci: add skeleton for sourcehut annotations
This commit adds the necessary task to the CI job to generate sourcehut
annotations as documented here:

https://man.sr.ht/git.sr.ht/annotations.md

Signed-off-by: Chris Waldon <christopher.waldon.dev@gmail.com>
2020-03-15 09:30:37 +01:00
Daniel Martí acfe91ec3e CI: add wine on Linux for the Windows e2e test
Installing it on Debian was enough, with the only wrinkle that
propagating -race won't work when we're cross-compiling, since
cross-compilation disables CGo by default.

For now, just skip the test in that edge case. If we want to use the
race detector on Windows in the future, we need to get a Windows CI
builder somehow.

Tested on my fork; see https://builds.sr.ht/~mvdan/job/164899.

Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
2020-03-08 10:52:08 +01:00
Daniel Martí b064899967 cmd/gogio: groundwork for Windows e2e tests on Wine
First, move from debian unstable to testing, since sway was promoted to
testing as of earlier this week.

Second, use the --sync option when using xdotool to move an X11 mouse.
This makes the command block until the mouse has finished moving to the
specified location, removing a potential race with the following
'xdotool click' command.

Third, deduplicate some logic into driverBase: tempDir to create a
temporary directory within a test, and needPrograms to skip a test if
the required programs aren't available.

Lastly, split the code that starts the X11 server into a method, so that
the future Wine e2e driver can reuse it. Since Wine is tightly coupled
with X11, we can reuse a good part of the code, including the X11 server
and the xdotool mechanisms.

We also add a TODO to perhaps improve the handling of the app's output
under each of the e2e test cases.

Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
2020-03-02 10:29:17 +01:00
Elias Naur 4b7387369b .builds: upgrade to Go 1.14 final
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2020-02-27 21:56:18 +01:00
Daniel Martí 150b34aede .builds: re-add sway on Debian
It passes now, thanks to the recent work to add retries to screenshots.

If it turns out to still not be reliable enough, we can look at this
again.

Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
2020-02-20 09:12:02 +01:00
Daniel Martí 47544697fa .builds: switch to Go 1.14rc1 release downloads
On Linux and FreeBSD, this means we no longer need to install Go twice,
since we don't need to bootstrap a Go build. This reduces the "install
go" step by over half a minute, and avoids installing a number of distro
packages.

Debian requires the pkg-config package to be explicit, as it's not part
of the build-essential metapackage, and we need it. It was being pulled
as a dependency from the golang package before.

OpenBSD is nearly the same change, modulo the fact that Go doesn't have
a binary release for it. So instead, we keep installing Go via the
system's package, and we download and build a source archive.

Finally, switch from Debian testing+experimental to simply unstable.
Sway 1.4 finally hit unstable a few days ago, and experimental is
extremely unstable, so this is a step in the right direction. Add a TODO
about going to just testing once sway 1.4 arrives there.

Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
2020-02-09 10:58:35 +01:00
Elias Naur 5f3f7b3514 .builds: make the GLFW example build on the automatic builders
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2020-02-08 00:14:20 +01:00
Elias Naur dcacca3442 .builds: don't rely on Sway being available
The Sway Debian experimental package is currently broken. Make it
optional.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2020-02-03 14:47:11 +01:00
Aaron Bieber ff6c798a28 app: Extend CI to build on OpenBSD now that golang.org/x/sys is updated.
I was able to get the Pipe2 syscall added for OpenBSD:
https://go.googlesource.com/sys/+/9fbb57f87de9ccfe3a99d4e3270ce8a926ebba4f

This also updates the dependencies to include the latest sys and gio.

I submitted a patch to the builder environment to include the xshare sets on
OpenBSD. Once that is in it will mean the "install_deps" block can be removed.

  https://lists.sr.ht/~sircmpwn/sr.ht-dev/patches/9640

Here is a link to a successful build: https://builds.sr.ht/~qbit/job/143004

Signed-off-by: Aaron Bieber <aaron@bolddaemon.com>
2020-01-28 17:21:01 +01:00
Elias Naur fb07ad6593 .builds: add missing dependency
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2020-01-24 15:00:46 +01:00
Elias Naur b4f73b3ef7 .builds: add missing xkbcommon-x11 dependency
The dependency was added when merging the X11 and Wayland keyboard
handling.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-11-28 12:09:29 +01:00
Elias Naur e16712321f .builds: use gotip on freebsd builder
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-11-08 12:45:25 +01:00
Elias Naur e683b19b29 .builds: use Go 1.14 for the basic tests
WebAssembly builds require Go 1.14 since the breaking change in Go,
golang.org/cl/203600.

gofmt -w -s . as well.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-11-06 18:35:44 +01:00
Elias Naur 4719d56f86 .builds: fix go fmt test and go fmt -w -s .
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-11-05 12:50:07 +01:00
Daniel Martí 4d7c89fec3 cmd/gogio: simplify the test -race setup
In an earlier commit, we made it possible to run the e2e tests with the
race detector enabled everywhere via GOFLAGS=-race go test.

However, that's not at all standard; most users will simply use 'go test
-race'. Moreover, having 'go test -race' run the test program with the
race detector, but not the e2e gio app, is a bit useless.

Instead, have the tests detect when they run with the race detector, and
enable the race detector in the test app too. As before, the JS test is
skipped whenever -race is used.

This also means we can test with -race in the same way in each of the
modules, which simplifies CI.

Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
2019-11-04 22:21:21 +01:00
Elias Naur 2bee95358a .builds: run the cmd tests with and without -race
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-11-03 13:06:14 +01:00
Elias Naur cc4b407647 .build,cmd: add -race to test programs
It's not possible to set GOFLAGS=-race because some programs are
built for webassembly where -race is not supported.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-11-03 12:09:02 +01:00
Elias Naur b3635c78ee .builds: add sway as dependency for Wayland end-to-end test
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-11-02 18:55:31 +01:00
Elias Naur 06aa0da2a2 .builds: add scrot to the linux image for the X11 end-to-end test
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-11-02 10:43:50 +01:00
Elias Naur 837b5f6bab .builds: install xdotool in the linux builder to satisfy the X11 test
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-11-01 22:27:42 +01:00
Elias Naur f418684c0e .builds: set GOFLAGS=-mod=readonly to catch stale go.mod files
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-11-01 18:00:28 +01:00
Elias Naur 6bbfe288aa .builds: remove go fmt test from freebsd image
There is no reason to run platform independent tests on FreeBSD.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-10-30 14:11:24 +01:00
Elias Naur 3425b25ecc app/internal: add FreeBSD support
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-10-30 14:01:02 +01:00
Elias Naur c131a7f423 .builds: remove existing $PATH from PATH settings
$PATH is not expanded anyway, and it's better to be explicit.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-10-30 11:49:44 +01:00
Elias Naur 7939f142bd .builds: remove unused path from PATH
It was left over from when the builds didn't use the distro version
of Go.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-10-30 11:41:24 +01:00
Elias Naur fe54f3df4e .builds: add xvfb package to the linux builder for X11 end-to-end test
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-10-29 20:04:47 +01:00
Elias Naur b8edf2ee04 .builds: switch from fedora/latest to debian/testing
Fedora builds kept failing at package installation. See
~sircmpwn/builds.sr.ht#220.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-10-29 17:48:12 +01:00
Elias Naur 2eb233dda6 .builds: remove -v from a tar command
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-10-29 01:45:05 +01:00
Elias Naur 9671406cdd .builds: combine curl and tar to avoid temporary files
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-10-29 01:20:38 +01:00
Elias Naur 48e0a5315d .builds: fix apple.yml again
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-10-28 22:40:45 +01:00
Elias Naur f353c8c780 .builds: fix apple.yml builder
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-10-28 22:15:45 +01:00
Elias Naur 754db8c3d7 .builds: add macOS+iOS builder
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-10-28 22:08:27 +01:00
Elias Naur 8fab2f8cb1 .builds: add automatic testing script
Add fedora.yml for testing on linux and windows.

Add android.yml for testing `gogio -target android`.

Add a build badge to the README.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-10-27 19:12:50 +01:00