diff options
-rw-r--r-- | .github/workflows/build.yml | 45 | ||||
-rw-r--r-- | .github/workflows/deploy.yml | 34 | ||||
-rw-r--r-- | .travis.yml | 54 |
3 files changed, 79 insertions, 54 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..17cad49 --- /dev/null +++ b/.github/workflows/build.yml | |||
@@ -0,0 +1,45 @@ | |||
1 | name: Test build | ||
2 | |||
3 | on: | ||
4 | push: | ||
5 | branches: | ||
6 | - master | ||
7 | pull_request: | ||
8 | |||
9 | jobs: | ||
10 | build: | ||
11 | name: Test build on Linux | ||
12 | strategy: | ||
13 | fail-fast: false | ||
14 | matrix: | ||
15 | luaVersion: [ "5.4", "5.3", "5.2", "5.1", "luajit", "luajit-openresty"] | ||
16 | platform: [ "ubuntu-20.04", "macos-11" ] # "windows-2022" not supported by gh-actions-lua | ||
17 | runs-on: ${{ matrix.platform }} | ||
18 | steps: | ||
19 | - name: Checkout | ||
20 | uses: actions/checkout@v3 | ||
21 | - name: Setup ‘lua’ | ||
22 | uses: leafo/gh-actions-lua@v9 | ||
23 | with: | ||
24 | luaVersion: ${{ matrix.luaVersion }} | ||
25 | - name: Setup ‘luarocks’ | ||
26 | uses: leafo/gh-actions-luarocks@v4 | ||
27 | - name: Make and install | ||
28 | run: | | ||
29 | export DEBUG=DEBUG | ||
30 | luarocks make -- luasocket-scm-3.rockspec | ||
31 | - name: Run regression tests | ||
32 | run: | | ||
33 | cd test | ||
34 | lua hello.lua | ||
35 | lua testsrvr.lua > /dev/null & | ||
36 | lua testclnt.lua | ||
37 | lua stufftest.lua | ||
38 | lua excepttest.lua | ||
39 | lua test_bind.lua | ||
40 | lua test_getaddrinfo.lua | ||
41 | lua ltn12test.lua | ||
42 | lua mimetest.lua | ||
43 | lua urltest.lua | ||
44 | lua test_socket_error.lua | ||
45 | kill %1 | ||
diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..acd66ea --- /dev/null +++ b/.github/workflows/deploy.yml | |||
@@ -0,0 +1,34 @@ | |||
1 | name: Deploy | ||
2 | |||
3 | on: [ push, workflow_dispatch ] | ||
4 | |||
5 | jobs: | ||
6 | |||
7 | affected: | ||
8 | uses: lunarmodules/.github/.github/workflows/list_affected_rockspecs.yml@main | ||
9 | |||
10 | build: | ||
11 | needs: affected | ||
12 | if: ${{ needs.affected.outputs.rockspecs }} | ||
13 | uses: lunarmodules/.github/.github/workflows/test_build_rock.yml@main | ||
14 | with: | ||
15 | rockspecs: ${{ needs.affected.outputs.rockspecs }} | ||
16 | |||
17 | upload: | ||
18 | needs: [ affected, build ] | ||
19 | # Only run upload if: | ||
20 | # 1. We are on the canonical repository (no uploads from forks) | ||
21 | # 2. The current commit is either tagged or on the default branch (the workflow will upload dev/scm rockspecs any | ||
22 | # time they are touched, tagged ones whenever the edited rockspec and tag match) | ||
23 | # 3. Some rockspecs were changed — this implies the commit changing the rockspec is the same one that gets tagged | ||
24 | if: >- | ||
25 | ${{ | ||
26 | github.repository == 'lunarmodules/luasocket' && | ||
27 | ( github.ref_name == 'master' || startsWith(github.ref, 'refs/tags/') ) && | ||
28 | needs.affected.outputs.rockspecs | ||
29 | }} | ||
30 | uses: lunarmodules/.github/.github/workflows/upload_to_luarocks.yml@main | ||
31 | with: | ||
32 | rockspecs: ${{ needs.affected.outputs.rockspecs }} | ||
33 | secrets: | ||
34 | apikey: ${{ secrets.LUAROCKS_APIKEY }} | ||
diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index fce8a96..0000000 --- a/.travis.yml +++ /dev/null | |||
@@ -1,54 +0,0 @@ | |||
1 | language: erlang | ||
2 | |||
3 | env: | ||
4 | global: | ||
5 | - LUAROCKS_BASE=luarocks-2.0.13 | ||
6 | matrix: | ||
7 | - LUA=lua5.1 LUA_DEV=liblua5.1-dev LUA_VER=5.1 LUA_SFX=5.1 LUA_INCDIR=/usr/include/lua5.1 | ||
8 | - LUA=lua5.2 LUA_DEV=liblua5.2-dev LUA_VER=5.2 LUA_SFX=5.2 LUA_INCDIR=/usr/include/lua5.2 | ||
9 | - LUA=luajit LUA_DEV=libluajit-5.1-dev LUA_VER=5.1 LUA_SFX=jit LUA_INCDIR=/usr/include/luajit-2.0 | ||
10 | |||
11 | branches: | ||
12 | only: | ||
13 | - master | ||
14 | |||
15 | before_install: | ||
16 | - if [ $LUA = "luajit" ]; then | ||
17 | sudo add-apt-repository ppa:mwild1/ppa -y && sudo apt-get update -y; | ||
18 | fi | ||
19 | - sudo apt-get install $LUA | ||
20 | - sudo apt-get install $LUA_DEV | ||
21 | - lua$LUA_SFX -v | ||
22 | # Install a recent luarocks release | ||
23 | - wget http://luarocks.org/releases/$LUAROCKS_BASE.tar.gz | ||
24 | - tar zxvpf $LUAROCKS_BASE.tar.gz | ||
25 | - cd $LUAROCKS_BASE | ||
26 | - ./configure | ||
27 | --lua-version=$LUA_VER --lua-suffix=$LUA_SFX --with-lua-include="$LUA_INCDIR" | ||
28 | - sudo make | ||
29 | - sudo make install | ||
30 | - cd $TRAVIS_BUILD_DIR | ||
31 | |||
32 | |||
33 | install: | ||
34 | - export DEBUG=DEBUG | ||
35 | - sudo -E luarocks make luasocket-scm-0.rockspec | ||
36 | |||
37 | script: | ||
38 | - cd test | ||
39 | - lua$LUA_SFX hello.lua | ||
40 | - lua$LUA_SFX testsrvr.lua > /dev/null & | ||
41 | - lua$LUA_SFX testclnt.lua | ||
42 | - lua$LUA_SFX stufftest.lua | ||
43 | - lua$LUA_SFX excepttest.lua | ||
44 | - lua$LUA_SFX test_bind.lua | ||
45 | - lua$LUA_SFX test_getaddrinfo.lua | ||
46 | - lua$LUA_SFX ltn12test.lua | ||
47 | - lua$LUA_SFX mimetest.lua | ||
48 | - lua$LUA_SFX urltest.lua | ||
49 | - lua$LUA_SFX test_socket_error.lua | ||
50 | |||
51 | notifications: | ||
52 | email: | ||
53 | on_success: change | ||
54 | on_failure: always | ||