From 1503587945c5779dafbec7cfa886cc59d6de38b1 Mon Sep 17 00:00:00 2001 From: Huw Campbell Date: Fri, 10 Nov 2023 09:34:36 +1100 Subject: [PATCH] CI --- .github/workflows/haskell.yml | 93 +++++++++++++++++++++++++++++++++++ README.md | 2 +- cabal.project | 32 ++++++++++++ 3 files changed, 126 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/haskell.yml diff --git a/.github/workflows/haskell.yml b/.github/workflows/haskell.yml new file mode 100644 index 0000000..6fdb278 --- /dev/null +++ b/.github/workflows/haskell.yml @@ -0,0 +1,93 @@ +name: Haskell CI + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +permissions: + contents: read + +jobs: + cabal: + name: ${{ matrix.os }} / ghc ${{ matrix.ghc }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + include: + - cabal: "3.8.1" + ghc: "8.8.4" + os: ubuntu-latest + - cabal: "3.8.1" + ghc: "9.0.2" + os: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + submodules: recursive + - uses: haskell/actions/setup@v2 + id: setup-haskell-cabal + name: Setup Haskell + with: + ghc-version: ${{ matrix.ghc }} + cabal-version: ${{ matrix.cabal }} + + - name: Freeze + run: | + cabal configure + cabal freeze + - uses: actions/cache@v1 + name: Cache ~/.cabal/store + with: + path: ${{ steps.setup-haskell-cabal.outputs.cabal-store }} + key: ${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }} + + - name: Build + run: | + cabal build all + + - name: Test x-aeson + run: | + cabal test x-aeson + + - name: Test x-attoparsec + run: | + cabal test x-attoparsec + + - name: Test x-bytestring + run: | + cabal test x-bytestring + + - name: Test x-conduit + run: | + cabal test x-conduit + + - name: Test x-eithert + run: | + cabal test x-eithert + + - name: Test x-exception + run: | + cabal test x-exception + + - name: Test x-file-embed + run: | + cabal test x-file-embed + + - name: Test x-optparse + run: | + cabal test x-optparse + + - name: Test x-show + run: | + cabal test x-show + + - name: Test x-templatehaskell + run: | + cabal test x-templatehaskell + + - name: Test x-vector + run: | + cabal test x-vector diff --git a/README.md b/README.md index a09f255..f3f68ca 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ # X ### A collection of extra combinator libraries. -[![Build Status](https://api.travis-ci.com/icicle-lang/x.svg?branch=master)](https://travis-ci.com/icicle-lang/x) +[![Build Status](https://github.com/icicle-lang/x/actions/workflows/haskell.yml/badge.svg)](https://github.com/icicle-lang/x/actions/workflows/haskell.yml) diff --git a/cabal.project b/cabal.project index 66f737a..e24dd2b 100644 --- a/cabal.project +++ b/cabal.project @@ -18,3 +18,35 @@ packages: constraints: cabal > 2 +package x-optparse + tests: True + +package x-bytestring + tests: True + +package x-eithert + tests: True + +package x-attoparsec + tests: True + +package x-exception + tests: True + +package x-conduit + tests: True + +package x-vector + tests: True + +package x-templatehaskell + tests: True + +package x-show + tests: True + +package x-aeson + tests: True + +package x-file-embed + tests: True