| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- 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/[email protected]
- 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" -e "assert(require('https').request('https://httpbin.org/post', {method='post', data='lotsa=data'}) == 200)"
- - uses: actions/upload-artifact@v3
- with:
- name: https-macos.zip
- path: build/src/**/https.so
- Linux:
- runs-on: ubuntu-latest
- timeout-minutes: 30
- 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=RelWithDebInfo
- - name: Build
- run: cmake --build build --config RelWithDebInfo --target install -j$(nproc)
- - name: Test (Lua)
- working-directory: ./install
- run: lua -l "https" -e "assert(require('https').request('https://httpbin.org/post', {method='post', data='lotsa=data'}) == 200)"
- - name: Test (LuaJIT)
- working-directory: ./install
- run: luajit -l "https" -e "assert(require('https').request('https://httpbin.org/post', {method='post', data='lotsa=data'}) == 200)"
- - name: Artifact
- uses: actions/upload-artifact@v3
- with:
- name: https-ubuntu.zip
- path: install/https.so
- Windows:
- runs-on: windows-latest
- strategy:
- matrix:
- arch:
- - Win32
- - x64
- 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
- shell: cmd
- working-directory: ./LuaJIT/src
- env:
- BUILD_ARCH: ${{ matrix.arch }}
- run: msvcbuild.bat amalg
- - name: Configure
- shell: cmd
- 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
- shell: cmd
- run: cmake --build build --config Release --target install
- - name: Copy https.dll For testing
- shell: cmd
- run: copy /y install\https.dll LuaJIT\src\https.dll
- - name: Test
- shell: cmd
- working-directory: ./LuaJIT/src
- run: luajit ..\..\example\example.lua
- - name: Artifact
- uses: actions/upload-artifact@v3
- with:
- name: https-windows-${{ matrix.arch }}.zip
- path: install/https.dll
|