diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 000000000..8d6245ed4
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,118 @@
+# SPDX-License-Identifier: GPL-3.0+
+# Originally Copyright Roger Meier <r.meier@siemens.com>
+# Adapted for grub by Alexander Graf <agraf@suse.de>
+
+# build grub on Travis CI - https://travis-ci.org/
+
+dist: xenial
+
+language: c
+
+addons:
+  apt:
+    packages:
+    - cppcheck
+    - sloccount
+    - sparse
+    - bc
+    - build-essential
+    - libsdl1.2-dev
+    - python
+    - python-virtualenv
+    - swig
+    - libpython-dev
+    - iasl
+    - rpm2cpio
+    - wget
+    - device-tree-compiler
+    - lzop
+    - liblz4-tool
+    - libisl15
+    - qemu-system
+    - ovmf
+    - unifont
+
+env:
+  global:
+    - PATH=/tmp/qemu-install/bin:/tmp/grub/bin:/usr/bin:/bin:/tmp/cross/gcc-8.1.0-nolibc/aarch64-linux/bin:/tmp/cross/gcc-8.1.0-nolibc/arm-linux-gnueabi/bin:/tmp/cross/gcc-8.1.0-nolibc/ia64-linux/bin:/tmp/cross/gcc-8.1.0-nolibc/mips64-linux/bin:/tmp/cross/gcc-8.1.0-nolibc/powerpc64-linux/bin:/tmp/cross/gcc-8.1.0-nolibc/riscv32-linux/bin:/tmp/cross/gcc-8.1.0-nolibc/riscv64-linux/bin:/tmp/cross/gcc-8.1.0-nolibc/sparc64-linux/bin
+
+before_script:
+  # install necessary toolchains based on $CROSS_TARGETS variable
+  - mkdir /tmp/cross
+  # results in binaries like /tmp/cross/gcc-8.1.0-nolibc/ia64-linux/bin/ia64-linux-gcc
+  - for i in $CROSS_TARGETS; do
+        ( cd /tmp/cross; wget -O - https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/x86_64/8.1.0/x86_64-gcc-8.1.0-nolibc-$i.tar.xz | xzcat | tar x );
+    done
+
+script:
+  # Comments must be outside the command strings below, or the Travis parser
+  # will get confused.
+  - ./autogen.sh
+
+  # Build all selected grub targets:
+  - for target in $GRUB_TARGETS; do
+      plat=${target#*-};
+      arch=${target%-*};
+      [ "$arch" = "arm64" ] && arch=aarch64-linux;
+      [ "$arch" = "arm" ] && arch=arm-linux-gnueabi;
+      [ "$arch" = "ia64" ] && arch=ia64-linux;
+      [ "$arch" = "mipsel" ] && arch=mips64-linux;
+      [ "$arch" = "powerpc" ] && arch=powerpc64-linux;
+      [ "$arch" = "riscv32" ] && arch=riscv32-linux;
+      [ "$arch" = "riscv64" ] && arch=riscv64-linux;
+      [ "$arch" = "sparc64" ] && arch=sparc64-linux;
+      echo "Building $target";
+      mkdir obj-$target;
+      ( cd obj-$target && ../configure --target=$arch --with-platform=$plat --prefix=/tmp/grub && make -j4 && make -j4 install ) &> log || ( cat log; false );
+    done
+
+  # Our test canary
+  - echo -e "insmod echo\\ninsmod reboot\\necho hello world\\nreboot" > grub.cfg
+
+  # Assemble images and possibly run them
+  - for target in $GRUB_TARGETS; do grub-mkimage -c grub.cfg -p / -O $target -o grub-$target echo reboot normal; done
+
+  # Run images we know how to run
+  - if [[ "$GRUB_TARGETS" == *"x86_64-efi"* ]]; then qemu-system-x86_64 -bios /usr/share/ovmf/OVMF.fd -m 512 -no-reboot -nographic -net nic -net user,tftp=.,bootfile=grub-x86_64-efi | tee grub.log && grep "hello world" grub.log; fi
+
+matrix:
+  include:
+  # each env setting here is a dedicated build
+    - name: "x86_64"
+      env:
+        - GRUB_TARGETS="x86_64-efi x86_64-xen"
+    - name: "i386"
+      env:
+        - GRUB_TARGETS="i386-efi i386-xen i386-xen_pvh i386-pc i386-multiboot i386-coreboot i386-ieee1275 i386-qemu"
+    - name: "powerpc"
+      env:
+        - GRUB_TARGETS="powerpc-ieee1275"
+        - CROSS_TARGETS=powerpc64-linux"
+    - name: "sparc64"
+      env:
+        - GRUB_TARGETS="sparc64-ieee1275"
+        - CROSS_TARGETS=sparc64-linux"
+    - name: "ia64"
+      env:
+        - GRUB_TARGETS="ia64-efi"
+        - CROSS_TARGETS=ia64-linux"
+    - name: "mips"
+      env:
+        - GRUB_TARGETS="mips-qemu_mips mips-arc mipsel-arc mipsel-qemu_mips"
+        - CROSS_TARGETS=mips64-linux"
+    - name: "arm"
+      env:
+        - GRUB_TARGETS="arm-uboot arm-coreboot arm-efi"
+        - CROSS_TARGETS="arm-linux-gnueabi"
+    - name: "arm64"
+      env:
+        - GRUB_TARGETS="arm64-efi"
+        - CROSS_TARGETS=aarch64-linux"
+    - name: "riscv32"
+      env:
+        - GRUB_TARGETS="riscv32-efi"
+        - CROSS_TARGETS=riscv32-linux"
+    - name: "riscv64"
+      env:
+        - GRUB_TARGETS="riscv64-efi"
+        - CROSS_TARGETS=riscv64-linux"
