CI: remove all Cabal v1-commands #57
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: CI | |
on: | |
push: | |
branches: [master] | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
continue-on-error: ${{ matrix.experimental }} | |
strategy: | |
matrix: | |
ghc: ['8.2', '8.4', '8.6', '8.8', '8.10', '9.0'] | |
cabal: ['3.8'] | |
nginx: [1.18.0] | |
nginx-haskell-module: [3.2.2] | |
experimental: [false] | |
include: | |
- ghc: '9.8' | |
cabal: '3.10' | |
nginx: 1.24.0 | |
nginx-haskell-module: head | |
experimental: false | |
- ghc: '9.8' | |
cabal: '3.10' | |
nginx: head | |
nginx-haskell-module: head | |
experimental: true | |
- ghc: '9.6' | |
cabal: '3.10' | |
nginx: 1.22.1 | |
nginx-haskell-module: head | |
experimental: false | |
- ghc: '9.6' | |
cabal: '3.10' | |
nginx: head | |
nginx-haskell-module: head | |
experimental: true | |
- ghc: '9.4' | |
cabal: '3.8' | |
nginx: 1.22.0 | |
nginx-haskell-module: head | |
experimental: false | |
- ghc: '9.2' | |
cabal: '3.8' | |
nginx: 1.20.2 | |
nginx-haskell-module: head | |
experimental: false | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install GHC and Cabal | |
uses: haskell-actions/setup@v2 | |
with: | |
ghc-version: ${{ matrix.ghc }} | |
cabal-version: ${{ matrix.cabal }} | |
- name: Install prove | |
uses: perl-actions/install-with-cpanm@v1.5 | |
with: | |
install: "Test::Nginx" | |
tests: false | |
- name: Install and test | |
env: | |
GHCVER: ${{ matrix.ghc }} | |
NGXVER: ${{ matrix.nginx }} | |
CABALVER: ${{ matrix.cabal }} | |
NGXHMVER: ${{ matrix.nginx-haskell-module }} | |
run: | | |
cabal --version | |
echo "$(ghc --version) "` | |
`"[$(ghc --print-project-git-commit-id 2>/dev/null || echo '?')]" | |
cabal update | |
if [ "$NGXVER" = head ] | |
then | |
git clone https://github.com/nginx/nginx.git nginx-head | |
else | |
wget http://nginx.org/download/nginx-${NGXVER}.tar.gz && | |
tar xzvf nginx-${NGXVER}.tar.gz | |
fi | |
if [ "$NGXHMVER" = head ] | |
then | |
git clone https://github.com/lyokha/nginx-haskell-module.git \ | |
nginx-haskell-module-head | |
else | |
wget "https://github.com/lyokha/nginx-haskell-module/"` | |
`"archive/refs/tags/${NGXHMVER}.tar.gz" \ | |
-O nginx-haskell-module-${NGXHMVER}.tar.gz && | |
tar xzvf nginx-haskell-module-${NGXHMVER}.tar.gz | |
fi | |
git clone https://github.com/openresty/echo-nginx-module.git | |
export TEST_NGINX_LLIB_DIR="$(pwd)/var/lib/nginx" | |
install -d "$TEST_NGINX_LLIB_DIR" | |
cd nginx-${NGXVER}/ | |
if [ "$NGXVER" = head ] | |
then | |
NGX_CONFIGURE=./auto/configure | |
else | |
NGX_CONFIGURE=./configure | |
fi | |
$NGX_CONFIGURE --add-module=../nginx-haskell-module-${NGXHMVER} \ | |
--add-module=../echo-nginx-module \ | |
--add-dynamic-module=.. \ | |
--add-dynamic-module=../module | |
make -j2 | |
cp objs/ngx_log_plugin.so "$TEST_NGINX_LLIB_DIR/libngx_log_plugin.so" | |
export NGX_MODULE_PATH="$(pwd)/objs" | |
export PATH="$NGX_MODULE_PATH:$PATH" | |
export TEST_NGINX_LOAD_MODULES="$NGX_MODULE_PATH/ngx_log_plugin_module.so" | |
cd - | |
echo "$GHCVER" | grep -q '^8\.' && | |
LINKRTS="LINKRTS=-lHSrts_thr-ghc$(ghc --numeric-version)" | |
cd simple | |
sed -i 's/^packages: .\+/& ..\/ngx-export-log.cabal/' cabal.project | |
# FIXME: the following constraints mitigate transient inconsistencies | |
# on Hackage! | |
echo 'constraints: filepath < 1.5' >> cabal.project | |
make PREFIX="$TEST_NGINX_LLIB_DIR" INPLACE=1 $LINKRTS | |
make PREFIX="$TEST_NGINX_LLIB_DIR" install | |
cd - | |
cd test | |
LD_LIBRARY_PATH="$NGX_MODULE_PATH" prove -r t | |
cd - | |