From c3fba7550a89786d4f39bb4640fb6a5f58038b10 Mon Sep 17 00:00:00 2001 From: Phil de Joux Date: Mon, 20 May 2024 12:51:36 -0400 Subject: [PATCH] Reconfigure gh-actions using updo --- .github/workflows/cabal.yml | 61 +++++++++++++------ .github/workflows/stack.yml | 17 ++++-- project-dhall/ghc-9.2.8/constraints.dhall | 2 +- project-dhall/ghc-9.6.5/constraints.dhall | 2 +- .../text-templates/cabal-snippet.dhall | 2 +- 5 files changed, 58 insertions(+), 26 deletions(-) diff --git a/.github/workflows/cabal.yml b/.github/workflows/cabal.yml index ac26821..ce6c56c 100644 --- a/.github/workflows/cabal.yml +++ b/.github/workflows/cabal.yml @@ -8,36 +8,63 @@ on: jobs: build: - name: ghc ${{ matrix.ghc }} + name: ghc-${{ matrix.vers.ghc }} runs-on: ubuntu-latest strategy: matrix: - cabal: ["3.6"] - ghc: - - "8.8.4" - - "8.10.7" - - "9.0.2" - - "9.2.2" + cabal: ["3.10.3.0"] + vers: + # - {ghc: "9.2.8", stackage: "lts-20.26"} + # - {ghc: "9.4.8", stackage: "lts-21.25"} + # - {ghc: "9.6.5", stackage: "lts-22.22"} + - {ghc: "9.8.2", stackage: "nightly-2024-05-18"} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - - uses: haskell/actions/setup@v1 + - uses: haskell-actions/setup@v2 name: setup GHC and cabal-install + id: setup with: - ghc-version: ${{ matrix.ghc }} + ghc-version: ${{ matrix.vers.ghc }} cabal-version: ${{ matrix.cabal }} + enable-stack: true + stack-version: '2.15.7' - - uses: actions/cache@v2 - name: cache ~/.cabal/store + - name: Install Dhall + run: | + cabal update --ignore-project + cabal install dhall --with-compiler=ghc-${{ matrix.vers.ghc }} --ignore-project + + - name: Updo + run: GHC_VERSION=${{ matrix.vers.ghc }} STACKAGE_VERSION=${{ matrix.vers.stackage }} make -f project-files.mk cabal.project + + - name: Build dry run + run: cabal build all --enable-tests --enable-benchmarks --dry-run + + - name: Restore cached dependencies + 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: ~/.cabal/store - key: ${{ runner.os }}-${{ matrix.cabal }}-${{ matrix.ghc }}-cabal + path: ${{ steps.setup.outputs.cabal-store }} + key: ${{ env.key }}-plan-${{ hashFiles('**/plan.json') }} + restore-keys: ${{ env.key }}- + + - name: Install dependencies + if: steps.cache.outputs.cache-hit != 'true' + run: cabal build all --only-dependencies + + - name: Save cached dependencies + uses: actions/cache/save@v4 + if: steps.cache.outputs.cache-hit != 'true' + with: + path: ${{ steps.setup.outputs.cabal-store }} + key: ${{ steps.cache.outputs.cache-primary-key }} - name: build - run: | - cabal update - cabal build all --enable-tests + run: cabal build all --enable-tests --enable-benchmarks - name: test golden run: cabal test test:golden --test-show-details=direct --test-option="--color=always" diff --git a/.github/workflows/stack.yml b/.github/workflows/stack.yml index c0bfe08..abb7c74 100644 --- a/.github/workflows/stack.yml +++ b/.github/workflows/stack.yml @@ -11,12 +11,15 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - cabal: ["3.6"] - ghc: - - "9.0.2" + cabal: ["3.10"] + vers: + - {ghc: "9.2.8", stackage: "lts-20.26"} + - {ghc: "9.4.8", stackage: "lts-21.25"} + - {ghc: "9.6.5", stackage: "lts-22.22"} + - {ghc: "9.8.2", stackage: "nightly-2024-05-18"} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: haskell/actions/setup@v1 name: setup stack @@ -29,10 +32,12 @@ jobs: name: cache ~/.stack with: path: ~/.stack - key: ${{ runner.os }}-${{ matrix.ghc }}-stack + key: ${{ runner.os }}-${{ matrix.vers.ghc }}-stack - name: build tests - run: stack test --no-run-tests --no-terminal --stack-yaml=./stack/stack-${{ matrix.ghc }}.yaml + run: | + GHC_VERSION=${{ matrix.vers.ghc }} STACKAGE_VERSION=${{ matrix.vers.stackage }} make -f project-files.mk + stack test --no-run-tests --no-terminal - name: test golden run: stack test hpack-dhall:golden --no-terminal --test-arguments "--color=always" --stack-yaml=./stack/stack-${{ matrix.ghc }}.yaml diff --git a/project-dhall/ghc-9.2.8/constraints.dhall b/project-dhall/ghc-9.2.8/constraints.dhall index 9828855..06a6047 100644 --- a/project-dhall/ghc-9.2.8/constraints.dhall +++ b/project-dhall/ghc-9.2.8/constraints.dhall @@ -9,4 +9,4 @@ , { dep = "tls", ver = "2.0.5" } , { dep = "memory", ver = "0.18.0" } , { dep = "unix-time", ver = "0.4.12" } -] \ No newline at end of file +] diff --git a/project-dhall/ghc-9.6.5/constraints.dhall b/project-dhall/ghc-9.6.5/constraints.dhall index 4a353b1..c56b2c9 100644 --- a/project-dhall/ghc-9.6.5/constraints.dhall +++ b/project-dhall/ghc-9.6.5/constraints.dhall @@ -1,3 +1,3 @@ [ { dep = "dhall", ver = "1.42.1" } , { dep = "dhall-json", ver = "1.7.12" } -] \ No newline at end of file +] diff --git a/project-dhall/ghc-9.8.2/text-templates/cabal-snippet.dhall b/project-dhall/ghc-9.8.2/text-templates/cabal-snippet.dhall index 66b8c8d..f02095b 100644 --- a/project-dhall/ghc-9.8.2/text-templates/cabal-snippet.dhall +++ b/project-dhall/ghc-9.8.2/text-templates/cabal-snippet.dhall @@ -2,7 +2,7 @@ program-options ghc-options: -fhide-source-paths - + allow-newer: dhall:* , dhall-json:*