From 2f9d050b6dc813bbebc53d1c03424b4a2278cec0 Mon Sep 17 00:00:00 2001 From: Matthias Klumpp Date: Mon, 18 Jan 2021 21:41:22 +0100 Subject: [PATCH] ci: Switch to GitHub Actions With Tilix' low maintenance, having good CI, especially for the widely used Meson buildsystem, is very important to merge PRs with more confidence. GitHub provides computing power for that, and it's easy to use modern Ubuntu and containers on their platform. --- .github/ci/Dockerfile-debian-testing | 14 +++++ .github/ci/install-deps-deb.sh | 31 +++++++++++ .github/ci/run-build.sh | 33 ++++++++++++ .github/ci/run-tests.sh | 19 +++++++ .github/workflows/build-test.yml | 79 ++++++++++++++++++++++++++++ .travis.yml | 6 --- README.md | 2 +- 7 files changed, 177 insertions(+), 7 deletions(-) create mode 100644 .github/ci/Dockerfile-debian-testing create mode 100755 .github/ci/install-deps-deb.sh create mode 100755 .github/ci/run-build.sh create mode 100755 .github/ci/run-tests.sh create mode 100644 .github/workflows/build-test.yml delete mode 100644 .travis.yml diff --git a/.github/ci/Dockerfile-debian-testing b/.github/ci/Dockerfile-debian-testing new file mode 100644 index 00000000..9088339c --- /dev/null +++ b/.github/ci/Dockerfile-debian-testing @@ -0,0 +1,14 @@ +# +# Docker file for Tilix CI tests on Debian Testing +# +FROM debian:testing + +# prepare +RUN mkdir -p /build/ci/ + +# install build dependencies +COPY install-deps-deb.sh /build/ci/ +RUN chmod +x /build/ci/install-deps-deb.sh && /build/ci/install-deps-deb.sh + +# finish +WORKDIR /build diff --git a/.github/ci/install-deps-deb.sh b/.github/ci/install-deps-deb.sh new file mode 100755 index 00000000..0a55aa67 --- /dev/null +++ b/.github/ci/install-deps-deb.sh @@ -0,0 +1,31 @@ +#!/bin/sh +# +# Install Tilix build dependencies +# +set -e +set -x + +export DEBIAN_FRONTEND=noninteractive + +# update caches +apt-get update -qq + +# install build essentials +apt-get install -yq \ + eatmydata \ + build-essential + +# install build dependencies +eatmydata apt-get install -yq \ + meson \ + ninja-build \ + appstream \ + desktop-file-utils \ + dh-dlang \ + ldc \ + libgtkd-3-dev \ + librsvg2-dev \ + libsecret-1-dev \ + libunwind-dev \ + libvted-3-dev \ + po4a diff --git a/.github/ci/run-build.sh b/.github/ci/run-build.sh new file mode 100755 index 00000000..bddc638d --- /dev/null +++ b/.github/ci/run-build.sh @@ -0,0 +1,33 @@ +#!/bin/sh +set -e + +# This script is supposed to run inside the Tilix Docker container +# on the CI system. + +# +# Read options for the current test build +# + +build_type=debugoptimized +build_dir="cibuild" + +export DC=ldc2 +echo "D compiler: $DC" +set -x +$DC --version + +# +# Configure build with all flags enabled +# + +mkdir $build_dir && cd $build_dir +meson --buildtype=$build_type \ + .. + +# +# Build & Install +# + +ninja +DESTDIR=/tmp/install_root/ ninja install +rm -r /tmp/install_root/ diff --git a/.github/ci/run-tests.sh b/.github/ci/run-tests.sh new file mode 100755 index 00000000..265438a0 --- /dev/null +++ b/.github/ci/run-tests.sh @@ -0,0 +1,19 @@ +#!/bin/sh +set -e + +# This script is supposed to run inside the Tilix Docker container +# on the CI system. + +# +# Read options for the current test run +# + +export DC=ldc2 +build_dir="cibuild" + +# +# Run tests +# + +cd $build_dir +meson test --print-errorlogs diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml new file mode 100644 index 00000000..fe55ddc9 --- /dev/null +++ b/.github/workflows/build-test.yml @@ -0,0 +1,79 @@ +name: Build Test + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + + build-dub-ubuntu: + name: Dub + runs-on: ubuntu-20.04 + strategy: + matrix: + dc: [dmd-latest, ldc-latest] + steps: + - uses: actions/checkout@v2 + + - name: Install System Dependencies + run: | + sudo apt-get install -yq \ + dh-dlang \ + libatk1.0-dev \ + libcairo2-dev \ + libglib2.0-dev \ + libgtk-3-dev \ + libpango1.0-dev \ + librsvg2-dev \ + libsecret-1-dev \ + libunwind-dev \ + libgtksourceview-3.0-dev \ + libpeas-dev \ + libvte-2.91-dev + + - name: Install D compiler + uses: dlang-community/setup-dlang@v1 + with: + compiler: ${{ matrix.dc }} + + - name: Build + run: dub build --compiler=$DC + + - name: Test + run: dub test --compiler=$DC + + + build-debian-testing: + name: Debian Testing + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Create Build Environment + run: cd .github/ci/ && docker build -t tilix -f ./Dockerfile-debian-testing . + + - name: Build + run: docker run -t -e COMPILER_VENDOR=$CVENDOR -e CC=gcc -e CXX=g++ -v `pwd`:/build tilix + ./.github/ci/run-build.sh + + - name: Test + run: docker run -t -e COMPILER_VENDOR=$CVENDOR -e CC=gcc -e CXX=g++ -v `pwd`:/build tilix + ./.github/ci/run-tests.sh + + + build-ubuntu: + name: Ubuntu LTS + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + + - name: Create Build Environment + run: sudo ./.github/ci/install-deps-deb.sh + + - name: Build + run: CC=gcc CXX=g++ ./.github/ci/run-build.sh + + - name: Test + run: CC=gcc CXX=g++ ./.github/ci/run-tests.sh diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 6dea185d..00000000 --- a/.travis.yml +++ /dev/null @@ -1,6 +0,0 @@ -language: d -d: - - dmd - - ldc -script: - - dub build \ No newline at end of file diff --git a/README.md b/README.md index 995a3f03..a53ce118 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Build Status](https://travis-ci.org/gnunn1/tilix.svg?branch=master)](https://travis-ci.org/gnunn1/tilix) +![Build Status](https://github.com/gnunn1/tilix/workflows/Build%20Test/badge.svg) [![Translation status](https://hosted.weblate.org/widgets/tilix/-/svg-badge.svg)](https://hosted.weblate.org/engage/tilix/?utm_source=widget) # Tilix A tiling terminal emulator for Linux using GTK+ 3. The Tilix web site for users is available at [https://gnunn1.github.io/tilix-web](https://gnunn1.github.io/tilix-web).