Skip to content

Commit

Permalink
Updated CI
Browse files Browse the repository at this point in the history
  • Loading branch information
mmhat committed Jul 16, 2024
1 parent 1b64a48 commit a23e5c6
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 37 deletions.
64 changes: 32 additions & 32 deletions .github/workflows/haskell-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
#
# For more information, see https://github.com/haskell-CI/haskell-ci
#
# version: 0.17.20231004
# version: 0.19.20240708
#
# REGENDATA ("0.17.20231004",["github","cabal.project"])
# REGENDATA ("0.19.20240708",["github","cabal.project"])
#
name: Haskell-CI
on:
Expand All @@ -27,19 +27,29 @@ jobs:
timeout-minutes:
60
container:
image: buildpack-deps:bionic
image: buildpack-deps:jammy
continue-on-error: ${{ matrix.allow-failure }}
strategy:
matrix:
include:
- compiler: ghc-9.6.3
- compiler: ghc-9.10.1
compilerKind: ghc
compilerVersion: 9.6.3
compilerVersion: 9.10.1
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.4.7
- compiler: ghc-9.8.2
compilerKind: ghc
compilerVersion: 9.4.7
compilerVersion: 9.8.2
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.6.6
compilerKind: ghc
compilerVersion: 9.6.6
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.4.8
compilerKind: ghc
compilerVersion: 9.4.8
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.2.8
Expand All @@ -64,11 +74,10 @@ jobs:
apt-get update
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5
mkdir -p "$HOME/.ghcup/bin"
curl -sL https://downloads.haskell.org/ghcup/0.1.19.5/x86_64-linux-ghcup-0.1.19.5 > "$HOME/.ghcup/bin/ghcup"
curl -sL https://downloads.haskell.org/ghcup/0.1.30.0/x86_64-linux-ghcup-0.1.30.0 > "$HOME/.ghcup/bin/ghcup"
chmod a+x "$HOME/.ghcup/bin/ghcup"
"$HOME/.ghcup/bin/ghcup" config add-release-channel https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-prereleases-0.0.7.yaml;
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
"$HOME/.ghcup/bin/ghcup" install cabal 3.12.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
env:
HCKIND: ${{ matrix.compilerKind }}
HCNAME: ${{ matrix.compiler }}
Expand All @@ -86,7 +95,7 @@ jobs:
echo "HC=$HC" >> "$GITHUB_ENV"
echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.1.0 -vnormal+nowrap" >> "$GITHUB_ENV"
echo "CABAL=$HOME/.ghcup/bin/cabal-3.12.1.0 -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"
Expand Down Expand Up @@ -134,9 +143,9 @@ jobs:
run: |
$CABAL v2-update -v
- name: cache (tools)
uses: actions/cache/restore@v3
uses: actions/cache/restore@v4
with:
key: ${{ runner.os }}-${{ matrix.compiler }}-tools-2bcd4d44
key: ${{ runner.os }}-${{ matrix.compiler }}-tools-655fd156
path: ~/.haskell-ci-tools
- name: install cabal-plan
run: |
Expand All @@ -149,22 +158,16 @@ jobs:
cabal-plan --version
- name: install doctest
run: |
if [ $((HCNUMVER < 90400)) -ne 0 ] ; then $CABAL --store-dir=$HOME/.haskell-ci-tools/store v2-install $ARG_COMPILER --ignore-project -j2 doctest --constraint='doctest ^>=0.20' ; fi
if [ $((HCNUMVER < 90400)) -ne 0 ] ; then doctest --version ; fi
- name: install hlint
run: |
if [ $((HCNUMVER >= 90400 && HCNUMVER < 90600)) -ne 0 ] ; then HLINTVER=$(cd /tmp && (${CABAL} v2-install -v $ARG_COMPILER --dry-run hlint --constraint='hlint >=3.3 && <3.6' | perl -ne 'if (/\bhlint-(\d+(\.\d+)*)\b/) { print "$1"; last; }')); echo "HLint version $HLINTVER" ; fi
if [ $((HCNUMVER >= 90400 && HCNUMVER < 90600)) -ne 0 ] ; then if [ ! -e $HOME/.haskell-ci-tools/hlint-$HLINTVER/hlint ]; then echo "Downloading HLint version $HLINTVER"; mkdir -p $HOME/.haskell-ci-tools; curl --write-out 'Status Code: %{http_code} Redirects: %{num_redirects} Total time: %{time_total} Total Dsize: %{size_download}\n' --silent --location --output $HOME/.haskell-ci-tools/hlint-$HLINTVER.tar.gz "https://github.com/ndmitchell/hlint/releases/download/v$HLINTVER/hlint-$HLINTVER-x86_64-linux.tar.gz"; tar -xzv -f $HOME/.haskell-ci-tools/hlint-$HLINTVER.tar.gz -C $HOME/.haskell-ci-tools; fi ; fi
if [ $((HCNUMVER >= 90400 && HCNUMVER < 90600)) -ne 0 ] ; then mkdir -p $CABAL_DIR/bin && ln -sf "$HOME/.haskell-ci-tools/hlint-$HLINTVER/hlint" $CABAL_DIR/bin/hlint ; fi
if [ $((HCNUMVER >= 90400 && HCNUMVER < 90600)) -ne 0 ] ; then hlint --version ; fi
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then $CABAL --store-dir=$HOME/.haskell-ci-tools/store v2-install $ARG_COMPILER --ignore-project -j2 doctest --constraint='doctest ^>=0.22.0' ; fi
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then doctest --version ; fi
- name: save cache (tools)
uses: actions/cache/save@v3
uses: actions/cache/save@v4
if: always()
with:
key: ${{ runner.os }}-${{ matrix.compiler }}-tools-2bcd4d44
key: ${{ runner.os }}-${{ matrix.compiler }}-tools-655fd156
path: ~/.haskell-ci-tools
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: source
- name: initial cabal.project for sdist
Expand Down Expand Up @@ -192,15 +195,15 @@ jobs:
echo " ghc-options: -Werror=missing-methods" >> cabal.project
cat >> cabal.project <<EOF
EOF
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(typed-process-effectful)$/; }' >> cabal.project.local
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: any.$_ installed\n" unless /^(typed-process-effectful)$/; }' >> 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: restore cache
uses: actions/cache/restore@v3
uses: actions/cache/restore@v4
with:
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
path: ~/.cabal/store
Expand All @@ -220,11 +223,8 @@ jobs:
$CABAL v2-test $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --test-show-details=direct
- name: doctest
run: |
if [ $((HCNUMVER < 90400)) -ne 0 ] ; then cd ${PKGDIR_typed_process_effectful} || false ; fi
if [ $((HCNUMVER < 90400)) -ne 0 ] ; then doctest -XHaskell2010 -XDataKinds -XFlexibleContexts -XGADTs -XKindSignatures -XTypeOperators src ; fi
- name: hlint
run: |
if [ $((HCNUMVER >= 90400 && HCNUMVER < 90600)) -ne 0 ] ; then (cd ${PKGDIR_typed_process_effectful} && hlint -XHaskell2010 -XDataKinds -XFlexibleContexts -XGADTs -XKindSignatures -XTypeOperators src) ; fi
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then cd ${PKGDIR_typed_process_effectful} || false ; fi
if [ $((HCNUMVER < 91000)) -ne 0 ] ; then doctest -XHaskell2010 -XDataKinds -XFlexibleContexts -XGADTs -XKindSignatures -XTypeOperators src ; fi
- name: cabal check
run: |
cd ${PKGDIR_typed_process_effectful} || false
Expand All @@ -237,7 +237,7 @@ jobs:
rm -f cabal.project.local
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all
- name: save cache
uses: actions/cache/save@v3
uses: actions/cache/save@v4
if: always()
with:
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/linters.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Linters
on:
- push
- pull_request
jobs:
hlint:
runs-on: ubuntu-latest

