Improve readme #59
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: Format hs | |
run: | | |
cd test | |
nix run .#format-hs | |
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: Format yaml | |
run: | | |
cd test | |
nix run .#format-yaml | |
git diff --exit-code --no-index test.yaml test.yaml.out | |
- name: Lint | |
run: | | |
cd test | |
nix run .#lint | |
- name: Lint (find) | |
run: | | |
cd test | |
nix run .#lint-find | |
- name: Lint refactor | |
run: | | |
cd test | |
nix run .#lint-refactor | |
- name: Lint refactor (find) | |
run: | | |
cd test | |
nix run .#lint-refactor-find | |
- name: Lint yaml | |
run: | | |
cd test | |
nix run .#lint-yaml | |
- name: Lint merged | |
run: | | |
cd test | |
nix run .#lint-merged |