-
Notifications
You must be signed in to change notification settings - Fork 18
115 lines (112 loc) · 3.43 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
name: "Build & Test"
on: [push, pull_request]
jobs:
macOS:
runs-on: macos-latest
timeout-minutes: 30
env:
MACOSX_DEPLOYMENT_TARGET: "10.9"
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Lua 5.1
uses: leafo/gh-actions-lua@v9.1.0
with:
luaVersion: "5.1.5"
- name: Configure
run: cmake -Bbuild -S. -G Xcode -DLUA_INCLUDE_DIR=$PWD/.lua/include -DLUA_LIBRARIES=$PWD/.lua/lib/liblua.a
- name: Build
working-directory: build
run: xcodebuild -configuration Release -scheme https
- name: Test
working-directory: ./build/src/Release
run: lua -l "https" ../../../example/test.lua
- name: Artifact
if: always()
uses: actions/upload-artifact@v3
with:
name: https-macos.zip
path: build/src/**/https.so
Linux:
name: ${{ matrix.mode.name }}
runs-on: ubuntu-20.04
timeout-minutes: 30
strategy:
matrix:
mode:
- name: Linux cURL
curl: 1
openssl: 0
artifact: 0
- name: Linux OpenSSL
curl: 0
openssl: 1
artifact: 0
- name: Linux cURL & OpenSSL
curl: 1
openssl: 1
artifact: 1
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Update APT Repository
run: sudo apt-get update
- name: Install Dependencies
run: sudo apt-get install -y lua5.1 luajit liblua5.1-0-dev libcurl4-openssl-dev g++ libssl-dev
- name: Configure
run: cmake -Bbuild -S. -DCMAKE_INSTALL_PREFIX=$PWD/install -DCMAKE_BUILD_TYPE=Release -DUSE_CURL_BACKEND=${{ matrix.mode.curl }} -DUSE_OPENSSL_BACKEND=${{ matrix.mode.openssl }}
- name: Build
run: cmake --build build --config Release --target install -j$(nproc)
- name: Test (Lua)
if: matrix.mode.artifact == 0
working-directory: ./install
run: lua -l "https" ../example/test.lua
- name: Test (LuaJIT)
if: matrix.mode.artifact == 0
working-directory: ./install
run: luajit -l "https" ../example/test.lua
- name: Artifact
if: matrix.mode.artifact == 1
uses: actions/upload-artifact@v3
with:
name: https-ubuntu.zip
path: install/https.so
Windows:
runs-on: windows-latest
strategy:
matrix:
arch:
- Win32
- x64
defaults:
run:
shell: cmd
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Download LuaJIT
uses: actions/checkout@v3
with:
repository: LuaJIT/LuaJIT
ref: v2.1
path: LuaJIT
- name: Configure MSVC Developer Command Prompt
uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ matrix.arch }}
- name: Compile LuaJIT
working-directory: ./LuaJIT/src
run: msvcbuild.bat amalg
- name: Configure
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
- name: Build
run: cmake --build build --config Release --target install
- name: Test
working-directory: ./install
run: ..\LuaJIT\src\luajit ..\example\test.lua
- name: Artifact
if: always()
uses: actions/upload-artifact@v3
with:
name: https-windows-${{ matrix.arch }}.zip
path: install/https.dll