Update github actions, add new lts to tests (#124)

This commit is contained in:
Adam Wespiser
2021-11-17 09:17:40 -05:00
committed by GitHub
parent e613ed4dd2
commit f162c21d1b
8 changed files with 221 additions and 160 deletions
+26 -21
View File
@@ -1,31 +1,36 @@
name: Cabal CI
on:
push:
branches:
- master
pull_request:
types:
- opened
- synchronize
jobs:
build:
name: cabal-${{ matrix.cabal}} ${{ matrix.ghc }}
runs-on: ubuntu-16.04
runs-on: ubuntu-latest
strategy:
matrix:
ghc: ["8.10.1", "8.8.1", "8.6.5", "8.6.4", "8.6.3", "8.6.2", "8.4.4", "8.2.2", "8.0.2"]
cabal: ["3.0", "3.2"]
env:
CONFIG: "--enable-tests --enable-benchmarks"
steps:
- uses: actions/checkout@v1
- uses: actions/setup-haskell@v1
name: Setup Haskell
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}
- name: Install dependencies
run: |
cabal update
- name: Build
run: |
cabal new-build
- uses: actions/checkout@v2
- uses: haskell/actions/setup@v1.2
id: setup-haskell-cabal
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}
- run: cabal v2-update
- run: cabal v2-freeze $CONFIG
- uses: actions/cache@v2
with:
path: |
${{ steps.setup-haskell-cabal.outputs.cabal-store }}
dist-newstyle
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }}
restore-keys: |
${{ runner.os }}-${{ matrix.ghc }}-
- run: cabal v2-build $CONFIG
- run: cabal v2-test $CONFIG
- run: cabal v2-haddock $CONFIG
- run: cabal v2-sdist
+170
View File
@@ -0,0 +1,170 @@
# This GitHub workflow config has been generated by a script via
#
# haskell-ci 'github' 'protolude.cabal'
#
# To regenerate the script (for example after adjusting tested-with) run
#
# haskell-ci regenerate
#
# For more information, see https://github.com/haskell-CI/haskell-ci
#
# version: 0.12.1
#
# REGENDATA ("0.12.1",["github","protolude.cabal"])
#
name: Haskell-CI
on:
- pull_request
jobs:
linux:
name: Haskell-CI - Linux - ${{ matrix.compiler }}
runs-on: ubuntu-18.04
container:
image: buildpack-deps:bionic
continue-on-error: ${{ matrix.allow-failure }}
strategy:
matrix:
include:
- compiler: ghc-8.10.1
allow-failure: false
- compiler: ghc-8.8.1
allow-failure: false
- compiler: ghc-8.6.1
allow-failure: false
- compiler: ghc-8.4.1
allow-failure: false
fail-fast: false
steps:
- name: apt
run: |
apt-get update
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common
apt-add-repository -y 'ppa:hvr/ghc'
apt-get update
apt-get install -y $CC cabal-install-3.4
env:
CC: ${{ matrix.compiler }}
- name: Set PATH and environment variables
run: |
echo "$HOME/.cabal/bin" >> $GITHUB_PATH
echo "LANG=C.UTF-8" >> $GITHUB_ENV
echo "CABAL_DIR=$HOME/.cabal" >> $GITHUB_ENV
echo "CABAL_CONFIG=$HOME/.cabal/config" >> $GITHUB_ENV
HCDIR=$(echo "/opt/$CC" | sed 's/-/\//')
HCNAME=ghc
HC=$HCDIR/bin/$HCNAME
echo "HC=$HC" >> $GITHUB_ENV
echo "HCPKG=$HCDIR/bin/$HCNAME-pkg" >> $GITHUB_ENV
echo "HADDOCK=$HCDIR/bin/haddock" >> $GITHUB_ENV
echo "CABAL=/opt/cabal/3.4/bin/cabal -vnormal+nowrap" >> $GITHUB_ENV
HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')
echo "HCNUMVER=$HCNUMVER" >> $GITHUB_ENV
echo "ARG_TESTS=--enable-tests" >> $GITHUB_ENV
echo "ARG_BENCH=--enable-benchmarks" >> $GITHUB_ENV
echo "HEADHACKAGE=false" >> $GITHUB_ENV
echo "ARG_COMPILER=--$HCNAME --with-compiler=$HC" >> $GITHUB_ENV
echo "GHCJSARITH=0" >> $GITHUB_ENV
env:
CC: ${{ matrix.compiler }}
- name: env
run: |
env
- name: write cabal config
run: |
mkdir -p $CABAL_DIR
cat >> $CABAL_CONFIG <<EOF
remote-build-reporting: anonymous
write-ghc-environment-files: never
remote-repo-cache: $CABAL_DIR/packages
logs-dir: $CABAL_DIR/logs
world-file: $CABAL_DIR/world
extra-prog-path: $CABAL_DIR/bin
symlink-bindir: $CABAL_DIR/bin
installdir: $CABAL_DIR/bin
build-summary: $CABAL_DIR/logs/build.log
store-dir: $CABAL_DIR/store
install-dirs user
prefix: $CABAL_DIR
repository hackage.haskell.org
url: http://hackage.haskell.org/
EOF
cat $CABAL_CONFIG
- name: versions
run: |
$HC --version || true
$HC --print-project-git-commit-id || true
$CABAL --version || true
- name: update cabal index
run: |
$CABAL v2-update -v
- name: install cabal-plan
run: |
mkdir -p $HOME/.cabal/bin
curl -sL https://github.com/haskell-hvr/cabal-plan/releases/download/v0.6.2.0/cabal-plan-0.6.2.0-x86_64-linux.xz > cabal-plan.xz
echo 'de73600b1836d3f55e32d80385acc055fd97f60eaa0ab68a755302685f5d81bc cabal-plan.xz' | sha256sum -c -
xz -d < cabal-plan.xz > $HOME/.cabal/bin/cabal-plan
rm -f cabal-plan.xz
chmod a+x $HOME/.cabal/bin/cabal-plan
cabal-plan --version
- name: checkout
uses: actions/checkout@v2
with:
path: source
- name: initial cabal.project for sdist
run: |
touch cabal.project
echo "packages: $GITHUB_WORKSPACE/source/." >> cabal.project
cat cabal.project
- name: sdist
run: |
mkdir -p sdist
$CABAL sdist all --output-dir $GITHUB_WORKSPACE/sdist
- name: unpack
run: |
mkdir -p unpacked
find sdist -maxdepth 1 -type f -name '*.tar.gz' -exec tar -C $GITHUB_WORKSPACE/unpacked -xzvf {} \;
- name: generate cabal.project
run: |
PKGDIR_protolude="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/protolude-[0-9.]*')"
echo "PKGDIR_protolude=${PKGDIR_protolude}" >> $GITHUB_ENV
touch cabal.project
touch cabal.project.local
echo "packages: ${PKGDIR_protolude}" >> cabal.project
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo "package protolude" >> cabal.project ; fi
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
cat >> cabal.project <<EOF
EOF
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(protolude)$/; }' >> cabal.project.local
cat cabal.project
cat cabal.project.local
- name: dump install plan
run: |
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dry-run all
cabal-plan
- name: cache
uses: actions/cache@v2
with:
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
path: ~/.cabal/store
restore-keys: ${{ runner.os }}-${{ matrix.compiler }}-
- name: install dependencies
run: |
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --dependencies-only -j2 all
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dependencies-only -j2 all
- name: build w/o tests
run: |
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all
- name: build
run: |
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --write-ghc-environment-files=always
- name: cabal check
run: |
cd ${PKGDIR_protolude} || false
${CABAL} -vnormal check
- name: haddock
run: |
$CABAL v2-haddock $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all
- name: unconstrained build
run: |
rm -f cabal.project.local
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all
+20 -39
View File
@@ -5,46 +5,27 @@ on:
branches:
- master
pull_request:
branches: [ master ]
paths:
- '.github/workflows/hlint.yml'
- 'app/**/*.hs'
- 'src/**/*.hs'
- 'test/**/*.hs'
jobs:
build:
name: hlint
runs-on: ubuntu-16.04
strategy:
matrix:
ghc: ["8.8.1"]
cabal: ["3.0"]
hlint:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HLINT_ACTION_LOG_LEVEL: debug
steps:
- uses: actions/checkout@v1
- uses: actions/setup-haskell@v1
name: Setup Haskell
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}
- name: Check out
uses: actions/checkout@v2
- uses: actions/cache@v1
name: Cache ~/.cabal/packages
with:
path: ~/.cabal/packages
key: cabal-packages
- name: Set up HLint
uses: rwe/actions-hlint-setup@v1
- uses: actions/cache@v1
name: Cache ~/.cabal/store
with:
path: ~/.cabal/store
key: cabal-store
- uses: actions/cache@v1
name: Cache dist-newstyle
with:
path: dist-newstyle
key: dist-newstyle
- name: Install hlint
run: |
cabal update
cabal new-install hlint --installdir=dist-newstyle --overwrite-policy=always
- name: Run hlint
run: |
dist-newstyle/hlint -g
- name: Haskell Lint
uses: rwe/actions-hlint-run@v2
with:
path: '["src/"]'
fail-on: warning
+2
View File
@@ -8,4 +8,6 @@ jobs:
steps:
- uses: actions/checkout@v1
- uses: cachix/install-nix-action@v3
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
- run: nix-build
+2 -2
View File
@@ -1,7 +1,6 @@
name: Stack CI
on:
push:
pull_request:
schedule:
- cron: "0 0 * * 1"
@@ -22,7 +21,6 @@ jobs:
- { build: stack, resolver: "lts-14" } # ghc-8.6.5
- { build: stack, resolver: "lts-15" } # ghc-8.8.2
- { build: stack, resolver: "lts-16" } # ghc-8.10.1
- { build: stack, resolver: "nightly" }
# - { build: stack, resolver: "" }
# use this to include any dependencies from OS package managers
include: []
@@ -47,6 +45,8 @@ jobs:
- name: Setup stack
uses: mstksg/setup-stack@v1
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
- name: Setup cabal-install
uses: actions/setup-haskell@v1
-97
View File
@@ -1,97 +0,0 @@
# NB: don't set `language: haskell` here
language: c
# See also https://github.com/hvr/multi-ghc-travis for more information
# The following lines enable several GHC versions and/or HP versions
# to be tested; often it's enough to test only against the last
# release of a major GHC version. Setting HPVER implictly sets
# GHCVER. Omit lines with versions you don't need/want testing for.
env:
- CABALVER=1.16 GHCVER=7.6.1
- CABALVER=1.16 GHCVER=7.6.2
- CABALVER=1.18 GHCVER=7.6.3
- CABALVER=1.18 GHCVER=7.8.1
- CABALVER=1.18 GHCVER=7.8.2
- CABALVER=1.18 GHCVER=7.8.3
- CABALVER=1.18 GHCVER=7.8.4
- CABALVER=1.22 GHCVER=7.10.1
- CABALVER=1.22 GHCVER=7.10.2
- CABALVER=1.22 GHCVER=7.10.3
- CABALVER=1.24 GHCVER=8.0.1
- CABALVER=2.0 GHCVER=8.2.2
- CABALVER=2.2 GHCVER=8.4.1
- CABALVER=2.4 GHCVER=8.6.1
- CABALVER=2.4 GHCVER=8.8.1
# Note: the distinction between `before_install` and `install` is not
# important.
before_install:
- case "$HPVER" in
"") ;;
"2014.2.0.0")
export CABALVER=1.18 ;
export GHCVER=7.8.3 ;
echo "constraints:async==2.0.1.5,attoparsec==0.10.4.0,case-insensitive==1.1.0.3,fgl==5.5.0.1,GLUT==2.5.1.1,GLURaw==1.4.0.1,haskell-src==1.0.1.6,hashable==1.2.2.0,html==1.0.1.2,HTTP==4000.2.10,HUnit==1.2.5.2,mtl==2.1.3.1,network==2.4.2.3,OpenGL==2.9.2.0,OpenGLRaw==1.5.0.0,parallel==3.2.0.4,parsec==3.1.5,primitive==0.5.2.1,QuickCheck==2.6,random==1.0.1.1,regex-base==0.93.2,regex-compat==0.95.1,regex-posix==0.95.2,split==0.2.2,stm==2.4.2,syb==0.4.1,text==1.1.0.0,transformers==0.3.0.0,unordered-containers==0.2.4.0,vector==0.10.9.1,xhtml==3000.2.1,zlib==0.5.4.1" > cabal.config ;;
"2013.2.0.0")
export CABALVER=1.16 ;
export GHCVER=7.6.3 ;
echo "constraints:async==2.0.1.4,attoparsec==0.10.4.0,case-insensitive==1.0.0.1,cgi==3001.1.7.5,fgl==5.4.2.4,GLUT==2.4.0.0,GLURaw==1.3.0.0,haskell-src==1.0.1.5,hashable==1.1.2.5,html==1.0.1.2,HTTP==4000.2.8,HUnit==1.2.5.2,mtl==2.1.2,network==2.4.1.2,OpenGL==2.8.0.0,OpenGLRaw==1.3.0.0,parallel==3.2.0.3,parsec==3.1.3,QuickCheck==2.6,random==1.0.1.1,regex-base==0.93.2,regex-compat==0.95.1,regex-posix==0.95.2,split==0.2.2,stm==2.4.2,syb==0.4.0,text==0.11.3.1,transformers==0.3.0.0,unordered-containers==0.2.3.0,vector==0.10.0.1,xhtml==3000.2.1,zlib==0.5.4.1" > cabal.config ;;
"2012.4.0.0")
export CABALVER=1.16 ;
export GHCVER=7.6.2 ;
echo "constraints:async==2.0.1.3,cgi==3001.1.7.4,fgl==5.4.2.4,GLUT==2.1.2.1,haskell-src==1.0.1.5,html==1.0.1.2,HTTP==4000.2.5,HUnit==1.2.5.1,mtl==2.1.2,network==2.3.1.0,OpenGL==2.2.3.1,parallel==3.2.0.3,parsec==3.1.3,QuickCheck==2.5.1.1,random==1.0.1.1,regex-base==0.93.2,regex-compat==0.95.1,regex-posix==0.95.2,split==0.2.1.1,stm==2.4,syb==0.3.7,text==0.11.2.3,transformers==0.3.0.0,vector==0.10.0.1,xhtml==3000.2.1,zlib==0.5.4.0" > cabal.config ;;
"2012.2.0.0")
export CABALVER=1.16 ;
export GHCVER=7.4.1 ;
echo "constraints:cgi==3001.1.7.4,fgl==5.4.2.4,GLUT==2.1.2.1,haskell-src==1.0.1.5,html==1.0.1.2,HTTP==4000.2.3,HUnit==1.2.4.2,mtl==2.1.1,network==2.3.0.13,OpenGL==2.2.3.1,parallel==3.2.0.2,parsec==3.1.2,QuickCheck==2.4.2,random==1.0.1.1,regex-base==0.93.2,regex-compat==0.95.1,regex-posix==0.95.1,stm==2.3,syb==0.3.6.1,text==0.11.2.0,transformers==0.3.0.0,xhtml==3000.2.1,zlib==0.5.3.3" > cabal.config ;;
"2011.4.0.0")
export CABALVER=1.16 ;
export GHCVER=7.0.4 ;
echo "constraints:cgi==3001.1.7.4,fgl==5.4.2.4,GLUT==2.1.2.1,haskell-src==1.0.1.4,html==1.0.1.2,HUnit==1.2.4.2,network==2.3.0.5,OpenGL==2.2.3.0,parallel==3.1.0.1,parsec==3.1.1,QuickCheck==2.4.1.1,regex-base==0.93.2,regex-compat==0.95.1,regex-posix==0.95.1,stm==2.2.0.1,syb==0.3.3,xhtml==3000.2.0.4,zlib==0.5.3.1,HTTP==4000.1.2,deepseq==1.1.0.2" > cabal.config ;;
*)
export GHCVER=unknown ;
echo "unknown/invalid Haskell Platform requested" ;
exit 1 ;;
esac
- travis_retry sudo add-apt-repository -y ppa:hvr/ghc
- travis_retry sudo apt-get update
- travis_retry sudo apt-get install cabal-install-$CABALVER ghc-$GHCVER
- export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$PATH
install:
- cabal --version
- echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]"
- travis_retry cabal update
- cabal install --only-dependencies --enable-tests --enable-benchmarks
# Here starts the actual work to be performed for the package under
# test; any command which exits with a non-zero exit code causes the
# build to fail.
script:
- if [ -f configure.ac ]; then autoreconf -i; fi
# -v2 provides useful information for debugging
- cabal configure --enable-tests --enable-benchmarks -v2
# this builds all libraries and executables
# (including tests/benchmarks)
- cabal build
- cabal check
# tests that a source-distribution can be generated
- cabal sdist
# check that the generated source-distribution can be built & installed
- SRC_TGZ=$(cabal info . | awk '{print $2;exit}').tar.gz &&
(cd dist && cabal install --force-reinstalls "$SRC_TGZ")
# EOF
-1
View File
@@ -1,7 +1,6 @@
Protolude
=========
[![Build Status](https://travis-ci.org/protolude/protolude.svg?branch=master)](https://travis-ci.org/sdiehl/protolude)
[![Build Status](https://github.com/protolude/protolude/workflows/Cabal%20CI/badge.svg)](https://github.com/protolude/protolude/actions)
[![Build Status](https://github.com/protolude/protolude/workflows/Stack%20CI/badge.svg)](https://github.com/protolude/protolude/actions)
[![Build Status](https://github.com/protolude/protolude/workflows/Nix%20CI/badge.svg)](https://github.com/protolude/protolude/actions)
+1
View File
@@ -13,3 +13,4 @@ stack build --resolver lts-12.0
stack build --resolver lts-13.0
stack build --resolver lts-14.0
stack build --resolver lts-15.0
stack build --resolver lts-16.0