ci: unify workflow files #1
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 | |
- name: Install XMLua | |
run: | | |
brew update | |
brew bundle | |
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) | |
git clone --depth 1 https://github.com/clear-code/luacs.git ../luacs | |
- name: Test | |
run: | | |
test/run-test.lua | |
luajit -e 'package.path = "../luacs/?.lua;" .. package.path' \ | |
sample/parse-html-cqueues-thread.lua sample/sample.html |