Implement nix run
This commit is contained in:
parent
4446802670
commit
8f2fe88f5f
2 changed files with 13 additions and 43 deletions
2
.github/format.sh
vendored
2
.github/format.sh
vendored
|
|
@ -3,4 +3,4 @@
|
||||||
# Extensions necessary to tell fourmolu about
|
# Extensions necessary to tell fourmolu about
|
||||||
EXTENSIONS="-o -XTypeApplications -o -XTemplateHaskell -o -XImportQualifiedPost -o -XPatternSynonyms -o -fplugin=RecordDotPreprocessor"
|
EXTENSIONS="-o -XTypeApplications -o -XTemplateHaskell -o -XImportQualifiedPost -o -XPatternSynonyms -o -fplugin=RecordDotPreprocessor"
|
||||||
SOURCES=$(git ls-tree -r HEAD --full-tree --name-only | grep -E '.*\.hs')
|
SOURCES=$(git ls-tree -r HEAD --full-tree --name-only | grep -E '.*\.hs')
|
||||||
~/.local/bin/fourmolu --mode check --check-idempotence $EXTENSIONS $SOURCES
|
nix run nixpkgs#haskellPackages.fourmolu -- --mode check --check-idempotence $EXTENSIONS $SOURCES
|
||||||
|
|
|
||||||
54
.github/workflows/integrate.yaml
vendored
54
.github/workflows/integrate.yaml
vendored
|
|
@ -15,42 +15,21 @@ on:
|
||||||
- "flake.lock"
|
- "flake.lock"
|
||||||
- "agora.cabal"
|
- "agora.cabal"
|
||||||
jobs:
|
jobs:
|
||||||
# check-formatting:
|
check-formatting:
|
||||||
# runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
# steps:
|
steps:
|
||||||
# - uses: actions/checkout@v2.4.0
|
- uses: actions/checkout@v2.4.0
|
||||||
|
|
||||||
# - uses: actions/cache@v2.1.4
|
- run: ./.github/format.sh
|
||||||
# name: Add Stack files to cache
|
name: Run fourmolu
|
||||||
# with:
|
|
||||||
# path: ~/.stack
|
|
||||||
# key: ${{ runner.os }}-stack-formatting
|
|
||||||
# restore-keys: ${{ runner.os }}-stack-
|
|
||||||
|
|
||||||
# - run: stack install fourmolu
|
run-linter:
|
||||||
# name: Install fourmolu
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2.4.0
|
||||||
|
|
||||||
# - run: ./.github/format.sh
|
- run: nix run nixpkgs#hlint -- $(git ls-tree -r HEAD --full-tree --name-only | grep -E '.*\.hs')
|
||||||
# name: Run fourmolu
|
name: Run hlint
|
||||||
|
|
||||||
# run-linter:
|
|
||||||
# runs-on: ubuntu-latest
|
|
||||||
# steps:
|
|
||||||
# - uses: actions/checkout@v2.4.0
|
|
||||||
|
|
||||||
# # - uses: actions/cache@v2.1.4
|
|
||||||
# # name: Add Stack files to cache
|
|
||||||
# # with:
|
|
||||||
# # path: ~/.stack
|
|
||||||
# # key: ${{ runner.os }}-stack-lint
|
|
||||||
# # restore-keys: ${{ runner.os }}-stack-
|
|
||||||
|
|
||||||
# # - run: stack install hlint
|
|
||||||
# # name: Install hlint
|
|
||||||
|
|
||||||
# # - run: ~/.local/bin/hlint $(git ls-tree -r HEAD --full-tree --name-only | grep -E '.*\.hs')
|
|
||||||
# - run: hlint $(git ls-tree -r HEAD --full-tree --name-only | grep -E '.*\.hs')
|
|
||||||
# name: Run hlint
|
|
||||||
|
|
||||||
check-build:
|
check-build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
@ -79,12 +58,3 @@ jobs:
|
||||||
key: ${{ runner.os }}-cabal
|
key: ${{ runner.os }}-cabal
|
||||||
- name: Build the project
|
- name: Build the project
|
||||||
run: nix build
|
run: nix build
|
||||||
|
|
||||||
- name: Enter Nix environment
|
|
||||||
run: nix develop
|
|
||||||
|
|
||||||
- run: ./.github/format.sh
|
|
||||||
name: Run fourmolu
|
|
||||||
|
|
||||||
- run: hlint $(git ls-tree -r HEAD --full-tree --name-only | grep -E '.*\.hs')
|
|
||||||
name: Run hlint
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue