From 480c05257211b3e566f33fdf8cf051233e2dab30 Mon Sep 17 00:00:00 2001 From: Thijs Schreijer Date: Fri, 18 Mar 2022 12:12:39 +0100 Subject: ci: Add workflow to run luacheck linter --- .github/workflows/luacheck.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/luacheck.yml (limited to '.github/workflows') diff --git a/.github/workflows/luacheck.yml b/.github/workflows/luacheck.yml new file mode 100644 index 0000000..13993cc --- /dev/null +++ b/.github/workflows/luacheck.yml @@ -0,0 +1,26 @@ +name: Luacheck + +on: [push, pull_request] + +jobs: + luacheck: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Setup Lua + uses: leafo/gh-actions-lua@v8 + with: + luaVersion: 5.4 + + - name: Setup Lua Rocks + uses: leafo/gh-actions-luarocks@v4 + + - name: Setup dependencies + run: luarocks install luacheck + + - name: Run Code Linter + run: | + luacheck . -- cgit v1.2.3-55-g6feb From 8390d07774a1ba1a597d809a1a2562d88ecce19d Mon Sep 17 00:00:00 2001 From: Caleb Maclennan Date: Sat, 19 Mar 2022 17:34:28 +0300 Subject: chore: Bump Lua version used in linter --- .github/workflows/luacheck.yml | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) (limited to '.github/workflows') diff --git a/.github/workflows/luacheck.yml b/.github/workflows/luacheck.yml index 13993cc..597cd64 100644 --- a/.github/workflows/luacheck.yml +++ b/.github/workflows/luacheck.yml @@ -3,24 +3,17 @@ name: Luacheck on: [push, pull_request] jobs: - luacheck: - runs-on: ubuntu-latest + luacheck: + runs-on: ubuntu-20.04 steps: - name: Checkout - uses: actions/checkout@v2 - - - name: Setup Lua - uses: leafo/gh-actions-lua@v8 - with: - luaVersion: 5.4 - - - name: Setup Lua Rocks + uses: actions/checkout@v3 + - name: Setup ‘lua’ + uses: leafo/gh-actions-lua@v9 + - name: Setup ‘luarocks’ uses: leafo/gh-actions-luarocks@v4 - - - name: Setup dependencies + - name: Setup ‘luacheck’ run: luarocks install luacheck - - - name: Run Code Linter - run: | - luacheck . + - name: Run ‘luacheck’ linter + run: luacheck . -- cgit v1.2.3-55-g6feb From 2cc6f8a55c45ec9b5ad165c150259060d4d70a82 Mon Sep 17 00:00:00 2001 From: Caleb Maclennan Date: Sat, 19 Mar 2022 20:55:11 +0300 Subject: ci: Add workflow to confirm build completes --- .github/workflows/build.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/build.yml (limited to '.github/workflows') diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..8265bb1 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,24 @@ +name: Check build + +on: [ push, pull_request ] + +jobs: + build: + name: Check build + strategy: + fail-fast: false + matrix: + luaVersion: [ "5.4", "5.3", "5.2", "5.1", "luajit", "luajit-openresty"] + runs-on: ubuntu-20.04 + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Setup ‘lua’ + uses: leafo/gh-actions-lua@v9 + with: + luaVersion: ${{ matrix.luaVersion }} + - name: Setup ‘luarocks’ + uses: leafo/gh-actions-luarocks@v4 + - name: Make with Luarocks + run: | + luarocks make --pack-binary-rock -- luasocket-scm-3.rockspec -- cgit v1.2.3-55-g6feb From fdd741da5cd0515e69572e564f2d57f336d2466b Mon Sep 17 00:00:00 2001 From: Caleb Maclennan Date: Sat, 19 Mar 2022 20:58:52 +0300 Subject: Ci: Run regression tests after successful build --- .github/workflows/build.yml | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) (limited to '.github/workflows') diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8265bb1..64393cc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,10 +1,10 @@ -name: Check build +name: Test build on: [ push, pull_request ] jobs: build: - name: Check build + name: Test build on Linux strategy: fail-fast: false matrix: @@ -19,6 +19,23 @@ jobs: luaVersion: ${{ matrix.luaVersion }} - name: Setup ‘luarocks’ uses: leafo/gh-actions-luarocks@v4 - - name: Make with Luarocks + - name: Make and install locally run: | - luarocks make --pack-binary-rock -- luasocket-scm-3.rockspec + export DEBUG=DEBUG + luarocks --local make -- luasocket-scm-3.rockspec + - name: Run regression tests + run: | + eval $(luarocks --local path) + cd test + lua hello.lua + lua testsrvr.lua > /dev/null & + lua testclnt.lua + lua stufftest.lua + lua excepttest.lua + lua test_bind.lua + lua test_getaddrinfo.lua + lua ltn12test.lua + lua mimetest.lua + lua urltest.lua + lua test_socket_error.lua + kill %1 -- cgit v1.2.3-55-g6feb From 9787c17e589dc1b12c1f96e6bb391a7ff3dd5065 Mon Sep 17 00:00:00 2001 From: Caleb Maclennan Date: Sat, 19 Mar 2022 21:18:54 +0300 Subject: ci: Expand test matrix to cover Windows and macOS --- .github/workflows/build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to '.github/workflows') diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 64393cc..518de63 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,7 +9,8 @@ jobs: fail-fast: false matrix: luaVersion: [ "5.4", "5.3", "5.2", "5.1", "luajit", "luajit-openresty"] - runs-on: ubuntu-20.04 + platform: [ "ubuntu-20.04", "windows-2022", "macos-11" ] + runs-on: ${{ matrix.platform }} steps: - name: Checkout uses: actions/checkout@v3 -- cgit v1.2.3-55-g6feb From 52c72694c2989c38fc9df915dcb34995d1e37404 Mon Sep 17 00:00:00 2001 From: Caleb Maclennan Date: Sat, 19 Mar 2022 21:23:58 +0300 Subject: ci: Disable unsupported Windows and avoid duplicate runs --- .github/workflows/build.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to '.github/workflows') diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 518de63..d22e67f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,6 +1,10 @@ name: Test build -on: [ push, pull_request ] +on: + push: + branches: + - master + pull_request: jobs: build: @@ -9,7 +13,7 @@ jobs: fail-fast: false matrix: luaVersion: [ "5.4", "5.3", "5.2", "5.1", "luajit", "luajit-openresty"] - platform: [ "ubuntu-20.04", "windows-2022", "macos-11" ] + platform: [ "ubuntu-20.04", "macos-11" ] # "windows-2022" not supported by gh-actions-lua runs-on: ${{ matrix.platform }} steps: - name: Checkout -- cgit v1.2.3-55-g6feb From f9e1d03f3c6c9fc59dd3b91716debc23aebf947f Mon Sep 17 00:00:00 2001 From: Caleb Maclennan Date: Sat, 19 Mar 2022 22:42:25 +0300 Subject: ci: Don't bother doing user-local install in ephemeral runner --- .github/workflows/build.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to '.github/workflows') diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d22e67f..17cad49 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,13 +24,12 @@ jobs: luaVersion: ${{ matrix.luaVersion }} - name: Setup ‘luarocks’ uses: leafo/gh-actions-luarocks@v4 - - name: Make and install locally + - name: Make and install run: | export DEBUG=DEBUG - luarocks --local make -- luasocket-scm-3.rockspec + luarocks make -- luasocket-scm-3.rockspec - name: Run regression tests run: | - eval $(luarocks --local path) cd test lua hello.lua lua testsrvr.lua > /dev/null & -- cgit v1.2.3-55-g6feb From 5ed8b66e6d0c295f95fade159ada0f97f482b2ac Mon Sep 17 00:00:00 2001 From: Caleb Maclennan Date: Thu, 24 Mar 2022 15:22:31 +0300 Subject: ci: Utilize new upstream Luacheck Action (#367) --- .github/workflows/luacheck.yml | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to '.github/workflows') diff --git a/.github/workflows/luacheck.yml b/.github/workflows/luacheck.yml index 597cd64..2f20456 100644 --- a/.github/workflows/luacheck.yml +++ b/.github/workflows/luacheck.yml @@ -7,13 +7,7 @@ jobs: luacheck: runs-on: ubuntu-20.04 steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Setup ‘lua’ - uses: leafo/gh-actions-lua@v9 - - name: Setup ‘luarocks’ - uses: leafo/gh-actions-luarocks@v4 - - name: Setup ‘luacheck’ - run: luarocks install luacheck - - name: Run ‘luacheck’ linter - run: luacheck . + - name: Checkout + uses: actions/checkout@v3 + - name: Luacheck + uses: lunarmodules/luacheck@v0 -- cgit v1.2.3-55-g6feb From bac0b8dc274b46cf37bea02aa7edca8f1011a4b8 Mon Sep 17 00:00:00 2001 From: Caleb Maclennan Date: Thu, 24 Mar 2022 18:14:43 +0300 Subject: ci: Use reusable workflow for luarocks deploy --- .github/workflows/deploy.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/deploy.yml (limited to '.github/workflows') 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 @@ +name: Deploy + +on: [ push, workflow_dispatch ] + +jobs: + + affected: + uses: lunarmodules/.github/.github/workflows/list_affected_rockspecs.yml@main + + build: + needs: affected + if: ${{ needs.affected.outputs.rockspecs }} + uses: lunarmodules/.github/.github/workflows/test_build_rock.yml@main + with: + rockspecs: ${{ needs.affected.outputs.rockspecs }} + + upload: + needs: [ affected, build ] + # Only run upload if: + # 1. We are on the canonical repository (no uploads from forks) + # 2. The current commit is either tagged or on the default branch (the workflow will upload dev/scm rockspecs any + # time they are touched, tagged ones whenever the edited rockspec and tag match) + # 3. Some rockspecs were changed — this implies the commit changing the rockspec is the same one that gets tagged + if: >- + ${{ + github.repository == 'lunarmodules/luasocket' && + ( github.ref_name == 'master' || startsWith(github.ref, 'refs/tags/') ) && + needs.affected.outputs.rockspecs + }} + uses: lunarmodules/.github/.github/workflows/upload_to_luarocks.yml@main + with: + rockspecs: ${{ needs.affected.outputs.rockspecs }} + secrets: + apikey: ${{ secrets.LUAROCKS_APIKEY }} -- cgit v1.2.3-55-g6feb From d3777f9d06df58732e6f87c8fb94efc984652c63 Mon Sep 17 00:00:00 2001 From: Caleb Maclennan Date: Thu, 24 Mar 2022 23:32:57 +0300 Subject: chore: Start a Markdown era readme --- .github/workflows/build.yml | 2 +- README | 11 ----------- README.md | 12 ++++++++++++ makefile.dist | 2 +- 4 files changed, 14 insertions(+), 13 deletions(-) delete mode 100644 README create mode 100644 README.md (limited to '.github/workflows') diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 17cad49..d6fe214 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -name: Test build +name: Build on: push: diff --git a/README b/README deleted file mode 100644 index 7354ea0..0000000 --- a/README +++ /dev/null @@ -1,11 +0,0 @@ -This is the LuaSocket 3.0-rc1. It has been tested on Windows 7, Mac OS X, -and Linux. - -Please use the project page at GitHub - - https://github.com/lunarmodules/luasocket - -to file bug reports or propose changes. - -Have fun, -Diego Nehab. diff --git a/README.md b/README.md new file mode 100644 index 0000000..af722be --- /dev/null +++ b/README.md @@ -0,0 +1,12 @@ +# LuaSocket + + +[![Build](https://img.shields.io/github/workflow/status/lunarmodules/luasocket/Build?label=Build=Lua)](https://github.com/lunarmodules/luasocket/actions?workflow=Build) +[![Luacheck](https://img.shields.io/github/workflow/status/lunarmodules/luasocket/Luacheck?label=Luacheck&logo=Lua)](https://github.com/lunarmodules/luasocket/actions?workflow=Luacheck) +[![GitHub tag (latest SemVer)](https://img.shields.io/github/v/tag/lunarmodules/luasocket?label=Tag&logo=GitHub)](https://github.com/lunarmodules/luasocket/releases) +[![Luarocks](https://img.shields.io/luarocks/v/lunarmodules/luasocket?label=Luarocks&logo=Lua)](https://luarocks.org/modules/lunarmodules/luasocket) + +LuaSocket is a Lua extension library composed of two parts: + +1. a set of C modules that provide support for the TCP and UDP transport layers, and +2. a set of Lua modules that provide functions commonly needed by applications that deal with the Internet. diff --git a/makefile.dist b/makefile.dist index 34914c3..3a2e100 100644 --- a/makefile.dist +++ b/makefile.dist @@ -114,7 +114,7 @@ dist: mkdir -p $(DIST) cp -vf CHANGELOG.md $(DIST) cp -vf LICENSE $(DIST) - cp -vf README $(DIST) + cp -vf README.md $(DIST) cp -vf $(MAKE) $(DIST) mkdir -p $(DIST)/etc -- cgit v1.2.3-55-g6feb From 80503077dbb8428e4e99410d31ab42dd0438eef9 Mon Sep 17 00:00:00 2001 From: Caleb Maclennan Date: Wed, 27 Jul 2022 09:55:54 +0300 Subject: ci: Echo correct platform in job title --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to '.github/workflows') diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d6fe214..ee6e1d4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,11 +8,11 @@ on: jobs: build: - name: Test build on Linux + name: Test build on ${{ matrix.platform }} strategy: fail-fast: false matrix: - luaVersion: [ "5.4", "5.3", "5.2", "5.1", "luajit", "luajit-openresty"] + luaVersion: [ "5.4", "5.3", "5.2", "5.1", "luajit", "luajit-openresty" ] platform: [ "ubuntu-20.04", "macos-11" ] # "windows-2022" not supported by gh-actions-lua runs-on: ${{ matrix.platform }} steps: -- cgit v1.2.3-55-g6feb From 9c6195ea629077bd7f6bf73e3e9991c89ec5ba7e Mon Sep 17 00:00:00 2001 From: leso-kn Date: Fri, 27 Oct 2023 19:31:18 +0200 Subject: ci: Enable windows build --- .github/workflows/build.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to '.github/workflows') diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ee6e1d4..432bafb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,22 +13,27 @@ jobs: fail-fast: false matrix: luaVersion: [ "5.4", "5.3", "5.2", "5.1", "luajit", "luajit-openresty" ] - platform: [ "ubuntu-20.04", "macos-11" ] # "windows-2022" not supported by gh-actions-lua + platform: [ "ubuntu-20.04", "macos-11", "windows-2022" ] runs-on: ${{ matrix.platform }} steps: - name: Checkout uses: actions/checkout@v3 + - name: Setup ’msvc’ + uses: ilammy/msvc-dev-cmd@v1 + if: ${{ !startsWith(matrix.luaVersion, 'luajit') }} - name: Setup ‘lua’ - uses: leafo/gh-actions-lua@v9 + uses: leso-kn/gh-actions-lua@v11-staging with: luaVersion: ${{ matrix.luaVersion }} - name: Setup ‘luarocks’ - uses: leafo/gh-actions-luarocks@v4 + uses: hishamhm/gh-actions-luarocks@master - name: Make and install run: | - export DEBUG=DEBUG luarocks make -- luasocket-scm-3.rockspec + env: + DEBUG: DEBUG - name: Run regression tests + shell: bash run: | cd test lua hello.lua -- cgit v1.2.3-55-g6feb From 64c9d531df0efc3f4e85be6d69e5695831993430 Mon Sep 17 00:00:00 2001 From: Caleb Maclennan Date: Wed, 8 Nov 2023 13:08:10 +0300 Subject: ci: Identify CI jobs better and skip irrelevant platform specific steps --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to '.github/workflows') diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 432bafb..6d119d0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,7 +8,7 @@ on: jobs: build: - name: Test build on ${{ matrix.platform }} + name: Test ${{ matrix.luaVersion }} on ${{ matrix.platform }} strategy: fail-fast: false matrix: @@ -17,10 +17,10 @@ jobs: runs-on: ${{ matrix.platform }} steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup ’msvc’ + if: ${{ startsWith(matrix.platform, 'windows') && !startsWith(matrix.luaVersion, 'luajit') }} uses: ilammy/msvc-dev-cmd@v1 - if: ${{ !startsWith(matrix.luaVersion, 'luajit') }} - name: Setup ‘lua’ uses: leso-kn/gh-actions-lua@v11-staging with: -- cgit v1.2.3-55-g6feb From 43a97b7f0053313b43906371dbdc226271e6c8ab Mon Sep 17 00:00:00 2001 From: Caleb Maclennan Date: Wed, 8 Nov 2023 13:14:04 +0300 Subject: ci: Update Luacheck to v1+, use newer Ubuntu runner images --- .github/workflows/build.yml | 2 +- .github/workflows/luacheck.yml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to '.github/workflows') diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6d119d0..49c2c73 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,7 +13,7 @@ jobs: fail-fast: false matrix: luaVersion: [ "5.4", "5.3", "5.2", "5.1", "luajit", "luajit-openresty" ] - platform: [ "ubuntu-20.04", "macos-11", "windows-2022" ] + platform: [ "ubuntu-22.04", "macos-11", "windows-2022" ] runs-on: ${{ matrix.platform }} steps: - name: Checkout diff --git a/.github/workflows/luacheck.yml b/.github/workflows/luacheck.yml index 2f20456..9cb784c 100644 --- a/.github/workflows/luacheck.yml +++ b/.github/workflows/luacheck.yml @@ -5,9 +5,9 @@ on: [push, pull_request] jobs: luacheck: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Luacheck - uses: lunarmodules/luacheck@v0 + uses: lunarmodules/luacheck@v1 -- cgit v1.2.3-55-g6feb