github.com/cybriq/giocore@v0.0.7-0.20210703034601-cfb9cb5f3900/.builds/linux.yml (about)

     1  # SPDX-License-Identifier: Unlicense OR MIT
     2  image: debian/testing
     3  packages:
     4   - curl
     5   - pkg-config
     6   - libwayland-dev
     7   - libx11-dev
     8   - libx11-xcb-dev
     9   - libxkbcommon-dev
    10   - libxkbcommon-x11-dev
    11   - libgles2-mesa-dev
    12   - libegl1-mesa-dev
    13   - libffi-dev
    14   - libxcursor-dev
    15   - libxrandr-dev
    16   - libxinerama-dev
    17   - libxi-dev
    18   - libxxf86vm-dev
    19   - wine
    20   - xvfb
    21   - xdotool
    22   - scrot
    23   - sway
    24   - grim
    25   - wine
    26   - unzip
    27  sources:
    28   - https://git.sr.ht/~eliasnaur/gio
    29  environment:
    30   GOFLAGS: -mod=readonly
    31   PATH: /home/build/sdk/go/bin:/usr/bin:/home/build/go/bin:/home/build/android/tools/bin
    32   ANDROID_SDK_ROOT: /home/build/android
    33   android_sdk_tools_zip: sdk-tools-linux-3859397.zip
    34   android_ndk_zip: android-ndk-r20-linux-x86_64.zip
    35   github_mirror: git@github.com:gioui/gio
    36  secrets:
    37   - 75d8a1eb-5fc5-4074-8a36-db6015d6ed5a
    38  tasks:
    39   - install_go1_14: |
    40       mkdir -p /home/build/sdk
    41       curl -s https://dl.google.com/go/go1.14.linux-amd64.tar.gz | tar -C /home/build/sdk -xzf -
    42   - test_gio: |
    43       cd gio
    44       export EGL_PLATFORM=surfaceless # for headless tests
    45       go test -race ./...
    46       GOOS=windows go test -exec=wine ./...
    47       GOOS=js GOARCH=wasm go build -o /dev/null ./...
    48   - install_chrome: |
    49       curl -s https://dl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
    50       sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
    51       sudo apt-get -qq update
    52       sudo apt-get -qq install -y google-chrome-stable
    53   - test_cmd: |
    54       cd gio/cmd
    55       go test ./...
    56       go test -race ./...
    57       cd gogio # since we need -modfile to point at the parent directory
    58       GOFLAGS=-modfile=../go.local.mod go test
    59   - install_jdk8: |
    60       curl -so jdk.deb "https://cdn.azul.com/zulu/bin/zulu8.42.0.21-ca-jdk8.0.232-linux_amd64.deb"
    61       sudo apt-get -qq install -y -f ./jdk.deb
    62   - install_android: |
    63       mkdir android
    64       cd android
    65       curl -so sdk-tools.zip https://dl.google.com/android/repository/$android_sdk_tools_zip
    66       unzip -q sdk-tools.zip
    67       rm sdk-tools.zip
    68       curl -so ndk.zip https://dl.google.com/android/repository/$android_ndk_zip
    69       unzip -q ndk.zip
    70       rm ndk.zip
    71       mv android-ndk-* ndk-bundle
    72       yes|sdkmanager --licenses
    73       sdkmanager "platforms;android-30" "build-tools;29.0.2"
    74   - test_android: |
    75       cd gio
    76       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 ./...
    77   - install_gogio: |
    78       cd gio/cmd
    79       go install ./gogio
    80   - test_android_gogio: |
    81       mkdir tmp
    82       cd tmp
    83       go mod init example.com
    84       go get -d github.com/cybriq/giocore/example/kitchen
    85       gogio -target android github.com/cybriq/giocore/example/kitchen
    86   - check_gofmt: |
    87       cd gio
    88       test -z "$(gofmt -s -l .)"
    89   - check_sign_off: |
    90       set +x -e
    91       cd gio
    92       for hash in $(git log -n 20 --format="%H"); do
    93          message=$(git log -1 --format=%B $hash)
    94          if [[ ! "$message" =~ "Signed-off-by: " ]]; then
    95              echo "Missing 'Signed-off-by' in commit $hash"
    96              exit 1
    97          fi
    98       done
    99   - mirror: |
   100       # mirror to github
   101       ssh-keyscan github.com > "$HOME"/.ssh/known_hosts && cd gio && git push --mirror "$github_mirror" || echo "failed mirroring"