Skip to content

Commit

Permalink
Merge pull request #24 from input-output-hk/nc/ci
Browse files Browse the repository at this point in the history
CI Setup
  • Loading branch information
nc6 authored Mar 5, 2024
2 parents a8d6043 + 72da81e commit ad1d90d
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 5 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Cuddle CI
run-name: ${{ github.actor }} CI testing
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "**"]

# Cancel running actions when a new action on the same PR is started
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
ghc: ["9.2.8", "9.6.3", "9.8.1"]
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v3
- name: Install Haskell
uses: input-output-hk/setup-haskell@v1
id: setup-haskell
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: latest
- name: Cabal update
run: cabal update

- name: Cabal Configure
run: cabal configure --enable-tests --enable-benchmarks --write-ghc-environment-files=always

- uses: actions/cache@v3
if: matrix.os != 'macos-latest'
name: Cache cabal store
with:
path: |
${{ steps.setup-haskell.outputs.cabal-store }}
dist-newstyle
# cache is invalidated upon a change to cabal.project (and/or cabal.project.local), a bump to
# CABAL_CACHE_VERSION or after a week of inactivity
key: cache-${{ runner.os }}-${{ matrix.ghc }}-${{ env.CABAL_CACHE_VERSION }}-${{ hashFiles('cabal.project*') }}
# Restoring attempts are from current branch then master
restore-keys: |
cache-${{ runner.os }}-${{ matrix.ghc }}-${{ env.CABAL_CACHE_VERSION }}-${{ hashFiles('cabal.project*') }}
- name: Install dependencies
run: cabal build all --only-dependencies

- name: Build
run: cabal build all

- name: Run tests
run: |
cabal test all
8 changes: 4 additions & 4 deletions cuddle.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ library

-- other-extensions:
build-depends:
, base ^>=4.16.3.0 || ^>=4.18.1.0
, base ^>=4.16.3.0 || ^>=4.18.1.0 || ^>=4.19.0.0
, bytestring
, capability
, cborg
Expand Down Expand Up @@ -65,7 +65,7 @@ executable example
hs-source-dirs: example
main-is: Main.hs
build-depends:
, base ^>=4.16.3.0 || ^>=4.18.1.0
, base ^>=4.16.3.0 || ^>=4.18.1.0 || ^>=4.19.0.0
, cuddle
, megaparsec
, prettyprinter
Expand All @@ -78,7 +78,7 @@ executable cuddle
hs-source-dirs: ./bin/
main-is: Main.hs
build-depends:
, base ^>=4.16.3.0 || ^>=4.18.1.0
, base ^>=4.16.3.0 || ^>=4.18.1.0 || ^>=4.19.0.0
, cborg
, cuddle
, megaparsec
Expand All @@ -100,7 +100,7 @@ test-suite cuddle-test
hs-source-dirs: test
main-is: Main.hs
build-depends:
, base ^>=4.16.3.0 || ^>=4.18.1.0
, base ^>=4.16.3.0 || ^>=4.18.1.0 || ^>=4.19.0.0
, cuddle
, hedgehog
, hspec
Expand Down
2 changes: 1 addition & 1 deletion src/Codec/CBOR/Cuddle/Huddle.hs
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ import Data.String (IsString (fromString))
import Data.Text qualified as T
import Data.Tuple.Optics (Field1 (..), Field2 (..), Field3 (..))
import Data.Void (Void)
import GHC.Exts (IsList (Item, fromList, toList))
import GHC.Generics (Generic)
import GHC.IsList (IsList (Item, fromList, toList))
import Optics.Core (over, view, (%~), (&), (.~))
import Prelude hiding ((/))

Expand Down
2 changes: 2 additions & 0 deletions src/Codec/CBOR/Cuddle/Parser.hs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -Wno-unused-imports #-}

module Codec.CBOR.Cuddle.Parser where

import Codec.CBOR.Cuddle.CDDL
import Codec.CBOR.Cuddle.CDDL.CtlOp (CtlOp)
import Codec.CBOR.Cuddle.CDDL.CtlOp qualified as COp
import Control.Applicative (liftA2)
import Control.Applicative.Combinators.NonEmpty qualified as NE
import Data.Functor (void, ($>))
import Data.List.NonEmpty (NonEmpty)
Expand Down

0 comments on commit ad1d90d

Please sign in to comment.