-
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.
add a HTTP service template based on servant and Chakra.
- Loading branch information
1 parent
6d4a6d1
commit e394a35
Showing
110 changed files
with
8,145 additions
and
0 deletions.
There are no files selected for viewing
2 changes: 2 additions & 0 deletions
2
project-scaffold-template/nixos2205-ghc8107-haskell.nix-servant-service/.dir-locals.el
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,2 @@ | ||
((nil . ((lsp-haskell-server-path . "haskell-language-server") | ||
(lsp-haskell-formatting-provider . "fourmolu")))) |
12 changes: 12 additions & 0 deletions
12
project-scaffold-template/nixos2205-ghc8107-haskell.nix-servant-service/.editorconfig
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,12 @@ | ||
root = true | ||
|
||
[*] | ||
end_of_line = lf | ||
insert_final_newline = false | ||
charset = utf-8 | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
[Makefile] | ||
indent_size = 4 | ||
indent_style = tab |
7 changes: 7 additions & 0 deletions
7
project-scaffold-template/nixos2205-ghc8107-haskell.nix-servant-service/.env
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 @@ | ||
APP_ENVIRONMENT=Development | ||
PORT=3000 | ||
APP_NAME="{{name|toTitle}}" | ||
APP_DESCRIPTION="{{description}}" | ||
APP_VERSION="0.0.1.0" | ||
JWK_PATH="secrets/jwk.sig" | ||
JWK_AUDIENCES="api://63179623-ffda-483e-a7c9-638ebe33726d" |
36 changes: 36 additions & 0 deletions
36
project-scaffold-template/nixos2205-ghc8107-haskell.nix-servant-service/.ghci
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,36 @@ | ||
:set -Wall | ||
:set -Wcompat | ||
:set -Widentities | ||
:set -Wincomplete-uni-patterns | ||
:set -Wincomplete-record-updates | ||
:set -Wredundant-constraints | ||
:set -Wnoncanonical-monad-instances | ||
:set -fhide-source-paths | ||
:set -Wmissing-export-lists | ||
:set -Wpartial-fields | ||
:set -Wmissing-deriving-strategies | ||
:set -Wunused-packages | ||
:set -XConstraintKinds | ||
:set -XDeriveAnyClass | ||
:set -XDeriveFunctor | ||
:set -XDeriveDataTypeable | ||
:set -XDeriveGeneric | ||
:set -XDerivingStrategies | ||
:set -XFlexibleContexts | ||
:set -XFlexibleInstances | ||
:set -XGeneralizedNewtypeDeriving | ||
:set -XTemplateHaskell | ||
:set -XInstanceSigs | ||
:set -XKindSignatures | ||
:set -XLambdaCase | ||
:set -XMultiParamTypeClasses | ||
:set -XOverloadedStrings | ||
:set -XRecordWildCards | ||
:set -XScopedTypeVariables | ||
:set -XStandaloneDeriving | ||
:set -XTupleSections | ||
:set -XTypeApplications | ||
:set -XViewPatterns | ||
:set -XPatternSynonyms | ||
:def hg \x -> return $ ":!hoogle \"" ++ x ++ "\"" | ||
:def hgi \x -> return $ ":!hoogle --info \"" ++ x ++ "\"" |
1 change: 1 addition & 0 deletions
1
project-scaffold-template/nixos2205-ghc8107-haskell.nix-servant-service/.ghcid
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 @@ | ||
--command="cabal new-repl lib:haskell-web-api-template" --test=":!cabal new-test haskell-web-api-template:test:haskell-web-api-template-test" |
19 changes: 19 additions & 0 deletions
19
...te/nixos2205-ghc8107-haskell.nix-servant-service/.github/workflows/cachix-ci.yml.template
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,19 @@ | ||
name: "Cachix-CI" | ||
on: | ||
pull_request: | ||
push: | ||
branches: [master] | ||
|
||
jobs: | ||
cachix-ci: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2.4.0 | ||
if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/master' | ||
- uses: cachix/install-nix-action@v15 | ||
with: | ||
nix_path: nixpkgs=channel:nixos-{{ nixos_release }} | ||
extra_nix_config: | | ||
trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= | ||
substituters = https://hydra.iohk.io https://cache.nixos.org/ | ||
- run: nix-build |
51 changes: 51 additions & 0 deletions
51
...e/nixos2205-ghc8107-haskell.nix-servant-service/.github/workflows/haskell-ci.yml.template
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,51 @@ | ||
name: haskell-ci | ||
|
||
# Trigger the workflow on push or pull request, but only for the main branch | ||
on: | ||
pull_request: | ||
push: | ||
branches: [master] | ||
|
||
jobs: | ||
cabal: | ||
name: {% raw %} ${{ matrix.os }} / ghc ${{ matrix.ghc }} {% endraw %} | ||
runs-on: {% raw %} ${{ matrix.os }} {% endraw %} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macOS-latest, windows-latest] | ||
cabal: ["3.6"] | ||
ghc: | ||
- {{ghc_version}} | ||
exclude: | ||
- os: macOS-latest | ||
ghc: 8.8.4 | ||
- os: windows-latest | ||
ghc: 8.8.4 | ||
|
||
steps: | ||
- uses: actions/checkout@v2.3.3 | ||
if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/master' | ||
|
||
- uses: haskell/actions/setup@v1 | ||
id: setup-haskell-cabal | ||
name: Setup Haskell | ||
with: | ||
ghc-version: {% raw %} ${{ matrix.ghc }} {% endraw %} | ||
cabal-version: {% raw %} ${{ matrix.cabal }} {% endraw %} | ||
|
||
- name: Freeze | ||
run: | | ||
cabal v2-freeze | ||
- uses: actions/cache@v2.1.2 | ||
name: Cache ~/.cabal/store | ||
with: | ||
path: {% raw %} ${{ steps.setup-haskell-cabal.outputs.cabal-store }} {% endraw %} | ||
key: {% raw %} ${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }} {% endraw %} | ||
|
||
- name: Build | ||
run: | | ||
cabal v2-configure --enable-tests --enable-benchmarks --test-show-details=direct | ||
cabal v2-build all | ||
- name: Test | ||
run: | | ||
cabal v2-test all |
74 changes: 74 additions & 0 deletions
74
...ffold-template/nixos2205-ghc8107-haskell.nix-servant-service/.github/workflows/nix-ci.yml
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,74 @@ | ||
name: nix-ci | ||
|
||
# Trigger the workflow on push or pull request, but only for the main branch | ||
on: | ||
pull_request: | ||
push: | ||
# comment out the branches, only build tags for release to reduce the free github action minus | ||
# branches: [master] | ||
tags: | ||
- "v*.*.*.*" | ||
- "M*" | ||
|
||
jobs: | ||
nix-ci: | ||
name: {% raw %} ${{ matrix.os }} / ghc ${{ matrix.ghc }} {% endraw %} | ||
runs-on: {% raw %} ${{ matrix.os }} {% endraw %} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
ghc: | ||
- {{ ghc_version }} | ||
exclude: | ||
- os: macOS-latest | ||
ghc: 8.8.4 | ||
- os: windows-latest | ||
ghc: 8.8.4 | ||
|
||
steps: | ||
- name: checkout source | ||
uses: actions/checkout@v2.3.3 | ||
if: github.event.action == 'opened' || github.event.action == 'synchronize' || startsWith(github.ref, 'refs/tags/') | ||
|
||
- name: adjust nix store path permission for restore | ||
run: | | ||
# Create with liberal rights, otherwise cache action will complain | ||
# about permission errors. | ||
sudo mkdir -p /nix/store | ||
sudo chmod -R 777 /nix | ||
- name: Cache nix env take N+1 | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
# See https://github.com/actions/cache/pull/726 | ||
/nix/store/** | ||
# Missing something? | ||
/nix/var/nix/*/* | ||
/nix/var/nix/db/* | ||
/nix/var/nix/db/*/** | ||
!/nix/var/nix/daemon-socket/socket | ||
!/nix/var/nix/userpool/* | ||
!/nix/var/nix/gc.lock | ||
!/nix/var/nix/db/big-lock | ||
!/nix/var/nix/db/reserved | ||
key: {{ name }}-nixos-{{nixos_release | remove(".")}}-ghc{{ghc_version | remove(".")}}-cache | ||
|
||
- name: install Nix quickly with iohk cache | ||
uses: nixbuild/nix-quick-install-action@v10 | ||
with: | ||
nix_conf: | | ||
trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= | ||
substituters = https://hydra.iohk.io https://cache.nixos.org/ | ||
- name: build the cross platform target(s) for release | ||
run: nix-build ./cross-build.nix -A x86-musl64.{{name}}.{{name}}-exe | ||
if: startsWith(github.ref, 'refs/tags/') | ||
|
||
- name: release to github if a tag pushed | ||
uses: softprops/action-gh-release@v0.1.14 | ||
if: startsWith(github.ref, 'refs/tags/') | ||
with: | ||
files: | | ||
CHANGELOG.md | ||
result/bin/* |
33 changes: 33 additions & 0 deletions
33
.../nixos2205-ghc8107-haskell.nix-servant-service/.github/workflows/self-hosted.yml.template
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,33 @@ | ||
name: self-hosted | ||
|
||
# Trigger the workflow on push or pull request, but only for the master branch | ||
on: | ||
pull_request: | ||
push: | ||
branches: [master] | ||
|
||
jobs: | ||
build: | ||
name: build with self-hosted runner | ||
runs-on: self-hosted | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/master' | ||
|
||
- name: Prepare Nix | ||
run: | | ||
./ci/prepare-env/do.sh | ||
|
||
- name: Build | ||
run: | | ||
[[ -f ~/.nix-profile/etc/profile.d/nix.sh ]] && . ~/.nix-profile/etc/profile.d/nix.sh | ||
nix-build ./cross-build.nix | ||
|
||
#- name: Test | ||
#run: | | ||
#nix-shell --run "cabal v2-test --enable-tests" | ||
|
||
#- name: Build Docker Image | ||
#run: | | ||
#nix-build ./docker.nix |
57 changes: 57 additions & 0 deletions
57
project-scaffold-template/nixos2205-ghc8107-haskell.nix-servant-service/.gitignore
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,57 @@ | ||
### 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 | ||
.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 | ||
*# | ||
TAGS | ||
|
||
# other | ||
.DS_Store | ||
|
||
# nix | ||
result | ||
result-* | ||
|
Oops, something went wrong.