diff --git a/.github/workflows/integration-test-suite.yaml b/.github/workflows/integration-test-suite.yaml index bc79633e..d82e804f 100644 --- a/.github/workflows/integration-test-suite.yaml +++ b/.github/workflows/integration-test-suite.yaml @@ -1,5 +1,5 @@ ################################################################################ -### GitHub Actions curation providing quality assurance for Haskell projects +### GitHub Actions curation providing quality assurance for Haskell projects ### name: 'PHANE Integration Test CI' @@ -12,19 +12,29 @@ defaults: env: PROJECTFILE: --project-file=config/cabal.project.integration - TESTDETAILS: --test-show-details=streaming - TESTOPTIONS: --test-options="--timeout=30s" - THISMAINEXE: PhyGraph:phyg - THISTESTEXE: PHAGE-integration-tests:integration-tests +# TESTDETAILS: --test-show-details=streaming + TESTOPTIONS: --subset-rapid +# TESTOPTIONS: --test-options="--timeout=30s" + THISMAINEXE: :pkg:PhyG:exe:phyg + THISTESTEXE: :pkg:PhyG-integration-tests:exe:PhyG-Integration-Tests on: # Build every pull request, to check for regressions. pull_request: + branches: [ main ] # Build on branch updates push: - branches: [ github-ci ] + branches: [ main, github-ci ] + + +# INFO: The following configuration block ensures that only one build runs per branch, +# which may be desirable for projects with a costly build process. +# Remove this block from the CI workflow to let each CI job run to completion. +concurrency: + group: build-${{ github.ref }} + cancel-in-progress: true ################################################################################ @@ -48,57 +58,97 @@ jobs: fail-fast: true steps: - - name: 'Clone Project' - uses: actions/checkout@v3 - + - name: 'Clone Integration TestSuite' + uses: actions/checkout@v4 + with: + repository: amnh/PhyG-Integration-Tests + - name: 'Setup Haskell' - uses: haskell/actions/setup@v2 + uses: haskell-actions/setup@v2 + id: setup with: - ghc-version: 9.2 - cabal-version: 3.6 - + ghc-version: 9.10.1 + cabal-version: 3.12 + cabal-update: true + - name: 'Cabal - Configure' run: | - cabal update ${PROJECTFILE} - cabal clean ${PROJECTFILE} - cabal freeze ${PROJECTFILE} + cabal update + cabal clean + cabal freeze + cabal configure --enable-tests --enable-benchmarks --disable-documentation + cabal install ${THISMAINEXE} ${THISTESTEXE} --dry-run + # The last step generates dist-newstyle/cache/plan.json for the cache key. + + - name: 'Cabal - Cache [1]' + uses: actions/cache/restore@v4 + id: cache + env: + key: ${{ runner.os }}-ghc-${{ steps.setup.outputs.ghc-version }}-cabal-${{ steps.setup.outputs.cabal-version }} + with: + path: ${{ steps.setup.outputs.cabal-store }} + key: ${{ env.key }}-plan-${{ hashFiles('**/plan.json') }} + restore-keys: ${{ env.key }}- + + - name: 'Cabal - Install dependencies' + # If we had an exact cache hit, the dependencies will be up to date. + if: steps.cache.outputs.cache-hit != 'true' + run: cabal build ${THISMAINEXE} ${THISTESTEXE} --only-dependencies - - name: 'Cabal - Cache' - uses: actions/cache@v3 + # Cache dependencies already here, so that we do not have to rebuild them should the subsequent steps fail. + - name: 'Cabal - Cache [2]' + uses: actions/cache/save@v4 + # If we had an exact cache hit, trying to save the cache would error because of key clash. + if: steps.cache.outputs.cache-hit != 'true' with: - path: | - ~/.cabal/store - dist-newstyle - key: ${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }} - # restore keys is a fall back when the freeze plan is different - restore-keys: | - ${{ runner.os }}-${{ matrix.ghc }}- + path: ${{ steps.setup.outputs.cabal-store }} + key: ${{ steps.cache.outputs.cache-primary-key }} - name: 'Cabal - Build' run: | - cabal build ${THISMAINEXE} ${THISTESTEXE} ${PROJECTFILE} --only-dependencies +# ./bin/refresh-phyg.sh + cabal install ${THISMAINEXE} + cabal build ${THISTESTEXE} + + - name: 'When Failed - Rerun build to minimize output' + if: ${{ failure() }} + run: | + cabal install ${THISMAINEXE} + cabal build ${THISTESTEXE} + + - name: 'Test-suite Filepath' + id: testsuite-filepath + # Output, for later use, the file path of integration test-suite as determined by cabal + run: | + echo "TESTPATH=$(cabal list-bin ${THISTESTEXE} ${PROJECTFILE})" + echo "TESTPATH=$(cabal list-bin ${THISTESTEXE} ${PROJECTFILE})" >> "$GITHUB_OUTPUT" - name: 'Cabal - Integration Tests' + # Retieve the file path of integration test-suite output from a prior step + env: + TESTPATH: ${{ steps.testsuite-filepath.outputs.TESTPATH }} run: | - cabal test ${THISTESTEXE} ${PROJECTFILE} ${TESTDETAILS} ${TESTOPTIONS} + cabal test integration-tests --test-show-details=streaming ="--subset-rapid"~ +# echo "TESTPATH is '$TESTPATH'" +# $TESTPATH ${TESTOPTIONS} - - name: Send mail on failure - if: ${{ failure() }} - uses: dawidd6/action-send-mail@v3 - with: - # Mail server settings - ignore_cert: true - secure: true - server_address: smtp.domain.com - server_port: 465 - - # Sender credentials - username: ${{ secrets.EMAIL_USERNAME }} - password: ${{ secrets.EMAIL_PASSWORD }} - - # Recipient & email information - to: crowley@amnh.org - cc: wheeler@amnh.org - from: PHANE ρbit - subject: "PHANE CI Failure: Integration Test-suite - job ${{ github.job }}" - body: "The continuous integration performed by GitHub Workflows has failed!\n\nInspect job ${{ github.job.name }} numbered ${{ github.job }} at:\n\n https://github.com/${{ github.repository }}actions.\n\n\nVigilantly,\n ~ PHANE ρbit" +# - name: 'When Failed - Send Notification Email' +# if: ${{ failure() }} +# uses: dawidd6/action-send-mail@v3 +# with: +# # Mail server settings +# ignore_cert: true +# secure: true +# server_address: smtp.domain.com +# server_port: 465 +# +# # Sender credentials +# username: ${{ secrets.EMAIL_USERNAME }} +# password: ${{ secrets.EMAIL_PASSWORD }} +# +# # Recipient & email information +# to: crowley@amnh.org +# cc: wheeler@amnh.org +# from: PHANE ρbit +# subject: "PHANE CI Failure: Integration Test-suite - job ${{ github.job }}" +# body: "The continuous integration performed by GitHub Workflows has failed!\n\nInspect job ${{ github.job.name }} numbered ${{ github.job }} at:\n\n https://github.com/${{ github.repository }}actions.\n\n\nVigilantly,\n ~ PHANE ρbit" diff --git a/PhyG.cabal b/PhyG.cabal index 02db8b3b..d691ab4f 100644 --- a/PhyG.cabal +++ b/PhyG.cabal @@ -287,7 +287,6 @@ Executable phyg -- -feager-blackholing -- may be causing parallel loop errors -O2 -rtsopts - -Wall -- Maybe this is required for good paralellism? -fno-omit-yields -- There is/are known compiler bug(s) with this optimization in GHC 9.6.2 (and earlier?). @@ -495,13 +494,11 @@ Library dynamic-character lib/dynamic-character/src Build-Depends: --- PHANE-alphabet, PHANE-dynamic-character, PHANE-dynamic-character-element, PhyG:tcm, PhyG:utility, base >= 4.11 && < 5.0, --- bv-little, containers >= 0.6.2 && < 1.0, matrices >= 0.5 && < 1.0, monad-loops >= 0.4 && < 1.0, @@ -509,9 +506,6 @@ Library dynamic-character vector >= 0.12.0.3 && < 1.0, Exposed-Modules: --- Bio.DynamicCharacter --- Bio.DynamicCharacter.Measure --- Bio.DynamicCharacter.HandleGaps DirectOptimization.Pairwise DirectOptimization.Pairwise.Visualization DirectOptimization.Pairwise.Swapping @@ -544,7 +538,6 @@ Library tcm lib/tcm/src Build-Depends: --- PHANE-dynamic-character, PHANE-dynamic-character-element, PhyG:utility, binary >= 0.8 && < 1.0, @@ -657,53 +650,6 @@ Test-Suite test-dynamic-character Test.QuickCheck.Instances.DynamicCharacter --- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --- --- Additional executables which exist for the one of a few select purposes: --- --- * Generating data for PCG/PhyG input --- --- * Debugging the component sub-libraries of PCG/PhyG and PCG/PhyG itself --- --- * Performing correctness verification --- --- * Stocastically searching for non-totality counterexamples --- --- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - - ---Executable inspect-dynamic-character --- --- Import: --- build-defaults, --- --- Scope: --- private --- --- Main-Is: --- Inspect.hs --- --- HS-Source-Dirs: --- lib/dynamic-character/test --- --- Build-Depends: --- PHANE-alphabet, --- PhyG:dynamic-character, --- PhyG:tcm, --- base >= 4.11 && < 5.0, --- bimap >= 0.3 && < 1.0, --- containers >= 0.6.2 && < 1.0, --- QuickCheck >= 2.14 && < 3.0, --- tasty >= 1.4 && < 2.0, --- tasty-quickcheck >= 0.10 && < 1.0, --- vector >= 0.12.0.3 && < 1.0, --- --- Other-Modules: --- Test.Aligners --- Test.QuickCheck.Instances.DynamicCharacter - - - Benchmark bench-memoized-hashtable Import: diff --git a/config/cabal.project.development b/config/cabal.project.development index d886682f..a69e21a5 100644 --- a/config/cabal.project.development +++ b/config/cabal.project.development @@ -157,7 +157,6 @@ Source-Repository-Package -- and log files of the build/benchmarks/tests should go in `log`. --------------------------------------------------------------------------------- -Builddir: ./doc Symlink-bindir: ./bin Installdir: ./bin Logs-Dir: ./log diff --git a/config/cabal.project.integration b/config/cabal.project.integration index 02762bc1..e6fac834 100644 --- a/config/cabal.project.integration +++ b/config/cabal.project.integration @@ -1,49 +1,174 @@ --------------------------------------------------------------------------------- --- Domain of PHAGE packages --- * PHAGE-integration-tests +-- Build metadata flags +-- +-- Sensible alterations from the defaults to improve the build experience during +-- iterative development. Simultaneously, does not hinder release builds. --------------------------------------------------------------------------------- -packages: - pkg/PHAGE-integration-tests - pkg/PhyGraph - pkg/PhyloLib - pkg/*/*.cabal - -with-compiler: ghc-9.2.4 +Executable-Static: False +Haddock-HTML: True +Haddock-Tests: True +Haddock-benchmarks: True +Haddock-Internal: True +Haddock-Hyperlink-Source: True +Jobs: $ncpus +--keep-going: True +Minimize-Conflict-Set: True +Semaphore: True --------------------------------------------------------------------------------- --- Output paths +-- Dependency specifications -- --- Place build output(s) in more accessible locations. Binaries should go in `bin` --- and log files of the build/benchmarks/tests should go in `log`. +-- Always allow a newer version of libraries which are tightly coupled to the GHC +-- compiler version. This allows the project to build with newer versions of the +-- compiler without having to tediously tinker with dependencies, both direct and +-- transitive. +-- +-- Always allow a newer version of libraries which have had a major release due +-- to a security or performance patch. Add a `preference` indicating the desire +-- to use a version greater than or equal to the patch. --------------------------------------------------------------------------------- --- datadir: ./data --- docdir: ./doc --- htmldir: ./doc/html -symlink-bindir: ./bin -installdir: ./bin -logs-dir: ./log -install-method: copy -overwrite-policy: always +Allow-Newer: + aeson, + base, + base-compat, + binary, + bytestring, + Cabal, + containers, + deepseq, + ghc, + ghc-bignum, + ghc-prim, + hashable, + integer-gmp, + lens, + mtl, + pretty, + primative, + semigroupoids, + template-haskell, + text, + text-builder-linear, + th-abstraction, + time + +-- Required to use the GHC-bound (installed) version +Constraints: + base installed, + ghc installed, + ghc-bignum installed, + ghc-prim installed, + integer-gmp installed, + template-haskell installed + + +-- Reduce the project's dependency footprint via build flags +Constraints: + bifunctors -tagged, + comonad -indexed-traversable, + lens +inlining -test-hunit -test-properties -test-templates +trustworthy, + pointed -comonad -kan-extensions -semigroupoids -semigroups -stm -tagged, + semialign -semigroupoids, + semigroups -binary -bytestring -deepseq -hashable -tagged -template-haskell -text -transformers -unordered-containers, + semigroupoids -comonad, + + +-- Apply performance flags to specific packages +Constraints: + bitvec +simd, + directory +os-string, + hashable -random-initial-seed, + hashtables -bounds-checking -debug -portable +unsafe-tricks, + optparse-applicative +process, + tasty +unix, + text -pure-haskell +simdutf, + vector -BoundsChecks -InternalChecks -UnsafeChecks -Wall, + +Preferences: + aeson >= 2.1.0.0, + bytestring >= 0.12.0.0, + filepath >= 1.4.100.0, + mtl >= 2.3.1, + text >= 2.0.1, + unordered-containers >= 0.2.18.0, + +Source-Repository-Package + Type: git + Location: https://github.com/amnh/PHANE + Subdir: pkg/PHANE-alphabet + Tag: 6f300d99c3be9e5201f31ac4480bbacb3f547f8b + +Source-Repository-Package + Type: git + Location: https://github.com/amnh/PHANE + Subdir: pkg/PHANE-dynamic-character + Tag: 6f300d99c3be9e5201f31ac4480bbacb3f547f8b + +Source-Repository-Package + Type: git + Location: https://github.com/amnh/PHANE + Subdir: pkg/PHANE-dynamic-character-element + Tag: 6f300d99c3be9e5201f31ac4480bbacb3f547f8b + +Source-Repository-Package + Type: git + Location: https://github.com/amnh/PHANE + Subdir: pkg/PHANE-evaluation + Tag: 6f300d99c3be9e5201f31ac4480bbacb3f547f8b + +Source-Repository-Package + Type: git + Location: https://github.com/amnh/PHANE + Subdir: pkg/PHANE-file-formats + Tag: 6f300d99c3be9e5201f31ac4480bbacb3f547f8b + +Source-Repository-Package + Type: git + Location: https://github.com/amnh/PHANE + Subdir: pkg/PHANE-measure-class + Tag: 6f300d99c3be9e5201f31ac4480bbacb3f547f8b + +Source-Repository-Package + Type: git + Location: https://github.com/amnh/PHANE + Subdir: pkg/PHANE-measure-transition + Tag: 6f300d99c3be9e5201f31ac4480bbacb3f547f8b + +Source-Repository-Package + Type: git + Location: https://github.com/amnh/PHANE + Subdir: pkg/PHANE-measure-units + Tag: 6f300d99c3be9e5201f31ac4480bbacb3f547f8b + +Source-Repository-Package + Type: git + Location: https://github.com/amnh/PHANE + Subdir: pkg/PHANE-PhyloLib + Tag: 6f300d99c3be9e5201f31ac4480bbacb3f547f8b + +Source-Repository-Package + Type: git + Location: https://github.com/amnh/PhyG-integration-tests --------------------------------------------------------------------------------- --- Build metadata flags +-- Output paths -- --- Sensible alterations from the defaults to improve the build experience during --- iterative development. Simultaneously, does not hinder release builds. +-- Place build output(s) in more accessible locations. Binaries should go in `bin` +-- and log files of the build/benchmarks/tests should go in `log`. --------------------------------------------------------------------------------- -haddock-html: True -haddock-tests: True -haddock-benchmarks: True -haddock-internal: True -haddock-hyperlink-source: True -jobs: $ncpus -keep-going: True -minimize-conflict-set: True +Symlink-bindir: ./bin +Installdir: ./bin +Logs-Dir: ./log +Install-method: copy +Overwrite-Policy: always +-- Datadir: ./data +-- Docdir: ./doc +-- HTMLdir: ./doc/html --------------------------------------------------------------------------------- @@ -62,58 +187,54 @@ minimize-conflict-set: True -- future breaking changes as well as improving overall code quality. --------------------------------------------------------------------------------- +Packages: . + -- Applies to *all* packages, not just dependencies... -package * +Package * benchmarks: False documentation: False tests: False optimization: 2 - -package PHAGE-integration-tests +-- Applies to *only* the specified package! +package PhyG-integration-tests benchmarks: False documentation: False tests: True executable-static: False optimization: 2 - flags: -SingleThreaded + flags: +SingleThreaded -package PhyGraph +package PhyG benchmarks: False documentation: False tests: False executable-static: False optimization: 2 - flags: -SingleThreaded + flags: +SingleThreaded +Forego-Sanity --------------------------------------------------------------------------------- --- Dependency specifications +-- GHC-9.8.* comptibility -- --- Always allow a newer version of libraries which are tightly coupled to the GHC --- compiler version. This allows the project to build with newer versions of the --- compiler without having to tediously tinker with dependencies, both direct and --- transitive. +-- Updated Hackage references for GHC maintainer patched dependency packages -- --- Always allow a newer version of libraries which have had a major release due --- to a security or performance patch. Add a `preference` indicating the desire --- to use a version greater than or equal to the patch. +-- Also manual source references for other patched dependency packages --------------------------------------------------------------------------------- -allow-newer: - aeson, - bytestring, - text, - -preferences: - aeson >= 2.0.0, - bytestring >= 0.11.3, - filepath >= 1.4.100.0, - mtl >= 2.3, - text >= 2.0, - -source-repository-package - type: git - location: https://github.com/recursion-ninja/bv-little - tag: 4541d78545933f450af5c241a83e4b07a0e69dca +With-Compiler: + ghc-9.10.1 + +Active-Repositories: + hackage.haskell.org, + head.hackage.ghc.haskell.org:override + +Repository head.hackage.ghc.haskell.org + url: https://ghc.gitlab.haskell.org/head.hackage/ + secure: True + key-threshold: 3 + root-keys: + 26021a13b401500c8eb2761ca95c61f2d625bfef951b939a8124ed12ecf07329 + 7541f32a4ccca4f97aea3b22f5e593ba2c0267546016b992dfadcd2fe944e55d + f76d08be13e9a61a377a85e2fb63f4c5435d40f8feb3e12eb05905edb8cdea89