diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ced32cc..f22a8ab 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,101 +14,23 @@ on: - cron: '0 0 1 * *' jobs: - # Check that the build passes with stack on all the provided snapshots, and - # thus all the supported ghc versions. - stack: - name: ${{ matrix.stack_yaml }} + build: runs-on: ${{ matrix.os }} strategy: matrix: - stack_yaml: - - stack-8.6.5.yaml - - stack-8.8.4.yaml - - stack-8.10.7.yaml - - stack-9.0.2.yaml - - stack-9.2.7.yaml - - stack-9.4.5.yaml - - stack-9.6.1.yaml - os: - - ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - - uses: actions/cache@v2 - name: Cache Stack Artifacts - with: - path: | - ~/.stack - .stack-work - key: ${{ runner.os }}-stack-${{ hashFiles(matrix.stack_yaml) }} - - - uses: haskell-actions/setup@v2 - id: setup-haskell-stack - name: Setup Stack - with: - enable-stack: true - stack-setup-ghc: true - stack-no-global: true - - - name: Build - run: | - stack --stack-yaml=${{ matrix.stack_yaml }} install --test --bench --no-run-tests --no-run-benchmarks - - - name: Test - run: | - stack --stack-yaml=${{ matrix.stack_yaml }} test - - - name: Double-check the example file - run: | - stack --stack-yaml=${{ matrix.stack_yaml }} exec -- runghc examples/example.hs | diff examples/expected.txt - - - # Check that the build passes with cabal with the latest version of our - # dependencies. - cabal: - name: newest - runs-on: ${{ matrix.os }} - strategy: - matrix: - include: - - ghc-version: '9.8.1' - os: ubuntu-latest - + ghc: ['8.6.5', '8.8.4'] + cabal: ['2.4.1.0', '3.0.0.0'] + os: [ubuntu-latest, macOS-latest, windows-latest] + exclude: + # GHC 8.8+ only works with cabal v3+ + - ghc: 8.8.4 + cabal: 2.4.1.0 + name: Haskell GHC ${{ matrix.ghc }} sample steps: - - uses: actions/checkout@v2 - - - uses: haskell-actions/setup@v2 - id: setup-haskell-cabal - name: Setup Cabal - with: - ghc-version: ${{ matrix.ghc }} - cabal-version: ${{ matrix.cabal }} - - # This freeze file is regenerated on every build, so we will always test - # with the most recent version of our dependencies allowed by our upper - # bounds. - - name: Freeze - run: | - cabal v2-configure --enable-tests --enable-benchmarks --test-show-details=direct - cabal freeze - - # Only reuse the cached copy of our dependencies if our freeze file matches - # the cache's copy. - - uses: actions/cache@v2 - name: Cache Cabal Artifacts - with: - path: | - ${{ steps.setup-haskell-cabal.outputs.cabal-store }} - key: ${{ runner.os }}-cabal-v2-${{ hashFiles('cabal.project.freeze') }} - - - name: Build - run: | - cabal v2-build --enable-tests - - - name: Test - run: | - cabal v2-test - - - name: Double-check the example file - run: | - cabal v2-exec -- runghc examples/example.hs | diff examples/expected.txt - + - uses: actions/checkout@v3 + - name: Setup Haskell + uses: haskell/actions/setup@v2 + with: + ghc-version: ${{ matrix.ghc }} + cabal-version: ${{ matrix.cabal }} + - run: runhaskell Hello.hs diff --git a/Hello.hs b/Hello.hs new file mode 100644 index 0000000..1acebb5 --- /dev/null +++ b/Hello.hs @@ -0,0 +1,2 @@ +main :: IO () +main = putStrLn "hello!"