Merge pull request #585 from kazu-yamamoto/sockaddr-unix-length-check #170
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: Haskell CI | |
on: | |
push: | |
branches: [ 'master', 'ci' ] | |
pull_request: | |
branches: [ 'master' ] | |
# env: | |
# autoconf_ver: 2.69 | |
jobs: | |
autoconf: | |
runs-on: ubuntu-latest | |
# container: ubuntu:22.10 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: install autoconf | |
run: | | |
sudo apt-get update -y -qq | |
sudo apt-get install -y -qq build-essential autoconf${{ env.autoconf_ver }} | |
- name: run autoreconf | |
run: | | |
autoreconf${{ env.autoconf_ver }} -fi | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: configure | |
path: | | |
configure | |
include/HsNetworkConfig.h.in | |
sdist: | |
runs-on: ubuntu-latest | |
needs: autoconf | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: haskell-actions/setup@v2 | |
with: | |
cabal-version: 'latest' | |
- uses: actions/download-artifact@v4 | |
with: | |
name: configure | |
- name: run sdist | |
run: | | |
cabal sdist | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: dist-tarball | |
path: dist-newstyle/sdist/network-* | |
- name: Release | |
uses: softprops/action-gh-release@v2 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: dist-newstyle/sdist/network-* | |
build: | |
runs-on: ${{ matrix.os }} | |
needs: autoconf | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ 'ubuntu-latest', 'macOS-latest', 'windows-latest' ] | |
ghc: [ '8.4', '9.4', '9.6', '9.8' ] | |
# Dependency hsc2hs does not build on Windows with GHC < 8.4 | |
# so we test 8.4 as lowest. | |
# See https://github.com/haskell/hsc2hs/issues/81 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: haskell-actions/setup@v2 | |
id: setup | |
with: | |
ghc-version: ${{ matrix.ghc }} | |
cabal-version: latest | |
cabal-update: true | |
- uses: actions/download-artifact@v4 | |
with: | |
name: configure | |
- name: Cabal configure | |
run: | | |
cabal configure --enable-tests --disable-benchmarks --disable-documentation | |
- name: Cache (restore) | |
uses: actions/cache/restore@v4 | |
id: cache | |
with: | |
path: ${{ steps.setup.outputs.cabal-store }} | |
key: build-${{ runner.os }}-ghc-${{ steps.setup.outputs.ghc-version }}-cabal-${{ steps.setup.outputs.cabal-version }}-sha-${{ github.sha }} | |
# Append commit SHA so that new cache is always written. | |
# This is fine as long as we do not hit the total cache limit of 10GB. | |
restore-keys: | | |
build-${{ runner.os }}-ghc-${{ steps.setup.outputs.ghc-version }}-cabal-${{ steps.setup.outputs.cabal-version }}- | |
build-${{ runner.os }}-ghc-${{ steps.setup.outputs.ghc-version }}- | |
- name: Install dependencies | |
run: | | |
cabal build --only-dependencies | |
- name: Cache (save) | |
uses: actions/cache/save@v4 | |
if: always() | |
with: | |
path: ${{ steps.setup.outputs.cabal-store }} | |
key: ${{ steps.cache.outputs.cache-primary-key }} | |
- name: Build | |
run: | | |
cabal build all | |
- name: Run tests | |
run: | | |
cabal test --test-show-details=streaming | |
- name: Run doctest | |
if: ${{ runner.os == 'Linux' }} | |
run: | | |
cabal install doctest --overwrite-policy=always | |
cabal repl --build-depends=QuickCheck --with-ghc=doctest | |
- name: Cabal check | |
run: | | |
cabal check | |
- name: Haddock | |
run: | | |
cabal haddock --disable-documentation | |
# check windows can generate autoconf too | |
- uses: msys2/setup-msys2@v2 | |
if: ${{ runner.os == 'Windows' }} | |
with: | |
update: true | |
install: autoconf | |
- name: Autoreconf (Windows) | |
if: ${{ runner.os == 'Windows' }} | |
shell: msys2 {0} | |
run: | | |
rm configure include/HsNetworkConfig.h.in | |
autoreconf -i | |
- name: Build (Windows) | |
if: ${{ runner.os == 'Windows' }} | |
run: | | |
cabal clean | |
cabal build --enable-tests --disable-benchmarks all |