haskell / actions

Github actions for Haskell CI
147 stars 54 forks source link

Minimal `stack`-native example #266

Closed ocramz closed 1 year ago

ocramz commented 1 year ago

I've found the following to be an intuitive setup: no new flags are needed, no need to tweak with system GHC installations, etc.

Perhaps consider adding it to the list of examples?

jobs:
  build:
    name: stackage ${{ matrix.stack-resolver }} on ${{ matrix.os }}
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-latest]
        stack-resolver: ['nightly-2023-06-17', 'lts-20.24']
    steps:
      - name: git checkout
        uses: actions/checkout@v3
      - name: Setup compiler, build and test
        run: |
          stack build --resolver ${{ matrix.stack-resolver }}
          stack test
andreasabel commented 1 year ago

In particular, this example does not even use the haskell setup action. So it is not really an example for this action, but a way to circumvent this action.

While super simple, I'd say a drawback of your workflow is that it does not make an attempt to use preinstalled GHCs (via --system-ghc). This is exactly what this action wants to enable: using stack with --system-ghc.

ocramz commented 1 year ago

to be honest I landed on the script above exactly because I couldn't make this Action work. In particular the mapping to the stack cli options could be documented better.

mihaimaruseac commented 1 year ago

I am currently using Stack-based actions as in this repo. Unsure if it would help much, since I decided to test mostly with Cabal and use Stack only for the nightly resolver due to the cache being overblown on Stack compared to Cabal.

ocramz commented 1 year ago

Thank you @mihaimaruseac , I've just tried your config here https://github.com/unfoldml/ms-graph-api/blob/main/.github/workflows/haskell.yml and it works like a charm. 💯