From c5dcd70e38e9acf8593201a093344a347fa3d817 Mon Sep 17 00:00:00 2001 From: Cameron Cawley Date: Fri, 24 Aug 2018 15:20:31 +0100 Subject: [PATCH] travis: Use Docker for clang-format target --- .travis.yml | 12 ++++-------- .travis/clang-format/build.sh | 3 +++ .travis/clang-format/deps.sh | 3 +++ .travis/clang-format/docker.sh | 5 +++++ .travis/common/travis-ci.env | 2 ++ 5 files changed, 17 insertions(+), 8 deletions(-) create mode 100755 .travis/clang-format/build.sh create mode 100755 .travis/clang-format/deps.sh create mode 100755 .travis/clang-format/docker.sh diff --git a/.travis.yml b/.travis.yml index 54b7a9091..a8f637e33 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,15 +3,11 @@ matrix: include: - os: linux env: NAME="clang-format" + sudo: required dist: trusty - addons: - apt: - sources: - - llvm-toolchain-trusty-6.0 - - ubuntu-toolchain-r-test - packages: - - clang-format-6.0 - script: "./.travis/clang-format/script.sh" + services: docker + install: "./.travis/clang-format/deps.sh" + script: "./.travis/clang-format/build.sh" - os: linux env: NAME="linux build" sudo: required diff --git a/.travis/clang-format/build.sh b/.travis/clang-format/build.sh new file mode 100755 index 000000000..2ab6c2f0a --- /dev/null +++ b/.travis/clang-format/build.sh @@ -0,0 +1,3 @@ +#!/bin/bash -ex +mkdir -p "$HOME/.ccache" +docker run --env-file .travis/common/travis-ci.env -v $(pwd):/citra -v "$HOME/.ccache":/root/.ccache citraemu/build-environments:linux-clang-format /bin/bash -ex /citra/.travis/clang-format/docker.sh diff --git a/.travis/clang-format/deps.sh b/.travis/clang-format/deps.sh new file mode 100755 index 000000000..a15d164c7 --- /dev/null +++ b/.travis/clang-format/deps.sh @@ -0,0 +1,3 @@ +#!/bin/sh -ex + +docker pull citraemu/build-environments:linux-clang-format diff --git a/.travis/clang-format/docker.sh b/.travis/clang-format/docker.sh new file mode 100755 index 000000000..6f3eab363 --- /dev/null +++ b/.travis/clang-format/docker.sh @@ -0,0 +1,5 @@ +#!/bin/bash -ex + +# Run clang-format +cd /citra +./.travis/clang-format/script.sh diff --git a/.travis/common/travis-ci.env b/.travis/common/travis-ci.env index 5fa27a706..a2c6dbefd 100644 --- a/.travis/common/travis-ci.env +++ b/.travis/common/travis-ci.env @@ -6,6 +6,8 @@ TRAVIS_BRANCH TRAVIS_BUILD_ID TRAVIS_BUILD_NUMBER TRAVIS_COMMIT +TRAVIS_COMMIT_RANGE +TRAVIS_EVENT_TYPE TRAVIS_JOB_ID TRAVIS_JOB_NUMBER TRAVIS_REPO_SLUG