Default nix fmt to nixfmt #53
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
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 | |
- name: Format (nixfmt) | |
run: | | |
cd test | |
git checkout . | |
nix run .#format-nixfmt | |
git diff --exit-code --no-index nix/test.nix nix/test-nixfmt | |
- 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 |