diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2022-02-17 01:14:56 -0300 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2022-02-17 12:47:25 -0300 |
commit | 9e22f32dd442d7c95766aca54ceea9833efa4f9d (patch) | |
tree | be08ed8f41797e4c6038d51336bdc033301d4ad1 | |
parent | 6c524b4a1b9fec2fe4abf03fa83b8d6624c23e26 (diff) | |
download | luarocks-9e22f32dd442d7c95766aca54ceea9833efa4f9d.tar.gz luarocks-9e22f32dd442d7c95766aca54ceea9833efa4f9d.tar.bz2 luarocks-9e22f32dd442d7c95766aca54ceea9833efa4f9d.zip |
tests: remove Travis CI, add Github Actions
-rw-r--r-- | .github/workflows/test.yml | 104 | ||||
-rw-r--r-- | .travis.yml | 177 | ||||
-rw-r--r-- | README.md | 2 | ||||
-rwxr-xr-x | makedist | 4 | ||||
-rw-r--r-- | spec/README.md | 8 | ||||
-rw-r--r-- | spec/util/test_env.lua | 12 |
6 files changed, 117 insertions, 190 deletions
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..3ddd5f18 --- /dev/null +++ b/.github/workflows/test.yml | |||
@@ -0,0 +1,104 @@ | |||
1 | name: test | ||
2 | |||
3 | on: [push] | ||
4 | |||
5 | jobs: | ||
6 | ############################################################################## | ||
7 | ShellLint: | ||
8 | runs-on: "ubuntu-latest" | ||
9 | |||
10 | steps: | ||
11 | - uses: actions/checkout@master | ||
12 | |||
13 | - name: Prep | ||
14 | run: | | ||
15 | sudo apt-get install -y shellcheck | ||
16 | |||
17 | - name: Shellcheck | ||
18 | run: | | ||
19 | shellcheck ./configure | ||
20 | |||
21 | ############################################################################## | ||
22 | LuaLint: | ||
23 | runs-on: "ubuntu-latest" | ||
24 | |||
25 | steps: | ||
26 | - uses: actions/checkout@master | ||
27 | |||
28 | - uses: leafo/gh-actions-lua@v8.0.0 | ||
29 | with: | ||
30 | luaVersion: "5.4" | ||
31 | |||
32 | - uses: leafo/gh-actions-luarocks@v4.0.0 | ||
33 | |||
34 | - name: Prep | ||
35 | run: | | ||
36 | luarocks install luacheck | ||
37 | |||
38 | - name: Luacheck | ||
39 | run: | | ||
40 | luacheck . | ||
41 | |||
42 | ############################################################################## | ||
43 | TestMatrix: | ||
44 | strategy: | ||
45 | matrix: | ||
46 | lua-version: ["5.3", "luajit"] | ||
47 | os: ["ubuntu-latest", "macos-latest"] | ||
48 | runs-on: ${{ matrix.os }} | ||
49 | |||
50 | steps: | ||
51 | - uses: actions/checkout@master | ||
52 | |||
53 | - uses: leafo/gh-actions-lua@v8.0.0 | ||
54 | with: | ||
55 | luaVersion: ${{ matrix.lua-version }} | ||
56 | |||
57 | - uses: leafo/gh-actions-luarocks@v4.0.0 | ||
58 | |||
59 | - name: Prep | ||
60 | run: | | ||
61 | luarocks install busted | ||
62 | luarocks install cluacov | ||
63 | luarocks install luacheck | ||
64 | luarocks install busted-htest | ||
65 | |||
66 | - name: Luacheck | ||
67 | run: | | ||
68 | luacheck . | ||
69 | |||
70 | - name: Unit Test | ||
71 | run: | | ||
72 | eval $(luarocks path) | ||
73 | busted -o htest --exclude-tags=git,integration --verbose -Xhelper "lua_dir=$(luarocks config variables.LUA_DIR),ci" | ||
74 | busted -o htest --exclude-tags=git,integration --verbose -Xhelper "lua_dir=$(luarocks config variables.LUA_DIR),ci,env=full" | ||
75 | |||
76 | - name: Integration Test | ||
77 | run: | | ||
78 | eval $(luarocks path) | ||
79 | busted -o htest --exclude-tags=ssh,gpg,git,unit --verbose -Xhelper "lua_dir=$(luarocks config variables.LUA_DIR),ci" | ||
80 | busted -o htest --exclude-tags=ssh,gpg,git,unit --verbose -Xhelper "lua_dir=$(luarocks config variables.LUA_DIR),ci,env=full" | ||
81 | |||
82 | - name: Coverage | ||
83 | run: | | ||
84 | eval $(luarocks path) | ||
85 | luacov -c testrun/luacov.config | ||
86 | ( cd testrun/ && bash <(curl -s https://codecov.io/bash) ) | ||
87 | grep "Summary" -B1 -A1000 testrun/luacov.report.out | ||
88 | |||
89 | ############################################################################## | ||
90 | SmokeTest: | ||
91 | runs-on: "ubuntu-latest" | ||
92 | steps: | ||
93 | - uses: actions/checkout@master | ||
94 | |||
95 | - uses: leafo/gh-actions-lua@v8.0.0 | ||
96 | with: | ||
97 | luaVersion: "5.3" | ||
98 | |||
99 | - name: Smoke Test | ||
100 | run: | | ||
101 | ./configure | ||
102 | ./makedist dev | ||
103 | ./smoke_test.sh luarocks-dev.tar.gz | ||
104 | |||
diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index b1872483..00000000 --- a/.travis.yml +++ /dev/null | |||
@@ -1,177 +0,0 @@ | |||
1 | language: python | ||
2 | |||
3 | cache: | ||
4 | directories: | ||
5 | - lua_install | ||
6 | - testrun/testing_cache-5.1 | ||
7 | - testrun/testing_cache-5.2 | ||
8 | - testrun/testing_cache-5.3 | ||
9 | - testrun/testing_cache-2.1 | ||
10 | - testrun/testing_server-5.1 | ||
11 | - testrun/testing_server-5.2 | ||
12 | - testrun/testing_server-5.3 | ||
13 | - testrun/testing_server-2.1 | ||
14 | - testrun/binary-samples | ||
15 | |||
16 | smoke_script: &smoke_script | ||
17 | - export BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo $TRAVIS_BRANCH; else echo $TRAVIS_PULL_REQUEST_BRANCH; fi) | ||
18 | - ./makedist $BRANCH | ||
19 | - ./smoke_test.sh luarocks-$BRANCH.tar.gz | ||
20 | |||
21 | lint_script: &lint_script | ||
22 | - luacheck . | ||
23 | |||
24 | unit_script: &unit_script | ||
25 | - busted -o htest --exclude-tags=git,integration --verbose -Xhelper "lua_dir=$PWD/lua_install,travis" | ||
26 | - busted -o htest --exclude-tags=git,integration --verbose -Xhelper "lua_dir=$PWD/lua_install,travis,env=full" | ||
27 | |||
28 | integration_script: &integration_script | ||
29 | - lua -v | ||
30 | - if [ "$TRAVIS_OS_NAME" = "linux" ]; then shellcheck ./configure; fi | ||
31 | - ./configure --with-lua=lua_install | ||
32 | - ./makedist dev | ||
33 | - ./smoke_test.sh luarocks-dev.tar.gz | ||
34 | - busted -o htest --exclude-tags=gpg,git,unit --verbose -Xhelper "lua_dir=$PWD/lua_install,travis" | ||
35 | - busted -o htest --exclude-tags=gpg,git,unit --verbose -Xhelper "lua_dir=$PWD/lua_install,travis,env=full" | ||
36 | |||
37 | jobs: | ||
38 | include: | ||
39 | # Smoke tests for release branches | ||
40 | - stage: smoke | ||
41 | if: branch =~ ^[0-9].* | ||
42 | script: *smoke_script | ||
43 | os: linux | ||
44 | env: | ||
45 | - LUA="lua=5.3" | ||
46 | - stage: smoke | ||
47 | if: branch =~ ^[0-9].* | ||
48 | script: *smoke_script | ||
49 | os: osx | ||
50 | language: generic | ||
51 | env: | ||
52 | - LUA="luajit=2.1" | ||
53 | # Lint with Luacheck | ||
54 | - stage: Lint with Luacheck | ||
55 | script: *lint_script | ||
56 | os: linux | ||
57 | env: | ||
58 | - LUA="lua=5.3" | ||
59 | # Unit tests for linux | ||
60 | - stage: Unit on Linux | ||
61 | script: *unit_script | ||
62 | os: linux | ||
63 | env: | ||
64 | - LUA="lua=5.1" | ||
65 | - stage: Unit on Linux | ||
66 | script: *unit_script | ||
67 | os: linux | ||
68 | env: | ||
69 | - LUA="lua=5.2" | ||
70 | - stage: Unit on Linux | ||
71 | script: *unit_script | ||
72 | os: linux | ||
73 | env: | ||
74 | - LUA="lua=5.3" | ||
75 | - stage: Unit on Linux | ||
76 | script: *unit_script | ||
77 | os: linux | ||
78 | env: | ||
79 | - LUA="luajit=2.1" | ||
80 | # Integration tests for linux | ||
81 | - stage: Integration on Linux | ||
82 | script: *integration_script | ||
83 | os: linux | ||
84 | env: | ||
85 | - LUA="lua=5.1" | ||
86 | - stage: Integration on Linux | ||
87 | script: *integration_script | ||
88 | os: linux | ||
89 | env: | ||
90 | - LUA="lua=5.2" | ||
91 | - stage: Integration on Linux | ||
92 | script: *integration_script | ||
93 | os: linux | ||
94 | env: | ||
95 | - LUA="lua=5.3" | ||
96 | - stage: Integration on Linux | ||
97 | script: *integration_script | ||
98 | os: linux | ||
99 | env: | ||
100 | - LUA="luajit=2.1" | ||
101 | # Unit tests for mac | ||
102 | - stage: Unit on Mac | ||
103 | script: *unit_script | ||
104 | os: osx | ||
105 | env: | ||
106 | - LUA="lua=5.1" | ||
107 | language: generic | ||
108 | - stage: Unit on Mac | ||
109 | script: *unit_script | ||
110 | os: osx | ||
111 | env: | ||
112 | - LUA="lua=5.2" | ||
113 | language: generic | ||
114 | - stage: Unit on Mac | ||
115 | script: *unit_script | ||
116 | os: osx | ||
117 | env: | ||
118 | - LUA="lua=5.3" | ||
119 | language: generic | ||
120 | - stage: Unit on Mac | ||
121 | script: *unit_script | ||
122 | os: osx | ||
123 | env: | ||
124 | - LUA="luajit=2.1" | ||
125 | language: generic | ||
126 | # Integration tests for mac | ||
127 | - stage: Integration on Mac | ||
128 | script: *integration_script | ||
129 | os: osx | ||
130 | env: | ||
131 | - LUA="lua=5.1" | ||
132 | language: generic | ||
133 | - stage: Integration on Mac | ||
134 | script: *integration_script | ||
135 | os: osx | ||
136 | env: | ||
137 | - LUA="lua=5.2" | ||
138 | language: generic | ||
139 | - stage: Integration on Mac | ||
140 | script: *integration_script | ||
141 | os: osx | ||
142 | env: | ||
143 | - LUA="lua=5.3" | ||
144 | language: generic | ||
145 | - stage: Integration on Mac | ||
146 | script: *integration_script | ||
147 | os: osx | ||
148 | env: | ||
149 | - LUA="luajit=2.1" | ||
150 | language: generic | ||
151 | |||
152 | before_install: | ||
153 | - if [ ! -f lua_install/bin/luarocks ]; then pip install hererocks; fi | ||
154 | - if [ ! -f lua_install/bin/luarocks ]; then hererocks lua_install -r^ --$LUA; fi | ||
155 | - export PATH=$PATH:$PWD/lua_install/bin # Add directory with all installed binaries to PATH | ||
156 | |||
157 | install: | ||
158 | - if [ ! -f lua_install/bin/busted ]; then luarocks install busted; fi | ||
159 | - if [ ! -f lua_install/bin/luacov ]; then luarocks install cluacov; fi | ||
160 | - if [ ! -f lua_install/bin/luacheck ]; then luarocks install luacheck; fi | ||
161 | - luarocks install busted-htest | ||
162 | |||
163 | after_success: | ||
164 | - luacov -c $TRAVIS_BUILD_DIR/testrun/luacov.config | ||
165 | - cd $TRAVIS_BUILD_DIR/testrun/ && bash <(curl -s https://codecov.io/bash) | ||
166 | - grep "Summary" -B1 -A1000 $TRAVIS_BUILD_DIR/testrun/luacov.report.out | ||
167 | |||
168 | notifications: | ||
169 | email: | ||
170 | on_success: change | ||
171 | on_failure: change | ||
172 | webhooks: | ||
173 | urls: | ||
174 | - https://webhooks.gitter.im/e/3320fc3f28abbb06e1d8 | ||
175 | on_success: change | ||
176 | on_failure: always | ||
177 | on_start: never | ||
@@ -2,7 +2,7 @@ | |||
2 | 2 | ||
3 | A package manager for Lua modules. | 3 | A package manager for Lua modules. |
4 | 4 | ||
5 | [](https://travis-ci.com/luarocks/luarocks) | 5 | [](https://github.com/luarocks/luarocks/actions) |
6 | [](https://ci.appveyor.com/project/hishamhm/luarocks/branch/master) | 6 | [](https://ci.appveyor.com/project/hishamhm/luarocks/branch/master) |
7 | [](https://codecov.io/gh/luarocks/luarocks/branch/master) | 7 | [](https://codecov.io/gh/luarocks/luarocks/branch/master) |
8 | [](https://gitter.im/luarocks/luarocks) | 8 | [](https://gitter.im/luarocks/luarocks) |
@@ -137,7 +137,7 @@ mkdir "release-windows" | |||
137 | mv "$out" "release-windows/$out-win32" | 137 | mv "$out" "release-windows/$out-win32" |
138 | 138 | ||
139 | cd "release-unix/$out" | 139 | cd "release-unix/$out" |
140 | rm -rf makedist install.bat win32 .travis.yml .gitignore appveyor* .appveyor | 140 | rm -rf makedist install.bat win32 .github .gitignore appveyor* .appveyor |
141 | cd .. | 141 | cd .. |
142 | tar czvpf ../"$out.tar.gz" "$out" | 142 | tar czvpf ../"$out.tar.gz" "$out" |
143 | rm -f ../"$out.tar.gz.asc" | 143 | rm -f ../"$out.tar.gz.asc" |
@@ -145,7 +145,7 @@ cd .. | |||
145 | rm -rf "release-unix" | 145 | rm -rf "release-unix" |
146 | 146 | ||
147 | cd "release-windows/$out-win32" | 147 | cd "release-windows/$out-win32" |
148 | rm -rf makedist Makefile GNUmakefile configure .travis.yml .gitignore test appveyor* .appveyor | 148 | rm -rf makedist Makefile GNUmakefile configure .github .gitignore test appveyor* .appveyor |
149 | cd .. | 149 | cd .. |
150 | zip -r ../"$out-win32.zip" "$out-win32" | 150 | zip -r ../"$out-win32.zip" "$out-win32" |
151 | rm -f ../"$out-win32.zip.asc" | 151 | rm -f ../"$out-win32.zip.asc" |
diff --git a/spec/README.md b/spec/README.md index 46372b19..b55550e6 100644 --- a/spec/README.md +++ b/spec/README.md | |||
@@ -3,14 +3,14 @@ | |||
3 | 3 | ||
4 | ## Overview | 4 | ## Overview |
5 | 5 | ||
6 | Test suite for LuaRocks project with Busted unit testing framework(http://olivinelabs.com/busted/). | 6 | Test suite for LuaRocks project with Busted unit testing framework(http://olivinelabs.com/busted/). |
7 | 7 | ||
8 | * Contains unit & integration tests | 8 | * Contains unit & integration tests |
9 | * Easy setup for your purpose on command line or from configuration file | 9 | * Easy setup for your purpose on command line or from configuration file |
10 | 10 | ||
11 | ## Dependencies | 11 | ## Dependencies |
12 | 12 | ||
13 | * Lua >= 5.1 | 13 | * Lua >= 5.1 |
14 | * Busted with dependencies | 14 | * Busted with dependencies |
15 | 15 | ||
16 | ## Usage | 16 | ## Usage |
@@ -26,8 +26,8 @@ LuaRocks folder or specify with *-C* flag. | |||
26 | env=<type>, (default:"minimal") type what kind of environment to use ["minimal", "full"] | 26 | env=<type>, (default:"minimal") type what kind of environment to use ["minimal", "full"] |
27 | noreset, Don't reset environment after each test | 27 | noreset, Don't reset environment after each test |
28 | clean, remove existing testing environment | 28 | clean, remove existing testing environment |
29 | appveyor, add just if running on TravisCI | 29 | appveyor, add just if running on Appveyor |
30 | travis, add just if running on TravisCI | 30 | ci, add just if running on Unix CI |
31 | os=<version>, type your OS ["linux", "os x", "windows"] | 31 | os=<version>, type your OS ["linux", "os x", "windows"] |
32 | ``` | 32 | ``` |
33 | --------------------------------------------------------------------------------------------- | 33 | --------------------------------------------------------------------------------------------- |
diff --git a/spec/util/test_env.lua b/spec/util/test_env.lua index c40921cc..737d90a5 100644 --- a/spec/util/test_env.lua +++ b/spec/util/test_env.lua | |||
@@ -17,7 +17,7 @@ ARGUMENTS | |||
17 | default: "minimal"). | 17 | default: "minimal"). |
18 | noreset Don't reset environment after each test | 18 | noreset Don't reset environment after each test |
19 | clean Remove existing testing environment. | 19 | clean Remove existing testing environment. |
20 | travis Add if running on TravisCI. | 20 | ci Add if running on Unix CI. |
21 | appveyor Add if running on Appveyor. | 21 | appveyor Add if running on Appveyor. |
22 | os=<type> Set OS ("linux", "osx", or "windows"). | 22 | os=<type> Set OS ("linux", "osx", or "windows"). |
23 | lua_dir=<path> Path of Lua installation (default "/usr/local") | 23 | lua_dir=<path> Path of Lua installation (default "/usr/local") |
@@ -238,8 +238,8 @@ function test_env.set_args() | |||
238 | test_env.TEST_ENV_CLEAN = true | 238 | test_env.TEST_ENV_CLEAN = true |
239 | elseif argument == "verbose" then | 239 | elseif argument == "verbose" then |
240 | test_env.VERBOSE = true | 240 | test_env.VERBOSE = true |
241 | elseif argument == "travis" then | 241 | elseif argument == "ci" then |
242 | test_env.TRAVIS = true | 242 | test_env.CI = true |
243 | elseif argument == "appveyor" then | 243 | elseif argument == "appveyor" then |
244 | test_env.APPVEYOR = true | 244 | test_env.APPVEYOR = true |
245 | elseif argument:find("^os=") then | 245 | elseif argument:find("^os=") then |
@@ -273,13 +273,13 @@ function test_env.set_args() | |||
273 | local system = execute_output("uname -s") | 273 | local system = execute_output("uname -s") |
274 | if system == "Linux" then | 274 | if system == "Linux" then |
275 | test_env.TEST_TARGET_OS = "linux" | 275 | test_env.TEST_TARGET_OS = "linux" |
276 | if test_env.TRAVIS then | 276 | if test_env.CI then |
277 | test_env.OPENSSL_INCDIR = "/usr/include" | 277 | test_env.OPENSSL_INCDIR = "/usr/include" |
278 | test_env.OPENSSL_LIBDIR = "/usr/lib/x86_64-linux-gnu" | 278 | test_env.OPENSSL_LIBDIR = "/usr/lib/x86_64-linux-gnu" |
279 | end | 279 | end |
280 | elseif system == "Darwin" then | 280 | elseif system == "Darwin" then |
281 | test_env.TEST_TARGET_OS = "osx" | 281 | test_env.TEST_TARGET_OS = "osx" |
282 | if test_env.TRAVIS then | 282 | if test_env.CI then |
283 | test_env.OPENSSL_INCDIR = "/usr/local/opt/openssl/include" | 283 | test_env.OPENSSL_INCDIR = "/usr/local/opt/openssl/include" |
284 | test_env.OPENSSL_LIBDIR = "/usr/local/opt/openssl/lib" | 284 | test_env.OPENSSL_LIBDIR = "/usr/local/opt/openssl/lib" |
285 | end | 285 | end |
@@ -643,7 +643,7 @@ end | |||
643 | function test_env.setup_specs(extra_rocks) | 643 | function test_env.setup_specs(extra_rocks) |
644 | -- if global variable about successful creation of testing environment doesn't exist, build environment | 644 | -- if global variable about successful creation of testing environment doesn't exist, build environment |
645 | if not test_env.setup_done then | 645 | if not test_env.setup_done then |
646 | if test_env.TRAVIS then | 646 | if test_env.CI then |
647 | if not test_env.exists(os.getenv("HOME") .. "/.ssh/id_rsa.pub") then | 647 | if not test_env.exists(os.getenv("HOME") .. "/.ssh/id_rsa.pub") then |
648 | execute_bool("ssh-keygen -t rsa -P \"\" -f ~/.ssh/id_rsa") | 648 | execute_bool("ssh-keygen -t rsa -P \"\" -f ~/.ssh/id_rsa") |
649 | execute_bool("cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys") | 649 | execute_bool("cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys") |