From 13afbeebd233dd50c7be563bf187122ae087fbf3 Mon Sep 17 00:00:00 2001 From: ruki Date: Wed, 13 Mar 2019 00:41:23 +0800 Subject: [PATCH] add travis ci --- .travis.yml | 18 ++++++++++++++++++ scripts/test.lua | 23 +++++++++++++++++++++++ xmake.lua | 1 + 3 files changed, 42 insertions(+) create mode 100644 .travis.yml create mode 100644 scripts/test.lua diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..db30e8fb1 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,18 @@ +sudo: false +language: C +os: + - linux + - osx +compiler: + - gcc + - clang + +install: + - git clone --branch=repo https://github.com/xmake-io/xmake.git tboox/xmake --depth 1 + - cd ./tboox/xmake + - ./scripts/get.sh __local__ + - cd - + +script: + - xmake l ./scripts/test.lua + diff --git a/scripts/test.lua b/scripts/test.lua new file mode 100644 index 000000000..658c87902 --- /dev/null +++ b/scripts/test.lua @@ -0,0 +1,23 @@ +function main(...) + local packages = {...} + if #packages == 0 then + local files = os.iorun("git diff --name-only HEAD^") + for _, file in ipairs(files:split('\n'), string.trim) do + if file:find("packages", 1, true) and path.filename(file) == "xmake.lua" then + local package = path.filename(path.directory(file)) + table.insert(packages, package) + end + end + table.insert(packages, "tbox") + end + if #packages > 0 then + local workdir = path.join(os.tmpdir(), "xmake-repo") + print(packages) + os.tryrm(workdir) + os.mkdir(workdir) + os.cd(workdir) + os.exec("xmake create test") + os.cd("test") + os.exec("xmake require -f -v -y %s", table.concat(packages, " ")) + end +end diff --git a/xmake.lua b/xmake.lua index e50ef6e13..fe7867305 100644 --- a/xmake.lua +++ b/xmake.lua @@ -4,3 +4,4 @@ set_xmakever("2.2.3") -- set repository description set_description("The official package repository of xmake") +