.gitlab-ci.yml 3.56 KB
Newer Older
1
image: debian:bullseye
Dorota Czaplejewicz's avatar
Dorota Czaplejewicz committed
2 3 4

stages:
  - build
5 6 7 8 9
  - test

.tags: &tags
  tags:
    - librem5
Dorota Czaplejewicz's avatar
Dorota Czaplejewicz committed
10 11

before_script:
12 13
  - apt-get -y update
  - apt-get -y install wget ca-certificates gnupg
14
  - echo "deb [trusted=yes] http://ci.puri.sm/ bullseyeci main" > /etc/apt/sources.list.d/ci.list
15
  - wget -O- https://ci.puri.sm/ci-repo.key | apt-key add -
Dorota Czaplejewicz's avatar
Dorota Czaplejewicz committed
16
  - apt-get -y update
17 18 19 20 21 22 23 24

build_docs:
  <<: *tags
  stage: build
  artifacts:
    paths:
      - _build
  script:
David Boddie's avatar
David Boddie committed
25 26
      - apt-get -y install python3-pip python3-sphinx
      - pip3 install recommonmark
27
      - ./doc/build.sh _build
Dorota Czaplejewicz's avatar
Dorota Czaplejewicz committed
28

29
build_meson:
30 31
  tags:
    - librem5
Dorota Czaplejewicz's avatar
Dorota Czaplejewicz committed
32
  stage: build
33 34 35
  artifacts:
    paths:
      - _build
36
    expire_in: 3h
Dorota Czaplejewicz's avatar
Dorota Czaplejewicz committed
37
  script:
38
    - apt-get -y build-dep .
Guido Gunther's avatar
Guido Gunther committed
39
    - meson . _build/ -Ddepdatadir=/usr/share --werror
40
    - ninja -C _build install
41

Dorota Czaplejewicz's avatar
Dorota Czaplejewicz committed
42
build_deb:
Dorota Czaplejewicz's avatar
Dorota Czaplejewicz committed
43 44 45 46 47 48
    tags:
        - librem5
    stage: build
    artifacts:
      paths:
        - "*.deb"
Dorota Czaplejewicz's avatar
Dorota Czaplejewicz committed
49 50 51 52
        - "*.buildinfo"
        - "*.changes"
        - "*.dsc"
        - "*.tar.*"
Dorota Czaplejewicz's avatar
Dorota Czaplejewicz committed
53
    script:
54
        - rm -f ../*.deb
55
        - apt-get -y build-dep .
Dorota Czaplejewicz's avatar
Dorota Czaplejewicz committed
56
        - apt-get -y install devscripts
Dorota Czaplejewicz's avatar
Dorota Czaplejewicz committed
57
        - debuild -i -us -uc
Dorota Czaplejewicz's avatar
Dorota Czaplejewicz committed
58
        - cp ../*.deb .
Dorota Czaplejewicz's avatar
Dorota Czaplejewicz committed
59 60 61 62
        - cp ../*.buildinfo .
        - cp ../*.changes .
        - cp ../*.dsc .
        - cp ../*.tar.* .
Dorota Czaplejewicz's avatar
Dorota Czaplejewicz committed
63

Dorota Czaplejewicz's avatar
Dorota Czaplejewicz committed
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
build_deb:amber:
    image: pureos/amber
    tags:
        - librem5
    stage: build
    artifacts:
      paths:
        - "*.deb"
    script:
        - echo "deb http://ci.puri.sm/ scratch librem5" > /etc/apt/sources.list.d/ci.list
        - apt-get -y update
        - rm -f ../*.deb
        - apt-get -y build-dep .
        - apt-get -y install devscripts
        - debuild -i -us -uc -b
        - cp ../*.deb .

81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
build_deb:buster:
    image: "debian:buster"
    tags:
        - librem5
    stage: build
    artifacts:
      paths:
        - "*.deb"
    script:
        - echo "deb http://ci.puri.sm/ scratch librem5" > /etc/apt/sources.list.d/ci.list
        - apt-get -y update
        - rm -f ../*.deb
        - apt-get -y build-dep .
        - apt-get -y install devscripts
        - debuild -i -us -uc -b
        - cp ../*.deb .


99
build_deb:arm64:
Dorota Czaplejewicz's avatar
Dorota Czaplejewicz committed
100
    tags:
101
        - librem5:arm64
Dorota Czaplejewicz's avatar
Dorota Czaplejewicz committed
102 103 104 105 106
    stage: build
    artifacts:
      paths:
        - "*.deb"
    script:
107
        - rm -f ../*.deb
108
        - apt-get -y build-dep .
Dorota Czaplejewicz's avatar
Dorota Czaplejewicz committed
109 110 111 112
        - apt-get -y install devscripts
        - debuild -i -us -uc -b
        - cp ../*.deb .

113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129
build_deb:arm64_buster:
    image: "debian:buster"
    tags:
        - librem5:arm64
    stage: build
    artifacts:
      paths:
        - "*.deb"
    script:
        - echo "deb http://ci.puri.sm/ scratch librem5" > /etc/apt/sources.list.d/ci.list
        - apt-get -y update
        - rm -f ../*.deb
        - apt-get -y build-dep .
        - apt-get -y install devscripts
        - debuild -i -us -uc -b
        - cp ../*.deb .

Dorota Czaplejewicz's avatar
Dorota Czaplejewicz committed
130 131 132 133 134 135 136
test_lintian:
    <<: *tags
    stage: test
    dependencies:
        - build_deb
    script:
        - apt-get -y install lintian
Dorota Czaplejewicz's avatar
Dorota Czaplejewicz committed
137
        - lintian --fail-on error --suppress-tags bad-distribution-in-changes-file *.changes
Dorota Czaplejewicz's avatar
Dorota Czaplejewicz committed
138

139
test:
140 141
  tags:
    - librem5
142
  stage: test
143
  needs:
144 145
    - build_meson
  script:
146
    - apt-get -y build-dep .
147
    - apt-get -y install clang-tidy
148
    - ninja -C _build test
149 150
    - cd _build
    - clang-tidy --checks=-clang-diagnostic-missing-braces,readability-braces-around-statements, --warnings-as-errors=readability-braces-around-statements -extra-arg=-Wno-unknown-warning-option ../src/*.c ../eek/*.c ../eekboard/*.c
151 152 153 154 155 156 157 158

check_release:
  <<: *tags
  stage: test
  only:
    refs:
      - master
  script:
Dorota Czaplejewicz's avatar
Dorota Czaplejewicz committed
159
    - apt-get -y install git python3
160
    - (head -n 1 ./debian/changelog && git tag) | ./debian/check_release.py