1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- name: "build-and-test"
- on: [push, pull_request]
- env:
- ACTIONS_ALLOW_UNSECURE_COMMANDS: true # required for leafo/gh-actions-lua
- jobs:
- macOS:
- runs-on: "macos-latest"
- timeout-minutes: 30
- steps:
- - uses: actions/checkout@v2
- - uses: leafo/gh-actions-lua@v7
- with:
- luaVersion: "5.1.5"
- - run: |
- export MACOSX_DEPLOYMENT_TARGET=10.7
- 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
- cd ./build
- xcodebuild -configuration Release derivedDataPath Build
- mv Build/Release/libhttps.so Build/Release/https.so
- cd Build/Release
- lua -l "https" -e "assert(require('https').request('https://httpbin.org/post', {method='post', data='lotsa=data'}) == 200)"
- - uses: actions/upload-artifact@v2
- with:
- name: https-macos.zip
- path: build/Build/**/https.so
- Linux:
- runs-on: "ubuntu-20.04"
- timeout-minutes: 30
- steps:
- - uses: actions/checkout@v2
- - name: Build and test
- run: |
- # install dependencies
- sudo apt-get install -y cmake lua5.1 liblua5.1-0-dev luajit libluajit-5.1-dev libcurl4-openssl-dev g++ libssl-dev
-
- # build
- cmake -S . -B ./build
- cd build
- make
- cd ..
- cp build/src/libhttps.so ./https.so
-
- # Test
- lua -l "https" -e "assert(require('https').request('https://httpbin.org/post', {method='post', data='lotsa=data'}) == 200)"
- luajit -l "https" -e "assert(require('https').request('https://httpbin.org/post', {method='post', data='lotsa=data'}) == 200)"
- - uses: actions/upload-artifact@v2
- with:
- name: https-ubuntu.zip
- path: https.so
- Windows:
- runs-on: "windows-latest"
- timeout-minutes: 30
- steps:
- - uses: actions/checkout@v2
- - uses: carlosperate/[email protected]
- with:
- file-url: "https://master.dl.sourceforge.net/project/luabinaries/5.1.5/Windows%20Libraries/Dynamic/lua-5.1.5_Win64_dll14_lib.zip"
- file-name: "lua51.zip"
- - uses: carlosperate/[email protected]
- with:
- file-url: "https://iweb.dl.sourceforge.net/project/luabinaries/5.1.5/Tools%20Executables/lua-5.1.5_Win64_bin.zip"
- file-name: "lua51bin.zip"
- - run: |
- 7z x lua51.zip -o${{ runner.workspace }}/lua-51
- 7z x lua51bin.zip -o${{ runner.workspace }}/lua-51/bin
- - uses: ashutoshvarma/action-cmake-build@master
- with:
- build-dir: ${{ runner.workspace }}/build
- build-type: Release
- # Extra options pass to cmake while configuring project
- configure-options: "-H. -A x64 -T v140 -DLUA_INCLUDE_DIR=${{ runner.workspace }}/lua-51/include -DLUA_LIBRARIES=${{ runner.workspace }}/lua-51/lua5.1.lib"
- - run: |
- cd ${{ runner.workspace }}/build/src/Release
- ${{ runner.workspace }}/lua-51/bin/lua5.1.exe -l "https" -e "assert(require('https').request('https://httpbin.org/post', {method='post', data='lotsa=data'}) == 200)"
- - uses: actions/upload-artifact@v2
- with:
- name: https-windows.zip
- path: ${{ runner.workspace }}/build/src/**/https.dll
|