Skip to content

Add options for nixpkgs-fmt #50

Add options for nixpkgs-fmt

Add options for nixpkgs-fmt #50

Workflow file for this run

name: ci
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
jobs:
ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup nix
uses: cachix/install-nix-action@v25
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
nix_path: nixpkgs=channel:nixos-unstable
- name: Check
run: nix flake check
- name: Build
run: |
cd test
nix build
- name: Dev shell (ormolu)
run: |
cd test
nix develop -c bash -c "cabal build && ormolu --version"
- name: Dev shell (fourmolu)
run: |
cd test
nix develop -c bash -c "cabal build && fourmolu --version"
- name: Dev shell (nixpkgs-fmt)
run: |
cd test
# nixpkgs-fmt --help/version returns exit code 1 for some reason...
nix develop .#nixpkgs-fmt -c bash -c "which nixpkgs-fmt"
- name: Dev shell (nixfmt)
run: |
cd test
nix develop .#nixfmt -c bash -c "nixfmt --version"
- name: Format (ormolu)
run: |
cd test
nix run .#format
git diff --exit-code --no-index src/Lib.hs Lib.ormolu
- name: Format (fourmolu)
run: |
cd test
nix run .#format-fourmolu
git diff --exit-code --no-index src/Lib.hs Lib.fourmolu
- name: Format (find)
run: |
cd test
nix run .#format-find
git diff --exit-code --no-index src/Lib.hs Lib.ormolu
- name: FormatHs
run: |
cd test
nix run .#formatHs
git diff --exit-code --no-index src/Lib.hs Lib.ormolu
- name: Format (nixpkgs-fmt)
run: |
cd test
git checkout .
nix run .#format-nixpkgs-fmt
git diff --exit-code --no-index nix/test.nix nix/test-nixpkgs-fmt.nix
- name: Format (nixfmt)
run: |
cd test
git checkout .
nix run .#format-nixfmt
git diff --exit-code --no-index nix/test.nix nix/test-nixfmt.nix
- name: Lint
run: |
cd test
nix run .#lint
- name: Lint (find)
run: |
cd test
nix run .#lint-find
- name: LintRefactor
run: |
cd test
nix run .#lintRefactor
- name: LintRefactor (find)
run: |
cd test
nix run .#lintRefactor-find