From bbc5b5d62dfd66e623494bfc67fc469eae6551c6 Mon Sep 17 00:00:00 2001 From: Zach Hilman Date: Sat, 13 Jul 2019 21:34:40 -0400 Subject: Finalize Azure Pipelines Definitions d --- .ci/scripts/.gitkeep | 0 .ci/scripts/common/post-upload.sh | 15 ++++ .ci/scripts/common/pre-upload.sh | 6 ++ .ci/scripts/format/docker.sh | 6 ++ .ci/scripts/format/exec.sh | 4 ++ .ci/scripts/format/script.sh | 37 ++++++++++ .ci/scripts/linux/docker.sh | 14 ++++ .ci/scripts/linux/exec.sh | 5 ++ .ci/scripts/linux/upload.sh | 14 ++++ .ci/scripts/merge/apply-patches-by-label.py | 28 ++++++++ .ci/scripts/merge/check-label-presence.py | 18 +++++ .ci/scripts/merge/yuzubot-git-config.sh | 2 + .ci/scripts/windows/docker.sh | 50 +++++++++++++ .ci/scripts/windows/exec.sh | 5 ++ .ci/scripts/windows/scan_dll.py | 106 ++++++++++++++++++++++++++++ .ci/scripts/windows/upload.sh | 13 ++++ .ci/templates/build-single.yml | 21 ++++++ .ci/templates/build-standard.yml | 22 ++++++ .ci/templates/build-testing.yml | 30 ++++++++ .ci/templates/format-check.yml | 14 ++++ .ci/templates/merge.yml | 46 ++++++++++++ .ci/templates/mergebot.yml | 15 ++++ .ci/templates/release.yml | 29 ++++++++ .ci/templates/retrieve-artifact-source.yml | 16 +++++ .ci/templates/retrieve-master-source.yml | 11 +++ .ci/templates/sync-source.yml | 7 ++ .ci/yuzu-mainline.yml | 36 +++++----- .ci/yuzu-verify.yml | 18 +++++ .ci/yuzu.yml | 19 ----- 29 files changed, 572 insertions(+), 35 deletions(-) delete mode 100644 .ci/scripts/.gitkeep create mode 100644 .ci/scripts/common/post-upload.sh create mode 100644 .ci/scripts/common/pre-upload.sh create mode 100644 .ci/scripts/format/docker.sh create mode 100644 .ci/scripts/format/exec.sh create mode 100644 .ci/scripts/format/script.sh create mode 100644 .ci/scripts/linux/docker.sh create mode 100644 .ci/scripts/linux/exec.sh create mode 100644 .ci/scripts/linux/upload.sh create mode 100644 .ci/scripts/merge/apply-patches-by-label.py create mode 100644 .ci/scripts/merge/check-label-presence.py create mode 100644 .ci/scripts/merge/yuzubot-git-config.sh create mode 100644 .ci/scripts/windows/docker.sh create mode 100644 .ci/scripts/windows/exec.sh create mode 100644 .ci/scripts/windows/scan_dll.py create mode 100644 .ci/scripts/windows/upload.sh create mode 100644 .ci/templates/build-single.yml create mode 100644 .ci/templates/build-standard.yml create mode 100644 .ci/templates/build-testing.yml create mode 100644 .ci/templates/format-check.yml create mode 100644 .ci/templates/merge.yml create mode 100644 .ci/templates/mergebot.yml create mode 100644 .ci/templates/release.yml create mode 100644 .ci/templates/retrieve-artifact-source.yml create mode 100644 .ci/templates/retrieve-master-source.yml create mode 100644 .ci/templates/sync-source.yml create mode 100644 .ci/yuzu-verify.yml delete mode 100644 .ci/yuzu.yml diff --git a/.ci/scripts/.gitkeep b/.ci/scripts/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/.ci/scripts/common/post-upload.sh b/.ci/scripts/common/post-upload.sh new file mode 100644 index 000000000..bb4e9d328 --- /dev/null +++ b/.ci/scripts/common/post-upload.sh @@ -0,0 +1,15 @@ +#!/bin/bash -ex + +# Copy documentation +cp license.txt "$REV_NAME" +cp README.md "$REV_NAME" + +tar $COMPRESSION_FLAGS "$ARCHIVE_NAME" "$REV_NAME" + +mv "$REV_NAME" $RELEASE_NAME + +7z a "$REV_NAME.7z" $RELEASE_NAME + +# move the compiled archive into the artifacts directory to be uploaded by travis releases +mv "$ARCHIVE_NAME" artifacts/ +mv "$REV_NAME.7z" artifacts/ diff --git a/.ci/scripts/common/pre-upload.sh b/.ci/scripts/common/pre-upload.sh new file mode 100644 index 000000000..3c2fc79a2 --- /dev/null +++ b/.ci/scripts/common/pre-upload.sh @@ -0,0 +1,6 @@ +#!/bin/bash -ex + +GITDATE="`git show -s --date=short --format='%ad' | sed 's/-//g'`" +GITREV="`git show -s --format='%h'`" + +mkdir -p artifacts diff --git a/.ci/scripts/format/docker.sh b/.ci/scripts/format/docker.sh new file mode 100644 index 000000000..778411e4a --- /dev/null +++ b/.ci/scripts/format/docker.sh @@ -0,0 +1,6 @@ +#!/bin/bash -ex + +# Run clang-format +cd /yuzu +chmod a+x ./.ci/scripts/format/script.sh +./.ci/scripts/format/script.sh diff --git a/.ci/scripts/format/exec.sh b/.ci/scripts/format/exec.sh new file mode 100644 index 000000000..5d6393b38 --- /dev/null +++ b/.ci/scripts/format/exec.sh @@ -0,0 +1,4 @@ +#!/bin/bash -ex + +chmod a+x ./.ci/scripts/format/docker.sh +docker run -v $(pwd):/yuzu yuzuemu/build-environments:linux-clang-format /bin/bash -ex /yuzu/.ci/scripts/format/docker.sh diff --git a/.ci/scripts/format/script.sh b/.ci/scripts/format/script.sh new file mode 100644 index 000000000..5ab828d5e --- /dev/null +++ b/.ci/scripts/format/script.sh @@ -0,0 +1,37 @@ +#!/bin/bash -ex + +if grep -nrI '\s$' src *.yml *.txt *.md Doxyfile .gitignore .gitmodules .ci* dist/*.desktop \ + dist/*.svg dist/*.xml; then + echo Trailing whitespace found, aborting + exit 1 +fi + +# Default clang-format points to default 3.5 version one +CLANG_FORMAT=clang-format-6.0 +$CLANG_FORMAT --version + +if [ "$TRAVIS_EVENT_TYPE" = "pull_request" ]; then + # Get list of every file modified in this pull request + files_to_lint="$(git diff --name-only --diff-filter=ACMRTUXB $TRAVIS_COMMIT_RANGE | grep '^src/[^.]*[.]\(cpp\|h\)$' || true)" +else + # Check everything for branch pushes + files_to_lint="$(find src/ -name '*.cpp' -or -name '*.h')" +fi + +# Turn off tracing for this because it's too verbose +set +x + +for f in $files_to_lint; do + d=$(diff -u "$f" <($CLANG_FORMAT "$f") || true) + if ! [ -z "$d" ]; then + echo "!!! $f not compliant to coding style, here is the fix:" + echo "$d" + fail=1 + fi +done + +set -x + +if [ "$fail" = 1 ]; then + exit 1 +fi diff --git a/.ci/scripts/linux/docker.sh b/.ci/scripts/linux/docker.sh new file mode 100644 index 000000000..f538a4081 --- /dev/null +++ b/.ci/scripts/linux/docker.sh @@ -0,0 +1,14 @@ +#!/bin/bash -ex + +cd /yuzu + +ccache -s + +mkdir build || true && cd build +cmake .. -G Ninja -DYUZU_USE_BUNDLED_UNICORN=ON -DYUZU_USE_QT_WEB_ENGINE=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=/usr/lib/ccache/gcc -DCMAKE_CXX_COMPILER=/usr/lib/ccache/g++ -DYUZU_ENABLE_COMPATIBILITY_REPORTING=${ENABLE_COMPATIBILITY_REPORTING:-"OFF"} -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON -DUSE_DISCORD_PRESENCE=ON + +ninja + +ccache -s + +ctest -VV -C Release diff --git a/.ci/scripts/linux/exec.sh b/.ci/scripts/linux/exec.sh new file mode 100644 index 000000000..a5a6c34b9 --- /dev/null +++ b/.ci/scripts/linux/exec.sh @@ -0,0 +1,5 @@ +#!/bin/bash -ex + +mkdir -p "ccache" || true +chmod a+x ./.ci/scripts/linux/docker.sh +docker run -e ENABLE_COMPATIBILITY_REPORTING -e CCACHE_DIR=/yuzu/ccache -v $(pwd):/yuzu yuzuemu/build-environments:linux-fresh /bin/bash /yuzu/.ci/scripts/linux/docker.sh diff --git a/.ci/scripts/linux/upload.sh b/.ci/scripts/linux/upload.sh new file mode 100644 index 000000000..0d131d1dd --- /dev/null +++ b/.ci/scripts/linux/upload.sh @@ -0,0 +1,14 @@ +#!/bin/bash -ex + +. .ci/scripts/common/pre-upload.sh + +REV_NAME="yuzu-linux-${GITDATE}-${GITREV}" +ARCHIVE_NAME="${REV_NAME}.tar.xz" +COMPRESSION_FLAGS="-cJvf" + +mkdir "$REV_NAME" + +cp build/bin/yuzu-cmd "$REV_NAME" +cp build/bin/yuzu "$REV_NAME" + +. .ci/scripts/common/post-upload.sh diff --git a/.ci/scripts/merge/apply-patches-by-label.py b/.ci/scripts/merge/apply-patches-by-label.py new file mode 100644 index 000000000..b346001a5 --- /dev/null +++ b/.ci/scripts/merge/apply-patches-by-label.py @@ -0,0 +1,28 @@ +# Download all pull requests as patches that match a specific label +# Usage: python download-patches-by-label.py