From 919fd4199da6c7be33d233b4a5e2baf22537c046 Mon Sep 17 00:00:00 2001 From: Maxim Koltsov Date: Thu, 9 Nov 2023 16:52:46 +0300 Subject: [PATCH 1/2] haskell-ci regenerate --- .github/workflows/haskell-ci.yml | 41 ++++++++++++++++---------------- package.yaml | 7 ++++-- 2 files changed, 26 insertions(+), 22 deletions(-) diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index 81cffaa..007b257 100644 --- a/.github/workflows/haskell-ci.yml +++ b/.github/workflows/haskell-ci.yml @@ -8,9 +8,9 @@ # # For more information, see https://github.com/haskell-CI/haskell-ci # -# version: 0.14.3 +# version: 0.16.6 # -# REGENDATA ("0.14.3",["github","cobot-io.cabal"]) +# REGENDATA ("0.16.6",["github","cobot-io.cabal"]) # name: Haskell-CI on: @@ -23,7 +23,7 @@ on: jobs: linux: name: Haskell-CI - Linux - ${{ matrix.compiler }} - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 timeout-minutes: 60 container: @@ -32,14 +32,9 @@ jobs: strategy: matrix: include: - - compiler: ghc-9.4.4 + - compiler: ghc-9.2.8 compilerKind: ghc - compilerVersion: 9.4.4 - setup-method: ghcup - allow-failure: true - - compiler: ghc-9.2.5 - compilerKind: ghc - compilerVersion: 9.2.5 + compilerVersion: 9.2.8 setup-method: ghcup allow-failure: true - compiler: ghc-9.0.2 @@ -59,10 +54,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.17.5/x86_64-linux-ghcup-0.1.17.5 > "$HOME/.ghcup/bin/ghcup" + curl -sL https://downloads.haskell.org/ghcup/0.1.19.2/x86_64-linux-ghcup-0.1.19.2 > "$HOME/.ghcup/bin/ghcup" chmod a+x "$HOME/.ghcup/bin/ghcup" - "$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" - "$HOME/.ghcup/bin/ghcup" install cabal 3.6.2.0 + "$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) env: HCKIND: ${{ matrix.compilerKind }} HCNAME: ${{ matrix.compiler }} @@ -78,7 +73,7 @@ jobs: echo "HC=$HC" >> "$GITHUB_ENV" echo "HCPKG=$HOME/.ghcup/bin/$HCKIND-pkg-$HCVER" >> "$GITHUB_ENV" echo "HADDOCK=$HOME/.ghcup/bin/haddock-$HCVER" >> "$GITHUB_ENV" - echo "CABAL=$HOME/.ghcup/bin/cabal-3.6.2.0 -vnormal+nowrap" >> "$GITHUB_ENV" + echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.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" @@ -128,8 +123,8 @@ jobs: - 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 - + curl -sL https://github.com/haskell-hvr/cabal-plan/releases/download/v0.7.3.0/cabal-plan-0.7.3.0-x86_64-linux.xz > cabal-plan.xz + echo 'f62ccb2971567a5f638f2005ad3173dba14693a45154c1508645c52289714cb2 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 @@ -142,7 +137,7 @@ jobs: chmod a+x $HOME/.cabal/bin/hpack hpack --version - name: checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: path: source - name: generate cabal file @@ -183,8 +178,8 @@ jobs: run: | $CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dry-run all cabal-plan - - name: cache - uses: actions/cache@v2 + - name: restore cache + uses: actions/cache/restore@v3 with: key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }} path: ~/.cabal/store @@ -208,8 +203,14 @@ jobs: ${CABAL} -vnormal check - name: haddock run: | - $CABAL v2-haddock $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all + $CABAL v2-haddock --disable-documentation --haddock-all $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 + - name: save cache + uses: actions/cache/save@v3 + if: always() + with: + key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }} + path: ~/.cabal/store diff --git a/package.yaml b/package.yaml index 43d2cf2..e1295ad 100644 --- a/package.yaml +++ b/package.yaml @@ -22,8 +22,11 @@ extra-source-files: tested-with: | GHC ==8.10.7 || ==9.0.2 - || ==9.2.5 - || ==9.4.4 + || ==9.2.8 + +# hyraxAbif does not support text >= 1.3 yet +# || ==9.4.5 +# || ==9.6.2 # Metadata used when publishing your package From 918cb72cc232a40ef8ad878f8630a0527a7caf45 Mon Sep 17 00:00:00 2001 From: Maxim Koltsov Date: Thu, 9 Nov 2023 17:54:56 +0300 Subject: [PATCH 2/2] Limit megaparsec dep in tests --- package.yaml | 3 +++ test/FASTASpec.hs | 49 ++++++++++++++++++++++++----------------------- 2 files changed, 28 insertions(+), 24 deletions(-) diff --git a/package.yaml b/package.yaml index e1295ad..2f66d39 100644 --- a/package.yaml +++ b/package.yaml @@ -100,3 +100,6 @@ tests: - hspec >= 2.4.1 && < 2.11 - neat-interpolation >= 0.3 - linear +# megaparsec-9.3 changed something in error messages +# so that our tests do not pass. + - megaparsec < 9.3 diff --git a/test/FASTASpec.hs b/test/FASTASpec.hs index 01199ff..38bd83b 100644 --- a/test/FASTASpec.hs +++ b/test/FASTASpec.hs @@ -43,36 +43,37 @@ badFasta8 :: Either String (Fasta Char) badFasta8 = Left "input.fasta:21:5:\n |\n21 | CMV + enhMCK + prcTnT-2\r\n | ^^\nunexpected \"+ \"\nexpecting end of input, end of line, or letter\n" fastaSpec :: Spec -fastaSpec = describe "Fasta files parser." $ do - parseFile "test/FASTA/order1.fasta" correctFasta1 - writeFile "test/FASTA/input.fasta" correctFasta1 - parseBadFile "test/FASTA/order2.fasta" badFasta2 - parseFile "test/FASTA/order3.fasta" correctFasta3 - writeFile "test/FASTA/input.fasta" correctFasta3 - parseBadFile "test/FASTA/order4.fasta" badFasta4 - parseFile "test/FASTA/order5.fasta" correctFasta5 - writeFile "test/FASTA/input.fasta" correctFasta5 - parseBadFile "test/FASTA/order6.fasta" badFasta6 - parseBadFile "test/FASTA/order7.fasta" badFasta7 - parseBadFile "test/FASTA/order8.fasta" badFasta8 +fastaSpec = describe "Fasta files parser" $ do + describe "fromFile" $ do + parseFile "test/FASTA/order1.fasta" correctFasta1 + parseBadFile "test/FASTA/order2.fasta" badFasta2 + parseFile "test/FASTA/order3.fasta" correctFasta3 + parseBadFile "test/FASTA/order4.fasta" badFasta4 + parseFile "test/FASTA/order5.fasta" correctFasta5 + parseBadFile "test/FASTA/order6.fasta" badFasta6 + parseBadFile "test/FASTA/order7.fasta" badFasta7 + parseBadFile "test/FASTA/order8.fasta" badFasta8 + + describe "toFile" $ do + writeFile "test/FASTA/input.fasta" correctFasta5 + writeFile "test/FASTA/input.fasta" correctFasta1 + writeFile "test/FASTA/input.fasta" correctFasta3 parseFile :: FilePath -> Fasta Char -> Spec -parseFile path cf = do - describe "fromFile" $ do - it "correctly parses fasta from file" $ do - fasta <- fromFile path - fasta `shouldBe` cf +parseFile path cf = + it ("correctly parses good fasta from file " <> path) $ do + fasta <- fromFile path + fasta `shouldBe` cf parseBadFile :: FilePath -> Either String (Fasta Char) -> Spec -parseBadFile path cf = do - describe "fromFile" $ do - it "correctly parses fasta from file" $ do - res <- liftIO (readFile path) - let badRes = parseOnly fastaP res - badRes `shouldBe` cf +parseBadFile path cf = + it ("correctly parses bad fasta from file " <> path) $ do + res <- liftIO (readFile path) + let badRes = parseOnly fastaP res + badRes `shouldBe` cf writeFile :: FilePath -> Fasta Char -> Spec -writeFile path cf = describe "writeFile" $ do +writeFile path cf = it "correctly write fasta into file" $ do toFile cf path fasta <- fromFile path