Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • haskell/ghc-api-compat
  • hsyl20/ghc-api-compat
  • berberman/ghc-api-compat
  • AriFordsham/ghc-api-compat
4 results
Show changes
Commits on Source (2)
name: CI
# Trigger the workflow on push or pull request, but only for the master branch
on:
pull_request:
push:
branches: [master]
jobs:
cabal:
name: ${{ matrix.os }} / ghc ${{ matrix.ghc }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
cabal: ["latest"]
ghc: ["8.6", "8.8", "8.10"]
steps:
- uses: actions/checkout@v2
if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/master'
- uses: actions/setup-haskell@v1.1
id: setup-haskell-cabal
name: Setup Haskell
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}
- name: Build
run: |
cabal update
cabal build all --enable-tests --enable-benchmarks --write-ghc-environment-files=always
- name: Test
run: |
cabal test all --enable-tests
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE BlockArguments #-}
module Main where
import qualified Data.List as List
import System.Process
import Control.Monad
import Data.Version
import Text.ParserCombinators.ReadP
main :: IO ()
main = do
callCommand "ghcup upgrade"
let toVersion x = fst $ head $ filter (null . snd) $ readP_to_S (parseVersion) x
let show_versions = concatMap (\v -> "\n - " ++ showVersion v)
-- get available GHC versions via ghcup
avails <- readCreateProcess (shell "ghcup list -r -t ghc") ""
let fix_avail = toVersion . takeWhile (/= ' ') . drop 4
let avail_ghc_versions = fmap fix_avail (lines avails)
putStrLn $ "Available GHC versions: " ++ show_versions avail_ghc_versions
let
-- only test the recent ones
test_pred = (>= makeVersion [8,8])
prefiltered = filter test_pred avail_ghc_versions
-- take only the latest version per major release
major = take 2 . versionBranch
same_major x y = major x == major y
test_ghc_versions = fmap (last . List.sort) $ List.groupBy same_major prefiltered
putStrLn $ "We will test the following GHC versions: " ++ show_versions test_ghc_versions
forM_ test_ghc_versions \version -> do
let v = showVersion version
let ghc = "ghc-"++v
putStrLn "#######################################"
putStrLn $ "Testing " ++ ghc
putStrLn "#######################################"
putStrLn "# Installing GHC..."
callCommand $ "ghcup install ghc " ++ v
putStrLn "# Trying to build with cabal-install..."
callCommand "cabal clean"
callCommand $ "cabal build -w " ++ ghc