aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThijs Schreijer <thijs@thijsschreijer.nl>2023-11-09 19:48:16 +0100
committerThijs Schreijer <thijs@thijsschreijer.nl>2023-11-09 22:59:06 +0100
commit3f4a5564b2643d884594a15ddc233c9c4abe3780 (patch)
tree412583755cdbdad77326c17937462b20f9a0ad4c
parentaebb2fcd2551caa063c126a35dbb22ec72f2b616 (diff)
downloadluasystem-3f4a5564b2643d884594a15ddc233c9c4abe3780.tar.gz
luasystem-3f4a5564b2643d884594a15ddc233c9c4abe3780.tar.bz2
luasystem-3f4a5564b2643d884594a15ddc233c9c4abe3780.zip
chore(ci): switch to github actions
-rw-r--r--.github/workflows/lint.yml38
-rw-r--r--.github/workflows/unix_build.yml59
-rw-r--r--.travis.yml34
-rw-r--r--.travis/platform.sh15
-rw-r--r--.travis/setenv_lua.sh3
-rw-r--r--.travis/setup_lua.sh122
-rw-r--r--appveyor.yml29
7 files changed, 126 insertions, 174 deletions
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
new file mode 100644
index 0000000..4a4516b
--- /dev/null
+++ b/.github/workflows/lint.yml
@@ -0,0 +1,38 @@
1name: Lint
2
3concurrency:
4 # for PR's cancel the running task, if another commit is pushed
5 group: ${{ github.workflow }} ${{ github.ref }}
6 cancel-in-progress: ${{ github.event_name == 'pull_request' }}
7
8on:
9 # build on PR and push-to-main. This works for short-lived branches, and saves
10 # CPU cycles on duplicated tests.
11 # For long-lived branches that diverge, you'll want to run on all pushes, not
12 # just on push-to-main.
13 pull_request: {}
14 push:
15 branches:
16 - main
17
18
19jobs:
20 lint:
21 runs-on: ubuntu-20.04
22 steps:
23 - name: Checkout
24 uses: actions/checkout@v3
25
26 - uses: leafo/gh-actions-lua@v8
27 with:
28 luaVersion: "5.4"
29
30 - uses: leafo/gh-actions-luarocks@v4
31
32 - name: dependencies
33 run: |
34 luarocks install luacheck
35
36 - name: lint
37 run: |
38 luacheck .
diff --git a/.github/workflows/unix_build.yml b/.github/workflows/unix_build.yml
new file mode 100644
index 0000000..ba8164a
--- /dev/null
+++ b/.github/workflows/unix_build.yml
@@ -0,0 +1,59 @@
1name: "Unix build"
2
3concurrency:
4 # for PR's cancel the running task, if another commit is pushed
5 group: ${{ github.workflow }} ${{ github.ref }}
6 cancel-in-progress: ${{ github.event_name == 'pull_request' }}
7
8on:
9 # build on PR and push-to-main. This works for short-lived branches, and saves
10 # CPU cycles on duplicated tests.
11 # For long-lived branches that diverge, you'll want to run on all pushes, not
12 # just on push-to-main.
13 pull_request: {}
14 push:
15 branches:
16 - main
17
18
19jobs:
20 test:
21 runs-on: ${{ matrix.os }}
22
23 strategy:
24 fail-fast: false
25 matrix:
26 os: ['ubuntu-20.04', 'macos-11.0']
27 luaVersion:
28 - "5.1"
29 - "5.2"
30 - "5.3"
31 - "5.4"
32 - "luajit-2.1.0-beta3"
33 - "luajit-openresty"
34
35 steps:
36 - name: Checkout
37 uses: actions/checkout@v3
38
39 - uses: leafo/gh-actions-lua@v8
40 with:
41 luaVersion: ${{ matrix.luaVersion }}
42
43 - uses: leafo/gh-actions-luarocks@v4
44
45 - name: dependencies
46 run: |
47 luarocks install busted
48 luarocks make
49
50 - name: test
51 run: |
52 busted --Xoutput "--color"
53
54 # - name: Report test coverage
55 # if: success()
56 # continue-on-error: true
57 # run: luacov-coveralls
58 # env:
59 # COVERALLS_REPO_TOKEN: ${{ github.token }}
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index e6bfa23..0000000
--- a/.travis.yml
+++ /dev/null
@@ -1,34 +0,0 @@
1language: c
2
3sudo: false
4
5os:
6 - linux
7 - osx
8
9env:
10 global:
11 - LUAROCKS=2.3.0
12 matrix:
13 - LUA=lua5.1
14 - LUA=lua5.2
15 - LUA=lua5.3
16 - LUA=luajit
17 - LUA=luajit2.0
18 - LUA=luajit2.1
19
20before_install:
21 - source .travis/setenv_lua.sh
22
23install:
24 - luarocks install busted
25 - luarocks make luasystem-scm-0.rockspec
26
27script: busted spec
28
29branches:
30 only:
31 - master
32
33notifications:
34 email: false
diff --git a/.travis/platform.sh b/.travis/platform.sh
deleted file mode 100644
index 7259a7d..0000000
--- a/.travis/platform.sh
+++ /dev/null
@@ -1,15 +0,0 @@
1if [ -z "${PLATFORM:-}" ]; then
2 PLATFORM=$TRAVIS_OS_NAME;
3fi
4
5if [ "$PLATFORM" == "osx" ]; then
6 PLATFORM="macosx";
7fi
8
9if [ -z "$PLATFORM" ]; then
10 if [ "$(uname)" == "Linux" ]; then
11 PLATFORM="linux";
12 else
13 PLATFORM="macosx";
14 fi;
15fi
diff --git a/.travis/setenv_lua.sh b/.travis/setenv_lua.sh
deleted file mode 100644
index 8d8c825..0000000
--- a/.travis/setenv_lua.sh
+++ /dev/null
@@ -1,3 +0,0 @@
1export PATH=${PATH}:$HOME/.lua:$HOME/.local/bin:${TRAVIS_BUILD_DIR}/install/luarocks/bin
2bash .travis/setup_lua.sh
3eval `$HOME/.lua/luarocks path`
diff --git a/.travis/setup_lua.sh b/.travis/setup_lua.sh
deleted file mode 100644
index 6dcc0c6..0000000
--- a/.travis/setup_lua.sh
+++ /dev/null
@@ -1,122 +0,0 @@
1#! /bin/bash
2
3# A script for setting up environment for travis-ci testing.
4# Sets up Lua and Luarocks.
5# LUA must be "lua5.1", "lua5.2" or "luajit".
6# luajit2.0 - master v2.0
7# luajit2.1 - master v2.1
8
9set -eufo pipefail
10
11LUAJIT_VERSION="2.0.4"
12LUAJIT_BASE="LuaJIT-$LUAJIT_VERSION"
13
14source .travis/platform.sh
15
16LUA_HOME_DIR=$TRAVIS_BUILD_DIR/install/lua
17
18LR_HOME_DIR=$TRAVIS_BUILD_DIR/install/luarocks
19
20mkdir $HOME/.lua
21
22LUAJIT="no"
23
24if [ "$PLATFORM" == "macosx" ]; then
25 if [ "$LUA" == "luajit" ]; then
26 LUAJIT="yes";
27 fi
28 if [ "$LUA" == "luajit2.0" ]; then
29 LUAJIT="yes";
30 fi
31 if [ "$LUA" == "luajit2.1" ]; then
32 LUAJIT="yes";
33 fi;
34elif [ "$(expr substr $LUA 1 6)" == "luajit" ]; then
35 LUAJIT="yes";
36fi
37
38mkdir -p "$LUA_HOME_DIR"
39
40if [ "$LUAJIT" == "yes" ]; then
41
42 if [ "$LUA" == "luajit" ]; then
43 curl --location https://github.com/LuaJIT/LuaJIT/archive/v$LUAJIT_VERSION.tar.gz | tar xz;
44 else
45 git clone https://github.com/LuaJIT/LuaJIT.git $LUAJIT_BASE;
46 fi
47
48 cd $LUAJIT_BASE
49
50 if [ "$LUA" == "luajit2.1" ]; then
51 git checkout v2.1;
52 # force the INSTALL_TNAME to be luajit
53 perl -i -pe 's/INSTALL_TNAME=.+/INSTALL_TNAME= luajit/' Makefile
54 fi
55
56 make && make install PREFIX="$LUA_HOME_DIR"
57
58 ln -s $LUA_HOME_DIR/bin/luajit $HOME/.lua/luajit
59 ln -s $LUA_HOME_DIR/bin/luajit $HOME/.lua/lua;
60
61else
62
63 if [ "$LUA" == "lua5.1" ]; then
64 curl http://www.lua.org/ftp/lua-5.1.5.tar.gz | tar xz
65 cd lua-5.1.5;
66 elif [ "$LUA" == "lua5.2" ]; then
67 curl http://www.lua.org/ftp/lua-5.2.4.tar.gz | tar xz
68 cd lua-5.2.4;
69 elif [ "$LUA" == "lua5.3" ]; then
70 curl http://www.lua.org/ftp/lua-5.3.2.tar.gz | tar xz
71 cd lua-5.3.2;
72 fi
73
74 # Build Lua without backwards compatibility for testing
75 perl -i -pe 's/-DLUA_COMPAT_(ALL|5_2)//' src/Makefile
76 make $PLATFORM
77 make INSTALL_TOP="$LUA_HOME_DIR" install;
78
79 ln -s $LUA_HOME_DIR/bin/lua $HOME/.lua/lua
80 ln -s $LUA_HOME_DIR/bin/luac $HOME/.lua/luac;
81
82fi
83
84cd $TRAVIS_BUILD_DIR
85
86lua -v
87
88LUAROCKS_BASE=luarocks-$LUAROCKS
89
90curl --location http://luarocks.org/releases/$LUAROCKS_BASE.tar.gz | tar xz
91
92cd $LUAROCKS_BASE
93
94if [ "$LUA" == "luajit" ]; then
95 ./configure --lua-suffix=jit --with-lua-include="$LUA_HOME_DIR/include/luajit-2.0" --prefix="$LR_HOME_DIR";
96elif [ "$LUA" == "luajit2.0" ]; then
97 ./configure --lua-suffix=jit --with-lua-include="$LUA_HOME_DIR/include/luajit-2.0" --prefix="$LR_HOME_DIR";
98elif [ "$LUA" == "luajit2.1" ]; then
99 ./configure --lua-suffix=jit --with-lua-include="$LUA_HOME_DIR/include/luajit-2.1" --prefix="$LR_HOME_DIR";
100else
101 ./configure --with-lua="$LUA_HOME_DIR" --prefix="$LR_HOME_DIR"
102fi
103
104make build && make install
105
106ln -s $LR_HOME_DIR/bin/luarocks $HOME/.lua/luarocks
107
108cd $TRAVIS_BUILD_DIR
109
110luarocks --version
111
112rm -rf $LUAROCKS_BASE
113
114if [ "$LUAJIT" == "yes" ]; then
115 rm -rf $LUAJIT_BASE;
116elif [ "$LUA" == "lua5.1" ]; then
117 rm -rf lua-5.1.5;
118elif [ "$LUA" == "lua5.2" ]; then
119 rm -rf lua-5.2.4;
120elif [ "$LUA" == "lua5.3" ]; then
121 rm -rf lua-5.3.2;
122fi
diff --git a/appveyor.yml b/appveyor.yml
new file mode 100644
index 0000000..596c846
--- /dev/null
+++ b/appveyor.yml
@@ -0,0 +1,29 @@
1# this fails for some reason. Disabled for now.
2
3shallow_clone: true
4
5environment:
6 matrix:
7 - LUA: "lua 5.1"
8 - LUA: "lua 5.2"
9 - LUA: "lua 5.3"
10 - LUA: "lua 5.4"
11 - LUA: "luajit 2.0"
12 - LUA: "luajit 2.0 --compat 5.2"
13 - LUA: "luajit 2.1"
14 - LUA: "luajit 2.1 --compat 5.2"
15
16before_build:
17 - set PATH=C:\Python27\Scripts;%PATH%
18 - pip install --upgrade certifi
19 - FOR /F "tokens=* USEBACKQ" %%F IN (`python -c "import certifi;print(certifi.where())"`) DO ( SET SSL_CERT_FILE=%%F )
20 - pip install hererocks
21 - hererocks here --%LUA% -rlatest
22 - call here\bin\activate
23 - luarocks install busted
24
25build_script:
26 - luarocks make
27
28test_script:
29 - busted