name: CI on: push: branches: [master] workflow_dispatch: jobs: build: runs-on: ubuntu-latest continue-on-error: ${{ matrix.experimental }} strategy: matrix: ghc: ['8.8', '8.10', '9.0'] cabal: ['3.10'] nginx: [1.22.1] include: - experimental: false - ghc: '9.14' cabal: head nginx: head experimental: true allownewer: true - ghc: '9.14' cabal: '3.16' nginx: freenginx-head experimental: true allownewer: true - ghc: '9.14' cabal: '3.16' nginx: 1.28.1 experimental: true allownewer: true - ghc: '9.12' cabal: '3.16' nginx: 1.28.1 experimental: false - ghc: '9.10' cabal: '3.14' nginx: 1.26.3 experimental: false - ghc: '9.8' cabal: '3.12' nginx: 1.26.3 experimental: false - ghc: '9.6' cabal: '3.12' nginx: 1.24.0 experimental: false - ghc: '9.4' cabal: '3.10' nginx: 1.24.0 experimental: false - ghc: '9.2' cabal: '3.10' nginx: 1.24.0 experimental: false steps: - name: Checkout uses: actions/checkout@v6 - name: Install GHC and Cabal uses: haskell-actions/setup@v2 with: ghc-version: ${{ matrix.ghc }} cabal-version: ${{ matrix.cabal }} cabal-update: true - name: Install prove uses: perl-actions/install-with-cpanm@v1.7 with: install: "Test::Nginx" tests: false - name: Build Nginx modules env: NGXVER: ${{ matrix.nginx }} JSMN_REV: 25647e692c7906b96ffd2b05ca54c097948e879c UPCONF_MODULE_PATH: examples/dynamicUpstreams/nginx-upconf-module run: | if [ "$NGXVER" = head ] then git clone https://github.com/nginx/nginx.git nginx-head elif [ "$NGXVER" = freenginx-head ] then hg clone http://freenginx.org/hg/nginx nginx-freenginx-head else wget http://nginx.org/download/nginx-"$NGXVER".tar.gz && tar xzvf nginx-"$NGXVER".tar.gz fi sudo wget -P /usr/include \ https://raw.githubusercontent.com/zserge/jsmn/"$JSMN_REV"/jsmn.h git clone https://github.com/openresty/echo-nginx-module.git cd nginx-"$NGXVER" if [ "$NGXVER" = head ] || [ "$NGXVER" = freenginx-head ] then NGX_CONFIGURE=./auto/configure else NGX_CONFIGURE=./configure fi $NGX_CONFIGURE --add-module=.. \ --add-module=../aliases \ --add-module=../"$UPCONF_MODULE_PATH" \ --add-module=../echo-nginx-module make -j2 echo "$(pwd)/objs" >> "$GITHUB_PATH" - name: Build Haskell modules env: ALLOW_NEWER: ${{ matrix.allownewer && '--allow-newer=all' || '' }} run: | cabal --version echo "$(ghc --version) "` `"[$(ghc --print-project-git-commit-id 2>/dev/null || echo '?')]" cd haskell/ngx-export cabal build $ALLOW_NEWER cabal sdist cd - cd haskell/ngx-export-tools echo 'packages: ngx-export-tools.cabal '` `'../ngx-export/ngx-export.cabal' > cabal.project cabal build $ALLOW_NEWER cabal sdist cd - cd haskell/ngx-export-distribution cabal build $ALLOW_NEWER cabal sdist - name: Build and run tests env: GHCVER: ${{ matrix.ghc }} TOPDIR: ${{ github.workspace }} run: | cd test cd t if [ "${{ matrix.allownewer }}" = true ] then echo "allow-newer: all" >> cabal.project fi echo "$GHCVER" | grep -q '^8\.' && LINKRTS="LINKRTS=-lHSrts_thr-ghc$(ghc --numeric-version)" make PREFIX="$TOPDIR/var/lib/nginx" $LINKRTS make PREFIX="$TOPDIR/var/lib/nginx" $LINKRTS install cd - sed -i "s'/var/lib/nginx'$TOPDIR&'" t/basic.t prove t/basic.t