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

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
23
        cd src
Valentin Reis's avatar
Valentin Reis committed
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
        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
40
    - nix-shell --pure -p '(import ./.).hlint' --run bash <<< 'hlint src/ --hint=./.hlint.yaml'
Valentin Reis's avatar
Valentin Reis committed
41
42
43
44
45
46
47
48

black:
  stage: source
  tags:
    - kvm
    - nix
  script:
    - |
Valentin Reis's avatar
Valentin Reis committed
49
      nix-shell --pure -p '(import ./.).pythonPackages.black' --run bash <<< '
Valentin Reis's avatar
Valentin Reis committed
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
        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
65
            echo "[!] $F does not pass dhall-format format check." >&2
Valentin Reis's avatar
Valentin Reis committed
66
67
68
69
70
71
            RETURN=1
          fi
        done
        if [ $RETURN -ne 0 ]; then exit 1; fi
      '

Valentin Reis's avatar
Valentin Reis committed
72
nix-build:
Valentin Reis's avatar
Valentin Reis committed
73
74
75
76
  stage: lib
  tags:
    - kvm
    - nix
77
  script: nix-build -A hbandit --no-build-output
Valentin Reis's avatar
Valentin Reis committed
78
79
80
81
82
83
84
85
86


check-vendored-documentation:
  stage: docs
  tags:
    - kvm
    - nix
  script:
    - |
87
      nix-shell nix/default.nix -A hack --run bash --arg useGhcide false <<< '
Valentin Reis's avatar
Valentin Reis committed
88
89
90
91
92
        echo "check: is vendored documentation up to date?"
        cp -r doc/ doc2
        ./shake doc
        diff -r doc doc2
        '