From ae231c43c7f1934e314dc4a2521c56ad33797ce8 Mon Sep 17 00:00:00 2001 From: Daniel Lin Date: Thu, 26 Dec 2024 04:10:15 -0500 Subject: [PATCH] Try GHC 9.12.1 --- .github/workflows/hs-bench.yml | 38 +++++++++++++++++++++++++++------- .github/workflows/hs.yml | 18 ++++++++++------ .github/workflows/kt-bench.yml | 13 ++++++++---- .github/workflows/py-bench.yml | 15 +++++++++----- .github/workflows/rs-bench.yml | 15 +++++++++----- hs/aoc2024.cabal | 12 +++++------ hs/bench/Main.hs | 2 +- 7 files changed, 78 insertions(+), 35 deletions(-) diff --git a/.github/workflows/hs-bench.yml b/.github/workflows/hs-bench.yml index 33b5b5e6..0813dd23 100644 --- a/.github/workflows/hs-bench.yml +++ b/.github/workflows/hs-bench.yml @@ -15,6 +15,9 @@ jobs: build: needs: [ get-inputs ] runs-on: ubuntu-latest + strategy: + matrix: + ghc: [ '9.10', '9.12' ] steps: - uses: actions/checkout@v4 @@ -25,9 +28,9 @@ jobs: - uses: haskell-actions/setup@v2 id: setup with: - ghc-version: 9.10.1 + ghc-version: ${{ matrix.ghc }} - run: | - cabal configure --enable-tests --enable-benchmarks + cabal configure --enable-tests --enable-benchmarks --with-compiler=ghc-${{ matrix.ghc }} --allow-newer=aeson-2.2.3.0:ghc-prim,aeson-2.2.3.0:template-haskell,binary-orphans-1.0.5:base,indexed-traversable-0.1.4:base,indexed-traversable-instances-0.1.2:base,integer-conversion-0.1.1:base,microstache-1.0.3:base,process-1.6.25.0:base,process-1.6.25.0:filepath,scientific-0.3.8.0:base,scientific-0.3.8.0:filepath,scientific-0.3.8.0:template-haskell,semialign-1.3.1:base,these-1.2.1:base,time-compat-1.9.7:base,uuid-types-1.0.6:template-haskell cabal build all --dry-run working-directory: hs - uses: actions/cache/restore@v4 @@ -51,13 +54,32 @@ jobs: AOC2024_DATADIR: ${{ github.workspace }}/inputs TRACE: 0 working-directory: hs + - uses: actions/upload-artifact@v4 + with: + name: ghc-${{ matrix.ghc }} + path: hs/aoc2024-bench.html + + docs: + needs: [ build ] + runs-on: ubuntu-latest + + steps: - uses: actions/checkout@v4 with: ref: gh-docs - path: gh-docs - - run: mv hs/aoc2024-bench.html gh-docs/aoc2024-bench.html - - uses: EndBug/add-and-commit@v9 + - uses: actions/download-artifact@v4 + with: + name: ghc-9.10 + - uses: actions/download-artifact@v4 with: - cwd: gh-docs - add: aoc2024-bench.html - message: 'Haskell Criterion ${{ github.sha }}' + name: ghc-9.12 + path: aoc2024-bench-9.12.html + - run: | + git add aoc2024-bench.html aoc2024-bench-9.12.html + git commit -m 'Haskell Criterion ${{ github.sha }}' + git push + env: + GIT_AUTHOR_NAME: github-actions[bot] + GIT_AUTHOR_EMAIL: 41898282+github-actions[bot]@users.noreply.github.com + GIT_COMMITTER_NAME: github-actions[bot] + GIT_COMMITTER_EMAIL: 41898282+github-actions[bot]@users.noreply.github.com diff --git a/.github/workflows/hs.yml b/.github/workflows/hs.yml index 65aa74b7..2f40dd31 100644 --- a/.github/workflows/hs.yml +++ b/.github/workflows/hs.yml @@ -18,15 +18,18 @@ jobs: build: runs-on: ubuntu-latest + strategy: + matrix: + ghc: [ '9.10', '9.12' ] steps: - uses: actions/checkout@v4 - uses: haskell-actions/setup@v2 id: setup with: - ghc-version: 9.10.1 + ghc-version: ${{ matrix.ghc }} - run: | - cabal configure --enable-tests --enable-benchmarks + cabal configure --enable-tests --enable-benchmarks --with-compiler=ghc-${{ matrix.ghc }} --allow-newer=aeson-2.2.3.0:ghc-prim,aeson-2.2.3.0:template-haskell,binary-orphans-1.0.5:base,indexed-traversable-0.1.4:base,indexed-traversable-instances-0.1.2:base,integer-conversion-0.1.1:base,microstache-1.0.3:base,process-1.6.25.0:base,process-1.6.25.0:filepath,scientific-0.3.8.0:base,scientific-0.3.8.0:filepath,scientific-0.3.8.0:template-haskell,semialign-1.3.1:base,these-1.2.1:base,time-compat-1.9.7:base,uuid-types-1.0.6:template-haskell cabal build all --dry-run working-directory: hs - uses: actions/cache/restore@v4 @@ -50,13 +53,13 @@ jobs: cabal build all echo "exe=$(cabal list-bin aoc2024)" >> $GITHUB_OUTPUT working-directory: hs - - run: cabal test all --test-show-details=direct + - run: cabal test all working-directory: hs - run: cabal check working-directory: hs - uses: actions/upload-artifact@v4 with: - name: aoc2024-hs + name: aoc2024-hs-${{ matrix.ghc }} path: ${{ steps.build.outputs.exe }} lint: @@ -86,7 +89,10 @@ jobs: steps: - uses: actions/download-artifact@v4 - - run: chmod +x aoc2024-hs/aoc2024 - - run: aoc2024-hs/aoc2024 + - run: chmod +x aoc2024-hs-9.10/aoc2024 aoc2024-hs-9.12/aoc2024 + - run: aoc2024-hs-9.10/aoc2024 + env: + AOC2024_DATADIR: inputs + - run: aoc2024-hs-9.12/aoc2024 env: AOC2024_DATADIR: inputs diff --git a/.github/workflows/kt-bench.yml b/.github/workflows/kt-bench.yml index 37e4dfbc..94a3d45a 100644 --- a/.github/workflows/kt-bench.yml +++ b/.github/workflows/kt-bench.yml @@ -147,7 +147,12 @@ jobs: var providedBenchmarkStore = $(jq --null-input '$ARGS.named|map_values(.[0]|sort_by(.benchmark|[split("[.]|(? EOF - - uses: EndBug/add-and-commit@v9 - with: - cwd: gh-docs - add: criterion - message: 'Rust Criterion ${{ github.sha }}' + - run: | + git add criterion + git commit -m 'Rust Criterion ${{ github.sha }}' + git push + env: + GIT_AUTHOR_NAME: github-actions[bot] + GIT_AUTHOR_EMAIL: 41898282+github-actions[bot]@users.noreply.github.com + GIT_COMMITTER_NAME: github-actions[bot] + GIT_COMMITTER_EMAIL: 41898282+github-actions[bot]@users.noreply.github.com + working-directory: gh-docs diff --git a/hs/aoc2024.cabal b/hs/aoc2024.cabal index f7c06bdb..f065e811 100644 --- a/hs/aoc2024.cabal +++ b/hs/aoc2024.cabal @@ -52,7 +52,7 @@ library build-depends: array ^>=0.5.7.0, - base ^>=4.20.0.0, + base >=4.20 && <4.22, containers ^>=0.7, heap ^>=1.0.4, megaparsec ^>=9.7.0, @@ -70,8 +70,8 @@ executable aoc2024 c-sources: app/cbits/main.c build-depends: aoc2024, - base ^>=4.20.0.0, - filepath ^>=1.5.2.0, + base >=4.20 && <4.22, + filepath >=1.5.2.0 && <1.6, megaparsec ^>=9.7.0, text ^>=2.1.1, @@ -115,7 +115,7 @@ test-suite aoc2024-test build-depends: aoc2024, - base ^>=4.20.0.0, + base >=4.20 && <4.22, hspec ^>=2.11.10, text ^>=2.1.1, @@ -137,9 +137,9 @@ benchmark aoc2024-bench c-sources: bench/cbits/main.c build-depends: aoc2024, - base ^>=4.20.0.0, + base >=4.20 && <4.22, criterion ^>=1.6.4.0, - filepath ^>=1.5.2.0, + filepath >=1.5.2.0 && <1.6, text ^>=2.1.1, ghc-options: diff --git a/hs/bench/Main.hs b/hs/bench/Main.hs index ab173ee0..6316c3c8 100644 --- a/hs/bench/Main.hs +++ b/hs/bench/Main.hs @@ -194,6 +194,6 @@ main = env (getDayInput 24) $ \input -> bgroup "Day 25" - [ bench "part 2" $ nf Day25.part1 input + [ bench "part 1" $ nf Day25.part1 input ] ]