From 9ca8180976d59d7e32d6669d4399ccb1987ba087 Mon Sep 17 00:00:00 2001 From: Joel Linn Date: Tue, 15 Dec 2020 19:39:30 +0100 Subject: [PATCH] Add CI file for drone.io --- .appveyor.yml | 1 + .drone.yml | 213 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 214 insertions(+) create mode 100644 .drone.yml diff --git a/.appveyor.yml b/.appveyor.yml index 4329b47e0..54ad4f01b 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -8,6 +8,7 @@ skip_tags: true skip_commits: files: + - .drone.yml - .github/** - .travis.yml - docs/** diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 000000000..b8985f502 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,213 @@ +--- +kind: pipeline +type: docker +name: lint + +# Run this in a separate pipeline so that it will build even if this fails +steps: +- name: lint + image: xeniaproject/buildenv:2021-06-21 + commands: + - ./xenia-build lint --all + +--- +kind: pipeline +type: docker +name: x86_64-linux +platform: + os: linux + arch: amd64 + +# Some expressions in this file are duplicates. Scripting support is +# available using jsonnet but increases complexity +# https://docs.drone.io/pipeline/scripting/jsonnet/ + +# These volumes will be mounted at the build directory, allowing to +# run different premake toolchains from the same source tree +volumes: +- name: build-premake + temp: {} +- name: build-cmake + temp: {} + +steps: +# +# Setup the source tree +# +- name: clone-submodules + image: xeniaproject/buildenv:2021-06-21 + commands: + - pwd + # May miss recursive submodules (but faster than xb setup) + - git submodule update --init --depth 1 -j $(nproc) + + +# +# Setup the two build systems +# + +# Native premake Makefiles for production +- name: toolchain-premake + image: xeniaproject/buildenv:2021-06-21 + volumes: + - name: build-premake + path: /drone/src/build + commands: + - $CXX --version + - $AR --version + - python3 --version + - ./xenia-build premake + depends_on: + - clone-submodules + +# Development toolchain +- name: toolchain-cmake + image: xeniaproject/buildenv:2021-06-21 + volumes: + - name: build-cmake + path: /drone/src/build + commands: + - | + ./xenia-build premake --devenv=cmake + cd build + for c in Debug Release + do + mkdir cmake-$c + cd cmake-$c + cmake -DCMAKE_BUILD_TYPE=$c .. + cd .. + done + depends_on: + # Premake itself needs to be build first: + - toolchain-premake + + +# +# Building +# + +- name: build-premake-debug-all + image: xeniaproject/buildenv:2021-06-21 + volumes: + - name: build-premake + path: /drone/src/build + commands: + - ./xenia-build build --no_premake -j$(nproc) --config=Debug + depends_on: + - toolchain-premake + +- name: build-premake-release-tests + image: xeniaproject/buildenv:2021-06-21 + volumes: + - name: build-premake + path: /drone/src/build + commands: + - ./xenia-build build --no_premake -j$(nproc) --config=Release --target=xenia-base-tests + depends_on: + - toolchain-premake + +- name: build-premake-release-all + image: xeniaproject/buildenv:2021-06-21 + volumes: + - name: build-premake + path: /drone/src/build + commands: + - ./xenia-build build --no_premake -j$(nproc) --config=Release + depends_on: + - build-premake-release-tests + +- name: build-cmake-debug-all + image: xeniaproject/buildenv:2021-06-21 + volumes: + - name: build-cmake + path: /drone/src/build + commands: + - cd build/cmake-Debug + - cmake --build . -j$(nproc) + depends_on: + - toolchain-cmake + +- name: build-cmake-release-tests + image: xeniaproject/buildenv:2021-06-21 + volumes: + - name: build-cmake + path: /drone/src/build + commands: + - cd build/cmake-Release + - cmake --build . -j$(nproc) --target xenia-base-tests + depends_on: + - toolchain-cmake + +- name: build-cmake-release-all + image: xeniaproject/buildenv:2021-06-21 + volumes: + - name: build-cmake + path: /drone/src/build + commands: + - cd build/cmake-Release + - cmake --build . -j$(nproc) + depends_on: + - build-cmake-release-tests + + +# +# Tests +# + +- name: test-premake + image: xeniaproject/buildenv:2021-06-21 + volumes: + - name: build-premake + path: /drone/src/build + commands: + - ./build/bin/Linux/Release/xenia-base-tests + depends_on: + - build-premake-release-tests + +- name: test-cmake + image: xeniaproject/buildenv:2021-06-21 + volumes: + - name: build-cmake + path: /drone/src/build + commands: + - ./build/bin/Linux/Release/xenia-base-tests + depends_on: + - build-cmake-release-tests + + +# +# Stat +# + +- name: stat + image: xeniaproject/buildenv:2021-06-21 + volumes: + - name: build-premake + path: /build-premake + - name: build-cmake + path: /build-cmake + commands: + - | + header() { + SEP='============================================================' + echo + echo $SEP + echo $@ + echo $SEP + } + + for v in premake cmake + do + for c in Debug Release + do + header $v $c + p=/build-$v/bin/Linux/$c + ls -la $p + sha256sum $p/* + done + done + depends_on: + - build-premake-debug-all + - build-premake-release-all + - build-cmake-debug-all + - build-cmake-release-all