steps:
- name: 'Checkout repository'
uses: actions/checkout@v4

- name: 'Set up cabal-gild'
uses: tfausak/cabal-gild-setup-action@v2

- name: 'Set up hlint'
uses: haskell-actions/hlint-setup@v2

- name: 'Run cabal-gild'
run: cabal-gild --mode check --input typed-process-effectful.cabal

- name: 'Run fourmolu'
uses: haskell-actions/run-fourmolu@v10

- name: 'Run hlint'
uses: haskell-actions/hlint-run@v2
with:
path:
- src/
- example/
- test/
fail-on: suggestion
5 changes: 1 addition & 4 deletions cabal.haskell-ci
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
branches: main

doctest: <9.3
hlint: True
hlint-job: 9.4.7
hlint-version: >=3.3 && <3.6
doctest: <9.9
tests: True
benchmarks: True

Expand Down
2 changes: 1 addition & 1 deletion typed-process-effectful.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ extra-doc-files:
LICENSE.md
README.md

tested-with: ghc ==8.10.7 || ==9.0.2 || ==9.2.8 || ==9.4.7 || ==9.6.3
tested-with: ghc ==8.10.7 || ==9.0.2 || ==9.2.8 || ==9.4.8 || ==9.6.6 || ==9.8.2 || ==9.10.1

source-repository head
type: git
Expand Down

0 comments on commit a23e5c6

Please sign in to comment.