.gitlab-ci.yml 2.01 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
49
50
51
52
53

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
54
            echo "[!] $F does not pass dhall-format format check." >&2
Valentin Reis's avatar
Valentin Reis committed
55
56
57
58
59
60
            RETURN=1
          fi
        done
        if [ $RETURN -ne 0 ]; then exit 1; fi
      '

Valentin Reis's avatar
Valentin Reis committed
61
nix-build:
Valentin Reis's avatar
Valentin Reis committed
62
63
64
65
  stage: lib
  tags:
    - kvm
    - nix
66
  script: nix-build -A hbandit --no-build-output
Valentin Reis's avatar
Valentin Reis committed
67
68
69
70
71
72
73
74

check-vendored-documentation:
  stage: docs
  tags:
    - kvm
    - nix
  script:
    - |
75
      nix-shell nix/default.nix -A hack --run bash --arg useGhcide false <<< '
Valentin Reis's avatar
Valentin Reis committed
76
77
78
79
80
        echo "check: is vendored documentation up to date?"
        cp -r doc/ doc2
        ./shake doc
        diff -r doc doc2
        '
Valentin Reis's avatar
Valentin Reis committed
81
82
83
84
85
86
87
88
89
90
91
92
93

readthedocs:
  stage: docs
  when: on_success
  only:
    - master
    - staging
  tags:
    - kvm
    - nix
  script:
    - echo "token=$RTD_TOKEN"
    - nix run nixpkgs.curl -c curl --fail -X POST -d "token=$RTD_TOKEN" readthedocs.org/api/v2/webhook/hbandit/109499/