-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 6fa93ca
Showing
15 changed files
with
346 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
name: CI | ||
|
||
on: | ||
- push | ||
- pull_request | ||
|
||
jobs: | ||
|
||
nix-build: | ||
name: Nix build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: cachix/install-nix-action@v16 | ||
- name: Build dependencies | ||
run: nix develop --command ghc --version | ||
- name: Build weiss-xmonad | ||
run: nix build -L | ||
- name: Build weiss-xmonad shell | ||
run: nix build -L '.#devShells.x86_64-linux.default' | ||
|
||
stack-build: | ||
name: Stack ${{ matrix.resolver }} on ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
resolver: [ nightly, lts-19, lts-18, lts-17, lts-16, lts-15, lts-14 ] | ||
os: [ macos-latest, ubuntu-latest ] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: haskell/actions/setup@v1 | ||
with: | ||
enable-stack: true | ||
## For some reason, stack caching seems to be very brittle, and cause a lot of build failures. | ||
## I haven't investigated very thoroughly what to best do about this, but for now, I'm just not caching stack builds. | ||
- run: stack init --resolver ${{ matrix.resolver }} | ||
- run: stack build --resolver ${{ matrix.resolver }} --only-dependencies | ||
- run: stack build --resolver ${{ matrix.resolver }} | ||
- run: stack build --resolver ${{ matrix.resolver }} --haddock --test --bench --no-run-benchmarks | ||
|
||
cabal-build: | ||
name: Cabal with GHC ${{ matrix.ghc }} on ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
ghc: [ '8.6.5', '8.8.3', '8.10.7', '9.0.2', '9.2.2' ] | ||
os: [ ubuntu-latest, macos-latest ] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: haskell/actions/setup@v1 | ||
with: | ||
ghc-version: ${{ matrix.ghc }} | ||
- uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.cabal | ||
dist-newstyle | ||
key: cabal-cache-${{ matrix.os }}-${{ matrix.ghc }}-${{ hashFiles('**/*.cabal') }} | ||
- run: cabal new-build --only-dependencies | ||
- run: cabal new-build | ||
- run: cabal new-test --test-show-details=direct |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
### Nix ### | ||
result | ||
|
||
### Haskell ### | ||
dist | ||
dist-* | ||
cabal-dev | ||
*.o | ||
*.hi | ||
*.hie | ||
*.chi | ||
*.chs.h | ||
*.dyn_o | ||
*.dyn_hi | ||
.hpc | ||
.hsenv | ||
.cabal-sandbox/ | ||
cabal.sandbox.config | ||
*.prof | ||
*.aux | ||
*.hp | ||
*.eventlog | ||
.stack-work/ | ||
cabal.project.local | ||
cabal.project.local~ | ||
.HTF/ | ||
.ghc.environment.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# template-haskell example hlint file | ||
|
||
# Generalise map to fmap, ++ to <>. Off by default | ||
- group: | ||
name: generalise | ||
enabled: true | ||
|
||
- ignore: | ||
name: Use section | ||
|
||
- ignore: | ||
name: Use infix | ||
|
||
- ignore: | ||
name: Avoid lambda using `infix` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Changelog | ||
|
||
## 0 | ||
|
||
### [Added] | ||
### [Removed] | ||
### [Changed] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
BSD 3-Clause License | ||
|
||
Copyright (c) 2024, weiss | ||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are met: | ||
|
||
1. Redistributions of source code must retain the above copyright notice, this | ||
list of conditions and the following disclaimer. | ||
|
||
2. Redistributions in binary form must reproduce the above copyright notice, | ||
this list of conditions and the following disclaimer in the documentation | ||
and/or other materials provided with the distribution. | ||
|
||
3. Neither the name of the copyright holder nor the names of its | ||
contributors may be used to endorse or promote products derived from | ||
this software without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | ||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | ||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# weiss-xmonad | ||
[![weiss-xmonad on hackage](https://img.shields.io/hackage/v/weiss-xmonad)](http://hackage.haskell.org/package/weiss-xmonad) | ||
[![weiss-xmonad on Stackage Nightly](https://stackage.org/package/weiss-xmonad/badge/nightly)](https://stackage.org/nightly/package/weiss-xmonad) | ||
|
||
Generated with [template-haskell](https://github.com/jonascarpay/template-haskell) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import Lib | ||
|
||
main :: IO () | ||
main = putStrLn "heyyyyyy" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import Lib | ||
|
||
main :: IO () | ||
main = putStrLn "heyyyyyyyyyyyyyyyyyyyy" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
packages: | ||
./ | ||
|
||
package weiss-xmonad | ||
tests: True |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
{ | ||
description = "weiss-xmonad"; | ||
|
||
inputs.nixpkgs.url = "github:NixOS/nixpkgs/release-23.11"; | ||
inputs.flake-utils.url = "github:numtide/flake-utils"; | ||
|
||
outputs = inputs: | ||
let | ||
overlay = final: prev: { | ||
haskell = prev.haskell // { | ||
packageOverrides = hfinal: hprev: | ||
prev.haskell.packageOverrides hfinal hprev // { | ||
weiss-xmonad = hfinal.callCabal2nix "weiss-xmonad" ./. { }; | ||
}; | ||
}; | ||
weiss-xmonad = final.haskell.lib.compose.justStaticExecutables final.haskellPackages.weiss-xmonad; | ||
}; | ||
perSystem = system: | ||
let | ||
pkgs = import inputs.nixpkgs { inherit system; overlays = [ overlay ]; }; | ||
hspkgs = pkgs.haskellPackages; | ||
in | ||
{ | ||
devShells = rec { | ||
default = weiss-xmonad-shell; | ||
weiss-xmonad-shell = hspkgs.shellFor { | ||
withHoogle = true; | ||
packages = p: [ p.weiss-xmonad ]; | ||
buildInputs = [ | ||
hspkgs.cabal-install | ||
hspkgs.haskell-language-server | ||
hspkgs.hlint | ||
hspkgs.ormolu | ||
pkgs.bashInteractive | ||
]; | ||
}; | ||
}; | ||
packages = rec { | ||
default = weiss-xmonad; | ||
weiss-xmonad = pkgs.weiss-xmonad; | ||
}; | ||
}; | ||
in | ||
{ inherit overlay; } // inputs.flake-utils.lib.eachDefaultSystem perSystem; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
cradle: | ||
multi: | ||
# - path: "ignore/" | ||
# config: {cradle: {none: }} | ||
|
||
- path: "src" | ||
config: {cradle: {cabal: {component: "lib:weiss-xmonad"}}} | ||
|
||
- path: "app" | ||
config: {cradle: {cabal: {component: "weiss-xmonad:weiss-xmonad-exe"}}} | ||
|
||
- path: "test" | ||
config: {cradle: {cabal: {component: "weiss-xmonad:weiss-xmonad-test"}}} | ||
|
||
- path: "bench" | ||
config: {cradle: {cabal: {component: "weiss-xmonad:weiss-xmonad-bench"}}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module Lib | ||
( someFunc, | ||
) | ||
where | ||
|
||
someFunc :: IO () | ||
someFunc = putStrLn "hey" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import Test.Hspec | ||
|
||
main :: IO () | ||
main = | ||
hspec $ | ||
describe "weiss-xmonad-test" $ | ||
it "works" $ | ||
2 + 2 `shouldBe` (4 :: Int) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
cabal-version: 2.4 | ||
name: weiss-xmonad | ||
version: 0 | ||
license: BSD-3-Clause | ||
build-type: Simple | ||
license-file: LICENSE | ||
author: weiss | ||
maintainer: weiss <[email protected]> | ||
copyright: 2024 weiss | ||
tested-with: GHC ==8.6.5 || ==8.8.3 || ==8.10.7 || ==9.0.2 || ==9.2.2 | ||
extra-doc-files: | ||
CHANGELOG.md | ||
README.md | ||
|
||
-- category: | ||
-- description: description | ||
-- synopsis: one-line synopsis | ||
-- homepage: https://github.com/FIXME/weiss-xmonad#readme | ||
-- source-repository head | ||
-- type: git | ||
-- location: git://github.com/FIXME/weiss-xmonad.git | ||
|
||
common common-options | ||
build-depends: base >=4.9 && <5 | ||
default-language: Haskell2010 | ||
ghc-options: | ||
-Wall -Wcompat -Widentities -Wincomplete-uni-patterns | ||
-Wincomplete-record-updates -Wredundant-constraints | ||
-fhide-source-paths -Wpartial-fields | ||
|
||
library | ||
import: common-options | ||
hs-source-dirs: src | ||
exposed-modules: Lib | ||
build-depends: | ||
, containers | ||
, mtl | ||
|
||
executable weiss-xmonad-exe | ||
import: common-options | ||
hs-source-dirs: app | ||
main-is: Main.hs | ||
build-depends: weiss-xmonad | ||
ghc-options: -threaded -rtsopts -with-rtsopts=-N | ||
|
||
test-suite weiss-xmonad-test | ||
import: common-options | ||
type: exitcode-stdio-1.0 | ||
hs-source-dirs: test | ||
main-is: Spec.hs | ||
build-depends: | ||
, hspec | ||
, HUnit | ||
, weiss-xmonad | ||
, QuickCheck | ||
|
||
ghc-options: -threaded -rtsopts -with-rtsopts=-N | ||
|
||
benchmark weiss-xmonad-bench | ||
import: common-options | ||
type: exitcode-stdio-1.0 | ||
hs-source-dirs: bench | ||
main-is: Main.hs | ||
build-depends: | ||
, criterion | ||
, weiss-xmonad | ||
|
||
ghc-options: -threaded -rtsopts -with-rtsopts=-N |