From 1c75aa3e7d3a389f559a68dd638ebd85d55af73c Mon Sep 17 00:00:00 2001 From: Adrian Sieber Date: Sat, 13 Jun 2020 12:01:53 +0000 Subject: [PATCH] Create the project --- .github/workflows/ci.yml | 42 +++++++++++++++++++++++ .gitignore | 54 +++++++++++++++++++++++++++++ CHANGELOG.md | 0 README.md | 8 +++++ app/Main.hs | 7 ++++ haskell-repos.cabal | 74 ++++++++++++++++++++++++++++++++++++++++ src/HaskellRepos.hs | 15 ++++++++ stack.yaml | 1 + test/Spec.hs | 5 +++ 9 files changed, 206 insertions(+) create mode 100644 .github/workflows/ci.yml create mode 100644 .gitignore create mode 100644 CHANGELOG.md create mode 100644 README.md create mode 100644 app/Main.hs create mode 100644 haskell-repos.cabal create mode 100644 src/HaskellRepos.hs create mode 100644 stack.yaml create mode 100644 test/Spec.hs diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..1df3c4b --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,42 @@ +name: CI + +# Trigger the workflow on push or pull request, but only for the master branch +on: + pull_request: + push: + branches: [master] + +jobs: + build: + name: ghc ${{ matrix.ghc }} + runs-on: ubuntu-16.04 + strategy: + matrix: + cabal: ["2.4"] + ghc: + - "8.8.3" + + 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 + name: Setup Haskell + with: + ghc-version: ${{ matrix.ghc }} + cabal-version: ${{ matrix.cabal }} + + - uses: actions/cache@v1 + name: Cache ~/.cabal/store + with: + path: ~/.cabal/store + key: ${{ runner.os }}-${{ matrix.ghc }}-cabal + + - name: Build + run: | + cabal v2-update + cabal v2-build --enable-tests --enable-benchmarks + + - name: Test + run: | + cabal v2-test --enable-tests diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..80bd4ac --- /dev/null +++ b/.gitignore @@ -0,0 +1,54 @@ +### Haskell +dist +dist-* +cabal-dev +*.o +*.hi +*.chi +*.chs.h +*.dyn_o +*.dyn_hi +*.prof +*.aux +*.hp +*.eventlog +.virtualenv +.hsenv +.hpc +.cabal-sandbox/ +cabal.sandbox.config +cabal.config +cabal.project.local +.ghc.environment.* +.HTF/ +# Stack +.stack-work/ +stack.yaml.lock + +### IDE/support +# Vim +[._]*.s[a-v][a-z] +[._]*.sw[a-p] +[._]s[a-v][a-z] +[._]sw[a-p] +*~ +tags + +# IntellijIDEA +.idea/ +.ideaHaskellLib/ +*.iml + +# Atom +.haskell-ghc-mod.json + +# VS +.vscode/ + +# Emacs +*# +.dir-locals.el +TAGS + +# other +.DS_Store diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..e69de29 diff --git a/README.md b/README.md new file mode 100644 index 0000000..3238cf3 --- /dev/null +++ b/README.md @@ -0,0 +1,8 @@ +# haskell-repos + +[![GitHub CI](https://github.com/ad-si/haskell-repos/workflows/CI/badge.svg)](https://github.com/ad-si/haskell-repos/actions) +[![Hackage](https://img.shields.io/hackage/v/haskell-repos.svg?logo=haskell)](https://hackage.haskell.org/package/haskell-repos) +[![Stackage Lts](http://stackage.org/package/haskell-repos/badge/lts)](http://stackage.org/lts/package/haskell-repos) +[![Stackage Nightly](http://stackage.org/package/haskell-repos/badge/nightly)](http://stackage.org/nightly/package/haskell-repos) + +See README for more info diff --git a/app/Main.hs b/app/Main.hs new file mode 100644 index 0000000..1f11bd3 --- /dev/null +++ b/app/Main.hs @@ -0,0 +1,7 @@ +module Main (main) where + +import HaskellRepos (someFunc) + + +main :: IO () +main = someFunc diff --git a/haskell-repos.cabal b/haskell-repos.cabal new file mode 100644 index 0000000..bbbb84c --- /dev/null +++ b/haskell-repos.cabal @@ -0,0 +1,74 @@ +cabal-version: 2.4 +name: haskell-repos +version: 0.0.0.0 +synopsis: See README for more info +description: See README for more info +homepage: https://github.com/ad-si/haskell-repos +bug-reports: https://github.com/ad-si/haskell-repos/issues +license: NONE +author: Adrian Sieber +maintainer: Adrian Sieber +copyright: 2020 Adrian Sieber +category: Utility +build-type: Simple +extra-doc-files: README.md + CHANGELOG.md +tested-with: GHC == 8.8.3 + +source-repository head + type: git + location: https://github.com/ad-si/haskell-repos.git + +common common-options + build-depends: base ^>= 4.13.0.0 + , protolude + + mixins: base hiding (Prelude) + , protolude (Protolude as Prelude) + + ghc-options: -Wall + -Wcompat + -Widentities + -Wincomplete-uni-patterns + -Wincomplete-record-updates + if impl(ghc >= 8.0) + ghc-options: -Wredundant-constraints + if impl(ghc >= 8.2) + ghc-options: -fhide-source-paths + if impl(ghc >= 8.4) + ghc-options: -Wmissing-export-lists + -Wpartial-fields + if impl(ghc >= 8.8) + ghc-options: -Wmissing-deriving-strategies + + default-language: Haskell2010 + default-extensions: LambdaCase + OverloadedStrings + RecordWildCards + ScopedTypeVariables + StandaloneDeriving + TupleSections + +library + import: common-options + hs-source-dirs: src + exposed-modules: HaskellRepos + +executable haskell-repos + import: common-options + hs-source-dirs: app + main-is: Main.hs + build-depends: haskell-repos + ghc-options: -threaded + -rtsopts + -with-rtsopts=-N + +test-suite haskell-repos-test + import: common-options + type: exitcode-stdio-1.0 + hs-source-dirs: test + main-is: Spec.hs + build-depends: haskell-repos + ghc-options: -threaded + -rtsopts + -with-rtsopts=-N diff --git a/src/HaskellRepos.hs b/src/HaskellRepos.hs new file mode 100644 index 0000000..22ba542 --- /dev/null +++ b/src/HaskellRepos.hs @@ -0,0 +1,15 @@ +{- | +Copyright: (c) 2020 Adrian Sieber +SPDX-License-Identifier: NONE +Maintainer: Adrian Sieber + +See README for more info +-} + +module HaskellRepos + ( someFunc + ) where + + +someFunc :: IO () +someFunc = putStrLn ("someFunc" :: String) diff --git a/stack.yaml b/stack.yaml new file mode 100644 index 0000000..c1800cc --- /dev/null +++ b/stack.yaml @@ -0,0 +1 @@ +resolver: lts-15.5 diff --git a/test/Spec.hs b/test/Spec.hs new file mode 100644 index 0000000..1a44846 --- /dev/null +++ b/test/Spec.hs @@ -0,0 +1,5 @@ +module Main (main) where + + +main :: IO () +main = putStrLn ("Test suite is not implemented" :: String)