ci: use actions/checkout for LuaCS #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test | |
on: | |
- push | |
- pull_request | |
jobs: | |
linux: | |
name: Linux | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- centos-7 | |
- almalinux-8 | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install XMLua | |
run: | | |
docker build \ | |
-t clear-code/xmlua-${{ matrix.os }} \ | |
-f dockerfiles/Dockerfile.${{ matrix.os }} \ | |
. | |
- name: Test | |
run: | | |
docker run \ | |
clear-code/xmlua-${{ matrix.os }} | |
macos: | |
name: macOS | |
strategy: | |
fail-fast: false | |
runs-on: macos-latest | |
timeout-minutes: 5 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
path: "xmlua" | |
- uses: actions/checkout@v4 | |
with: | |
repository: "clear-code/luacs" | |
path: "luacs" | |
- name: Install dependencies | |
run: | | |
brew bundle | |
- name: Install XMLua | |
run: | | |
cd xmlua | |
LUAROCKS="sudo -H luarocks --tree=$(brew --prefix) --lua-dir=$(brew --prefix luajit)" | |
VERSION=$(grep VERSION xmlua.lua | sed -e 's/.*"\(.*\)"/\1/g') | |
cp xmlua.rockspec xmlua-${VERSION}-0.rockspec | |
${LUAROCKS} make xmlua-${VERSION}-0.rockspec LIBXML2_DIR=$(brew --prefix libxml2) | |
rm -rf xmlua.lua xmlua | |
${LUAROCKS} install luaunit | |
${LUAROCKS} install cqueues \ | |
CRYPTO_DIR=$(brew --prefix openssl) \ | |
OPENSSL_DIR=$(brew --prefix openssl) | |
- name: Test | |
run: | | |
cd xmlua | |
test/run-test.lua | |
luajit -e 'package.path = "../luacs/?.lua;" .. package.path' \ | |
sample/parse-html-cqueues-thread.lua sample/sample.html |