1
- name : " build-and-test "
1
+ name : " Build & Test "
2
2
on : [push, pull_request]
3
3
4
- env :
5
- ACTIONS_ALLOW_UNSECURE_COMMANDS : true # required for leafo/gh-actions-lua
6
-
7
4
jobs :
8
5
macOS :
9
- runs-on : " macos-latest"
6
+ runs-on : macos-latest
10
7
timeout-minutes : 30
8
+ env :
9
+ MACOSX_DEPLOYMENT_TARGET : " 10.9"
11
10
steps :
12
- - uses : actions/checkout@v2
13
- - uses : leafo/gh-actions-lua@v7
11
+ - name : Checkout
12
+ uses : actions/checkout@v3
13
+ - name : Install Lua 5.1
14
+
14
15
with :
15
16
luaVersion : " 5.1.5"
16
- - run : |
17
- export MACOSX_DEPLOYMENT_TARGET=10.9
18
- cmake -G Xcode -S . -B ./build -DLUA_INCLUDE_DIR=${{ runner.workspace }}/lua-https/.lua/include -DLUA_LIBRARIES=${{ runner.workspace }}/lua-https/.lua/lib/liblua.a
19
- cd ./ build
20
- xcodebuild -configuration Release -scheme https
21
-
22
- cd src/Release
23
- lua -l "https" -e "assert(require('https').request('https://httpbin.org/post', {method='post', data='lotsa=data'}) == 200)"
24
- - uses : actions/upload-artifact@v2
17
+ - name : Configure
18
+ run : cmake -Bbuild -S. -G Xcode -DLUA_INCLUDE_DIR=$PWD/.lua/include -DLUA_LIBRARIES=$PWD/.lua/lib/liblua.a
19
+ - name : Build
20
+ working-directory : build
21
+ run : xcodebuild -configuration Release -scheme https
22
+ - name : Test
23
+ working-directory : ./build/ src/Release
24
+ run : lua -l "https" -e "assert(require('https').request('https://httpbin.org/post', {method='post', data='lotsa=data'}) == 200)"
25
+ - uses : actions/upload-artifact@v3
25
26
with :
26
27
name : https-macos.zip
27
28
path : build/src/**/https.so
28
29
29
30
Linux :
30
- runs-on : " ubuntu-20.04 "
31
+ runs-on : ubuntu-latest
31
32
timeout-minutes : 30
32
33
steps :
33
- - uses : actions/checkout@v2
34
- - name : Build and test
35
- run : |
36
- # install dependencies
37
- sudo apt-get install -y cmake lua5.1 liblua5.1-0-dev luajit libluajit-5.1-dev libcurl4-openssl-dev g++ libssl-dev
38
-
39
- # build
40
- cmake -S . -B ./build
41
- cd build
42
- make
43
- cd ..
44
- cp build/src/https.so ./https.so
45
-
46
- # Test
47
- lua -l "https" -e "assert(require('https').request('https://httpbin.org/post', {method='post', data='lotsa=data'}) == 200)"
48
- luajit -l "https" -e "assert(require('https').request('https://httpbin.org/post', {method='post', data='lotsa=data'}) == 200)"
49
- - uses : actions/upload-artifact@v2
34
+ - name : Checkout
35
+ uses : actions/checkout@v3
36
+ - name : Update APT Repository
37
+ run : sudo apt-get update
38
+ - name : Install Dependencies
39
+ run : sudo apt-get install -y lua5.1 luajit liblua5.1-0-dev libcurl4-openssl-dev g++ libssl-dev
40
+ - name : Configure
41
+ run : cmake -Bbuild -S. -DCMAKE_INSTALL_PREFIX=$PWD/install -DCMAKE_BUILD_TYPE=RelWithDebInfo
42
+ - name : Build
43
+ run : cmake --build build --config RelWithDebInfo --target install -j$(nproc)
44
+ - name : Test (Lua)
45
+ working-directory : ./install
46
+ run : lua -l "https" -e "assert(require('https').request('https://httpbin.org/post', {method='post', data='lotsa=data'}) == 200)"
47
+ - name : Test (LuaJIT)
48
+ working-directory : ./install
49
+ run : luajit -l "https" -e "assert(require('https').request('https://httpbin.org/post', {method='post', data='lotsa=data'}) == 200)"
50
+ - name : Artifact
51
+ uses : actions/upload-artifact@v3
50
52
with :
51
53
name : https-ubuntu.zip
52
- path : https.so
54
+ path : install/ https.so
53
55
54
56
Windows :
55
- runs-on : " windows-2019 "
57
+ runs-on : windows-latest
56
58
strategy :
57
59
matrix :
58
60
arch :
@@ -67,24 +69,19 @@ jobs:
67
69
repository : LuaJIT/LuaJIT
68
70
ref : v2.1
69
71
path : LuaJIT
72
+ - name : Configure MSVC Developer Command Prompt
73
+ uses : ilammy/msvc-dev-cmd@v1
74
+ with :
75
+ arch : ${{ matrix.arch }}
70
76
- name : Compile LuaJIT
71
77
shell : cmd
78
+ working-directory : ./LuaJIT/src
72
79
env :
73
80
BUILD_ARCH : ${{ matrix.arch }}
74
- run : |
75
- rem Compile LuaJIT using MSVC Command Prompt
76
- rem https://github.com/actions/virtual-environments/blob/main/images/win/Windows2019-Readme.md#visual-studio-enterprise-2019
77
- set VCBT="C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat"
78
- if %BUILD_ARCH% == Win32 (
79
- call %VCBT% x86
80
- ) else (
81
- call %VCBT% x86_amd64
82
- )
83
- cd LuaJIT\src
84
- msvcbuild.bat amalg
81
+ run : msvcbuild.bat amalg
85
82
- name : Configure
86
83
shell : cmd
87
- run : cmake -Bbuild -S. -DCMAKE_INSTALL_PREFIX=%CD%\install -T v142 - A ${{ matrix.arch }} -DLUA_INCLUDE_DIR=%CD%\LuaJIT\src -DLUA_LIBRARIES=%CD%\LuaJIT\src\lua51.lib
84
+ run : cmake -Bbuild -S. -DCMAKE_INSTALL_PREFIX=%CD%\install -A ${{ matrix.arch }} -DLUA_INCLUDE_DIR=%CD%\LuaJIT\src -DLUA_LIBRARIES=%CD%\LuaJIT\src\lua51.lib
88
85
- name : Build
89
86
shell : cmd
90
87
run : cmake --build build --config Release --target install
93
90
run : copy /y install\https.dll LuaJIT\src\https.dll
94
91
- name : Test
95
92
shell : cmd
96
- run : cd LuaJIT\src && luajit ..\..\example\example.lua
97
- - uses : actions/upload-artifact@v2
93
+ working-directory : ./LuaJIT/src
94
+ run : luajit ..\..\example\example.lua
95
+ - name : Artifact
96
+ uses : actions/upload-artifact@v3
98
97
with :
99
98
name : https-windows-${{ matrix.arch }}.zip
100
- path : install\ https.dll
99
+ path : install/ https.dll
0 commit comments