Skip to content

Winio

Winio #131

Workflow file for this run

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@v3
- name: install autoconf
run: |
apt-get update -y -qq
apt-get install -y -qq build-essential autoconf${{ env.autoconf_ver }}
- name: run autoreconf
run: |
autoreconf${{ env.autoconf_ver }} -fi
- uses: actions/upload-artifact@v3
with:
name: configure
path: |
configure
include/HsNetworkConfig.h.in
sdist:
runs-on: ubuntu-latest
needs: autoconf
steps:
- uses: actions/checkout@v3
- uses: haskell/actions/setup@v2
with:
cabal-version: '3.4'
- uses: actions/download-artifact@v3
with:
name: configure
- name: run sdist
run: |
cabal sdist
- uses: actions/upload-artifact@v3
with:
name: dist-tarball
path: dist-newstyle/sdist/network-*
- name: Release
uses: softprops/action-gh-release@v1
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: [ '9.0', '9.2', '9.4', '9.6' ]
steps:
- uses: actions/checkout@v3
- uses: haskell/actions/setup@v2
id: setup
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: latest
cabal-update: true
- uses: actions/download-artifact@v3
with:
name: configure
- name: Haskell versions
shell: bash
run: |
echo "GHC_VERSION=$(ghc --numeric-version)" >> "${GITHUB_ENV}"
echo "CABAL_VERSION=$(cabal --numeric-version)" >> "${GITHUB_ENV}"
- name: Cabal configure
run: |
cabal configure --enable-tests --disable-benchmarks --disable-documentation
- name: Cache (restore)
uses: actions/cache/restore@v3
id: cache
with:
path: ${{ steps.setup.outputs.cabal-store }}
key: build-${{ runner.os }}-ghc-${{ env.GHC_VERSION }}-cabal-${{ env.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-${{ env.GHC_VERSION }}-cabal-${{ env.CABAL_VERSION }}-
build-${{ runner.os }}-ghc-${{ env.GHC_VERSION }}-
- name: Install dependencies
run: |
cabal build --only-dependencies
- name: Cache (save)
uses: actions/cache/save@v3
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