Skip to content

Commit

Permalink
Update haskell-ci for the new cabal.project
Browse files Browse the repository at this point in the history
  • Loading branch information
TristanCacqueray committed Aug 23, 2023
1 parent 94e0615 commit 98daca7
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
15 changes: 12 additions & 3 deletions .github/workflows/haskell-ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This GitHub workflow config has been generated by a script via
#
# haskell-ci 'github' '--haddock' '--hlint' '--hlint-job' '9.4.5' '--github-patches' '.github/haskell-ci.patch' 'code/hsec-tools/hsec-tools.cabal'
# haskell-ci 'github' '--haddock' '--hlint' '--hlint-job' '9.4.5' '--github-patches' '.github/haskell-ci.patch' 'cabal.project'
#
# To regenerate the script (for example after adjusting tested-with) run
#
Expand All @@ -10,7 +10,7 @@
#
# version: 0.16.3
#
# REGENDATA ("0.16.3",["github","--haddock","--hlint","--hlint-job","9.4.5","--github-patches",".github/haskell-ci.patch","code/hsec-tools/hsec-tools.cabal"])
# REGENDATA ("0.16.3",["github","--haddock","--hlint","--hlint-job","9.4.5","--github-patches",".github/haskell-ci.patch","cabal.project"])
#
name: Haskell-CI
on:
Expand Down Expand Up @@ -175,6 +175,7 @@ jobs:
run: |
touch cabal.project
echo "packages: $GITHUB_WORKSPACE/source/code/hsec-tools" >> cabal.project
echo "packages: $GITHUB_WORKSPACE/source/code/cwe" >> cabal.project
cat cabal.project
- name: sdist
run: |
Expand All @@ -188,15 +189,20 @@ jobs:
run: |
PKGDIR_hsec_tools="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/hsec-tools-[0-9.]*')"
echo "PKGDIR_hsec_tools=${PKGDIR_hsec_tools}" >> "$GITHUB_ENV"
PKGDIR_cwe="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/cwe-[0-9.]*')"
echo "PKGDIR_cwe=${PKGDIR_cwe}" >> "$GITHUB_ENV"
rm -f cabal.project cabal.project.local
touch cabal.project
touch cabal.project.local
echo "packages: ${PKGDIR_hsec_tools}" >> cabal.project
echo "packages: ${PKGDIR_cwe}" >> cabal.project
echo "package hsec-tools" >> cabal.project
echo " ghc-options: -Werror=missing-methods" >> cabal.project
echo "package cwe" >> cabal.project
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 /^(hsec-tools)$/; }' >> cabal.project.local
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(cwe|hsec-tools)$/; }' >> cabal.project.local
cat cabal.project
cat cabal.project.local
- name: dump install plan
Expand Down Expand Up @@ -226,10 +232,13 @@ jobs:
run: |
if [ $((HCNUMVER >= 90400 && HCNUMVER < 90600)) -ne 0 ] ; then (cd ${PKGDIR_hsec_tools} && hlint -XHaskell2010 src) ; fi
if [ $((HCNUMVER >= 90400 && HCNUMVER < 90600)) -ne 0 ] ; then (cd ${PKGDIR_hsec_tools} && hlint -XHaskell2010 app) ; fi
if [ $((HCNUMVER >= 90400 && HCNUMVER < 90600)) -ne 0 ] ; then (cd ${PKGDIR_cwe} && hlint -XHaskell2010 src) ; fi
- name: cabal check
run: |
cd ${PKGDIR_hsec_tools} || false
${CABAL} -vnormal check
cd ${PKGDIR_cwe} || false
${CABAL} -vnormal check
- name: haddock
run: |
$CABAL v2-haddock --disable-documentation --haddock-all $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all
Expand Down
3 changes: 3 additions & 0 deletions cabal.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
tested-with: GHC==9.2.5

packages: code/hsec-tools, code/cwe
3 changes: 0 additions & 3 deletions code/cabal.project

This file was deleted.

0 comments on commit 98daca7

Please sign in to comment.