diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index 60b4a63..a46bb73 100644 --- a/.github/workflows/haskell-ci.yml +++ b/.github/workflows/haskell-ci.yml @@ -191,9 +191,9 @@ jobs: - name: initial cabal.project for sdist run: | touch cabal.project - echo "packages: $GITHUB_WORKSPACE/source/units-defs" >> cabal.project echo "packages: $GITHUB_WORKSPACE/source/units" >> cabal.project echo "packages: $GITHUB_WORKSPACE/source/units-test" >> cabal.project + echo "packages: $GITHUB_WORKSPACE/source/units-defs" >> cabal.project cat cabal.project - name: sdist run: | @@ -205,25 +205,27 @@ jobs: find sdist -maxdepth 1 -type f -name '*.tar.gz' -exec tar -C $GITHUB_WORKSPACE/unpacked -xzvf {} \; - name: generate cabal.project run: | - PKGDIR_units_defs="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/units-defs-[0-9.]*')" - echo "PKGDIR_units_defs=${PKGDIR_units_defs}" >> "$GITHUB_ENV" PKGDIR_units="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/units-[0-9.]*')" echo "PKGDIR_units=${PKGDIR_units}" >> "$GITHUB_ENV" PKGDIR_units_test="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/units-test-[0-9.]*')" echo "PKGDIR_units_test=${PKGDIR_units_test}" >> "$GITHUB_ENV" + PKGDIR_units_defs="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/units-defs-[0-9.]*')" + echo "PKGDIR_units_defs=${PKGDIR_units_defs}" >> "$GITHUB_ENV" rm -f cabal.project cabal.project.local touch cabal.project touch cabal.project.local - echo "packages: ${PKGDIR_units_defs}" >> cabal.project echo "packages: ${PKGDIR_units}" >> cabal.project echo "packages: ${PKGDIR_units_test}" >> cabal.project - if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo "package units-defs" >> cabal.project ; fi - if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi + echo "packages: ${PKGDIR_units_defs}" >> cabal.project if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo "package units" >> cabal.project ; fi if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo "package units-test" >> cabal.project ; fi if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi + if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo "package units-defs" >> cabal.project ; fi + if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi cat >> cabal.project <= 8.0 ) + constraints: safe < 0.3.18 EOF $HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(units|units-defs|units-test)$/; }' >> cabal.project.local cat cabal.project @@ -253,12 +255,12 @@ jobs: $CABAL v2-test $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --test-show-details=direct - name: cabal check run: | - cd ${PKGDIR_units_defs} || false - ${CABAL} -vnormal check cd ${PKGDIR_units} || false ${CABAL} -vnormal check cd ${PKGDIR_units_test} || false ${CABAL} -vnormal check + cd ${PKGDIR_units_defs} || false + ${CABAL} -vnormal check - name: haddock run: | if [ $((HCNUMVER < 80000 || HCNUMVER >= 80400)) -ne 0 ] ; then $CABAL v2-haddock --disable-documentation --haddock-all $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all ; fi diff --git a/cabal.haskell-ci b/cabal.haskell-ci index 02d88f9..c43d7e1 100644 --- a/cabal.haskell-ci +++ b/cabal.haskell-ci @@ -1,2 +1,6 @@ -- Work around https://github.com/haskell/haddock/issues/574 haddock: <8.0 || >=8.4 + +raw-project + if !impl(ghc >= 8.0) + constraints: safe < 0.3.18 diff --git a/cabal.project b/cabal.project index f44a24c..240ced9 100644 --- a/cabal.project +++ b/cabal.project @@ -1 +1,4 @@ packages: */*.cabal + +if !impl(ghc >= 8.0) + constraints: safe < 0.3.18