forked from bjornbytes/RxLua
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
159 lines (149 loc) · 5.41 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
language: python
dist: trusty
# Using cache to pass artifacts between stages
# See: https://github.com/travis-ci/docs-travis-ci-com/issues/1329
cache:
directories:
- ~/cache
stages:
- test
- name: "Build portable releases"
if: tag IS present
- name: "Test portable releases"
if: tag IS present
- name: release
if: tag IS present
env:
global:
- LUA_REACTIVEX_VERSION=$(echo -n ${TRAVIS_TAG} | sed 's/[^0-9.]//gi')
- CACHE_NAME=$TRAVIS_BUILD_ID
matrix:
- LUA="lua 5.1"
- LUA="lua 5.2"
- LUA="lua 5.3"
- LUA="luajit 2.0"
- LUA="luajit 2.1"
before_install:
- pip install hererocks
- hererocks .hererocks -r^ --$LUA
- source .hererocks/bin/activate
install:
- luarocks make
- luarocks install luacov-coveralls
- luarocks show reactivex
- luarocks show luacov-coveralls
before_script:
- echo $CACHE_NAME
- echo $TRAVIS_BUILD_ID
- echo $TRAVIS_TAG
- echo $LUA_REACTIVEX_VERSION
script:
- lua -v
- lua tests/runner.lua --with-coverage
after_success:
- luacov-coveralls
jobs:
include:
- stage: "Build portable releases"
env:
before_install:
- pip install hererocks
- hererocks .hererocks -r^ --lua 5.1
- source .hererocks/bin/activate
install:
- luarocks make
- luarocks show reactivex
- rm -rf ~/cache/*
- echo $TRAVIS_BUILD_ID > ~/cache/travis_build_id
- lua -v
- lua tools/build.lua
- cp README.md LICENSE .tmp/lua-reactivex-portable
- cp README.md LICENSE .tmp/lua-reactivex-portable-luvit
- cd .tmp/lua-reactivex-portable
- zip ~/cache/lua-reactivex-portable.zip *
- cd ../lua-reactivex-portable-luvit
- zip ~/cache/lua-reactivex-portable-luvit.zip *
script:
- ls ~/cache
- echo $CACHE_NAME
# Since there are custom stages, the build matrix defined above for the
# test stage doesn't apply here anymore. Using YAML aliases to define
# test jobs here for all Lua versions without config duplication.
# See: https://docs.travis-ci.com/user/build-stages/using-yaml-aliases/
#
# Also... can't use `env:` here to specify Lua version, before_install
# must be repated. This is because Travis cache is not shared between
# jobs with different env set.
- &test-portable-releases
stage: "Test portable releases"
env:
before_install:
- pip install hererocks
- hererocks .hererocks -r^ --lua 5.1
- source .hererocks/bin/activate
install:
- if test "$TRAVIS_BUILD_ID" != $(cat ~/cache/travis_build_id); then travis_terminate 1; fi
- lua -v
- mkdir .tmp
- cd .tmp
- mkdir test-portable test-portable-luvit
- cp -r ../tests test-portable
- cp -r ../tests test-portable-luvit
- cp ~/cache/lua-reactivex-portable.zip test-portable
- cp ~/cache/lua-reactivex-portable-luvit.zip test-portable-luvit
- ls -la test-portable
- ls -la test-portable-luvit
- cd test-portable
- unzip lua-reactivex-portable.zip
# `require()` first to populate `package.preload` caches
- echo 'require("reactivex"); dofile("tests/runner.lua")' | lua -
- cd ../test-portable-luvit
- unzip lua-reactivex-portable-luvit.zip
# same trick with `require()` caches + emulate luvit environment with global `exports` table
- echo 'exports = {}; require("reactivex"); dofile("tests/runner.lua")' | lua -
script:
- true
- <<: *test-portable-releases
before_install:
- pip install hererocks
- hererocks .hererocks -r^ --lua 5.2
- source .hererocks/bin/activate
- <<: *test-portable-releases
before_install:
- pip install hererocks
- hererocks .hererocks -r^ --lua 5.3
- source .hererocks/bin/activate
- <<: *test-portable-releases
before_install:
- pip install hererocks
- hererocks .hererocks -r^ --luajit 2.0
- source .hererocks/bin/activate
- <<: *test-portable-releases
before_install:
- pip install hererocks
- hererocks .hererocks -r^ --luajit 2.1
- source .hererocks/bin/activate
- stage: release
env:
before_install:
- true
install:
- if test "$TRAVIS_BUILD_ID" != $(cat ~/cache/travis_build_id); then travis_terminate 1; fi
- cp ~/cache/lua-reactivex-portable.zip lua-reactivex-portable-v${LUA_REACTIVEX_VERSION}.zip
- cp ~/cache/lua-reactivex-portable-luvit.zip lua-reactivex-portable-luvit-v${LUA_REACTIVEX_VERSION}.zip
- mv ~/cache ~/cache-discard # clear the cache
- mkdir ~/cache # clear the cache
before_script:
- true
script:
- true
deploy: &releases
provider: releases
api_key:
secure: Jz+b7md6hJjz2zPcyQKkJwHR9WhrADDxrUQMZdYbvIM7Y5WlWkgmWBGYt3fPvye4klNeyRs0IciFd0eDknkWMB/Yi6iHuazEpHZTL8yk/iikbZT/O+rvYW/AXCpXMN/p2xFllFmhAUijNUTmAhYsqbGUZR07HifHrd4Eed4IbgNXgh584nA1LAwsJ+qhi8hq/GsyK60+sM43qgPVRmnqz/VCKDREaZ+J6t+z/DULg6yX3U1etS/uLfAiKKVwAI11pBswbxl8aN0hJAPDlH+ytIwyYWM6nBUKKMFO8LkXDUYVnkq/7evTwEiCMxaqdLneKLoCDcMaDQR2Fb/addBtFps/zljW3/+taaGpdJ3tNRh0Yq0RMV1Xckw9yAtAJtbSmC/xq8KF8zHAJovAGAchZF9X7kxOm4B0oaDaSU5DmTpsgqihTuIfrueB/qJ/vo2Hdc0amTuox/V7+K9qO/9HVTSeyCC3VECeCXlnJ/wPaLHyc5DyVOHULaGW5GcP7Jgv8NEnZi5AQE/+60XuL+iOviVR16V0RycwCe7Kfioj1U366INIYQVlfqmPGRk0IgUPAxVoVZpLMtHoth+7XteENWU+vo7Oo0QFcn3nwwILayD7MwGexi0lSbtrf44bAGXxBwLJIpe9DS4E+UGh1OnF++mGXESZ+d5T9DsL9P2c4Kw=
file_glob: true
file: "*.zip"
skip_cleanup: true
on:
repo: 4O4/lua-reactivex
tags: true