mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 07:35:40 +00:00
74cee277ca
Signed-off-by: Elias Naur <mail@eliasnaur.com>
102 lines
3.1 KiB
YAML
102 lines
3.1 KiB
YAML
# SPDX-License-Identifier: Unlicense OR MIT
|
|
image: debian/testing
|
|
packages:
|
|
- curl
|
|
- pkg-config
|
|
- libwayland-dev
|
|
- libx11-dev
|
|
- libx11-xcb-dev
|
|
- libxkbcommon-dev
|
|
- libxkbcommon-x11-dev
|
|
- libgles2-mesa-dev
|
|
- libegl1-mesa-dev
|
|
- libffi-dev
|
|
- libxcursor-dev
|
|
- libxrandr-dev
|
|
- libxinerama-dev
|
|
- libxi-dev
|
|
- libxxf86vm-dev
|
|
- wine
|
|
- xvfb
|
|
- xdotool
|
|
- scrot
|
|
- sway
|
|
- grim
|
|
- wine
|
|
- unzip
|
|
sources:
|
|
- https://git.sr.ht/~eliasnaur/gio
|
|
environment:
|
|
GOFLAGS: -mod=readonly
|
|
PATH: /home/build/sdk/go/bin:/usr/bin:/home/build/go/bin:/home/build/android/tools/bin
|
|
ANDROID_SDK_ROOT: /home/build/android
|
|
EGL_PLATFORM: surfaceless # for headless tests
|
|
android_sdk_tools_zip: sdk-tools-linux-3859397.zip
|
|
android_ndk_zip: android-ndk-r20-linux-x86_64.zip
|
|
github_mirror: git@github.com:gioui/gio
|
|
secrets:
|
|
- 75d8a1eb-5fc5-4074-8a36-db6015d6ed5a
|
|
tasks:
|
|
- install_go1_14: |
|
|
mkdir -p /home/build/sdk
|
|
curl https://dl.google.com/go/go1.14.linux-amd64.tar.gz | tar -C /home/build/sdk -xzf -
|
|
- test_gio: |
|
|
cd gio
|
|
go test -race ./...
|
|
GOOS=windows go test -exec=wine ./...
|
|
GOOS=js GOARCH=wasm go build -o /dev/null ./...
|
|
- install_chrome: |
|
|
curl -s https://dl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
|
|
sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
|
|
sudo apt update
|
|
sudo apt install -y google-chrome-stable
|
|
- test_cmd: |
|
|
cd gio/cmd
|
|
go test ./...
|
|
go test -race ./...
|
|
cd gogio # since we need -modfile to point at the parent directory
|
|
GOFLAGS=-modfile=../go.local.mod go test
|
|
- install_jdk8: |
|
|
curl -so jdk.deb "https://cdn.azul.com/zulu/bin/zulu8.42.0.21-ca-jdk8.0.232-linux_amd64.deb"
|
|
sudo apt install -y -f ./jdk.deb
|
|
- install_android: |
|
|
mkdir android
|
|
cd android
|
|
curl -so sdk-tools.zip https://dl.google.com/android/repository/$android_sdk_tools_zip
|
|
unzip -q sdk-tools.zip
|
|
rm sdk-tools.zip
|
|
curl -so ndk.zip https://dl.google.com/android/repository/$android_ndk_zip
|
|
unzip -q ndk.zip
|
|
rm ndk.zip
|
|
mv android-ndk-* ndk-bundle
|
|
yes|sdkmanager --licenses
|
|
sdkmanager "platforms;android-29" "build-tools;29.0.2"
|
|
- test_android: |
|
|
cd gio
|
|
CC=$ANDROID_SDK_ROOT/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android29-clang GOOS=android GOARCH=arm64 CGO_ENABLED=1 go build ./...
|
|
- install_gogio: |
|
|
cd gio/cmd
|
|
go install ./gogio
|
|
- test_android_gogio: |
|
|
mkdir tmp
|
|
cd tmp
|
|
go mod init example.com
|
|
go get -d gioui.org/example/kitchen
|
|
gogio -target android gioui.org/example/kitchen
|
|
- check_gofmt: |
|
|
cd gio
|
|
test -z "$(gofmt -s -l .)"
|
|
- check_sign_off: |
|
|
set +x -e
|
|
cd gio
|
|
for hash in $(git log -n 20 --format="%H"); do
|
|
message=$(git log -1 --format=%B $hash)
|
|
if [[ ! "$message" =~ "Signed-off-by: " ]]; then
|
|
echo "Missing 'Signed-off-by' in commit $hash"
|
|
exit 1
|
|
fi
|
|
done
|
|
- mirror: |
|
|
# mirror to github
|
|
ssh-keyscan github.com > "$HOME"/.ssh/known_hosts && cd gio && git push --mirror "$github_mirror" || echo "failed mirroring"
|