.gitlab-ci.yml 1.63 KB
Newer Older
Valentin Reis's avatar
Valentin Reis committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
stages:
  - source
  - lib

ormolu:
  stage: source
  tags:
    - kvm
    - nix
  script:
    - |
      nix-shell --pure -E '
        let pkgs = (import ./.);
        in pkgs.mkShell {
          buildInputs = [pkgs.fd pkgs.ormolu];
          shellHook =
            "export LOCALE_ARCHIVE=${pkgs.glibcLocales}/lib/locale/locale-archive \n" +
            "export LANG=en_US.UTF-8";
        }
      ' --run bash <<< '
        RETURN=0
Valentin Reis's avatar
ci fix    
Valentin Reis committed
22
        cd src
Valentin Reis's avatar
Valentin Reis committed
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
        for F in $(fd -e hs); do
          ormolu -o -XTypeApplications -m check $F
          if [ $? -ne 0 ]; then
            echo "[!] $F does not pass ormolu haskell format check." >&2
            RETURN=1
          fi
        done
        if [ $RETURN -ne 0 ]; then exit 1; fi
      '

hlint:
  stage: source
  tags:
    - kvm
    - nix
  script:
Valentin Reis's avatar
Valentin Reis committed
39
    - nix-shell --pure -p '(import ./.).hlint' --run bash <<< 'hlint src/ --hint=./.hlint.yaml'
Valentin Reis's avatar
Valentin Reis committed
40
41
42
43
44
45
46
47

black:
  stage: source
  tags:
    - kvm
    - nix
  script:
    - |
Valentin Reis's avatar
Valentin Reis committed
48
      nix-shell --pure -p '(import ./.).pythonPackages.black' --run bash <<< '
Valentin Reis's avatar
Valentin Reis committed
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
        black validation/*.py --check
      '

dhall-format:
  stage: source
  tags:
    - kvm
    - nix
  script:
    - |
      nix-shell --pure -p '(import ./.).fd' '(import ./.).haskellPackages.dhall' --run bash <<< '
        RETURN=0
        for F in $(fd -e dhall); do
          dhall format < $F | cmp -s $F -
          if [ $? -ne 0 ]; then
Valentin Reis's avatar
fix    
Valentin Reis committed
64
            echo "[!] $F does not pass dhall-format format check." >&2
Valentin Reis's avatar
Valentin Reis committed
65
66
67
68
69
70
            RETURN=1
          fi
        done
        if [ $RETURN -ne 0 ]; then exit 1; fi
      '

Valentin Reis's avatar
Valentin Reis committed
71
nix-build:
Valentin Reis's avatar
Valentin Reis committed
72
73
74
75
  stage: lib
  tags:
    - kvm
    - nix
76
  script: nix-build -A hbandit --no-build-output