Skip to content

Commit

Permalink
Reconfigure gh-actions using updo
Browse files Browse the repository at this point in the history
  • Loading branch information
philderbeast committed May 20, 2024
1 parent 8283a71 commit c3fba75
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 26 deletions.
61 changes: 44 additions & 17 deletions .github/workflows/cabal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
17 changes: 11 additions & 6 deletions .github/workflows/stack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
2 changes: 1 addition & 1 deletion project-dhall/ghc-9.2.8/constraints.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
, { dep = "tls", ver = "2.0.5" }
, { dep = "memory", ver = "0.18.0" }
, { dep = "unix-time", ver = "0.4.12" }
]
]
2 changes: 1 addition & 1 deletion project-dhall/ghc-9.6.5/constraints.dhall
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[ { dep = "dhall", ver = "1.42.1" }
, { dep = "dhall-json", ver = "1.7.12" }
]
]
2 changes: 1 addition & 1 deletion project-dhall/ghc-9.8.2/text-templates/cabal-snippet.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

program-options
ghc-options: -fhide-source-paths

allow-newer:
dhall:*
, dhall-json:*
Expand Down

0 comments on commit c3fba75

Please sign in to comment.