.gitlab-ci.yml 3.31 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:
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 49
    tags:
        - librem5
    stage: build
    artifacts:
      paths:
        - "*.deb"
    script:
50
        - rm -f ../*.deb
51
        - apt-get -y build-dep .
Dorota Czaplejewicz's avatar
Dorota Czaplejewicz committed
52 53 54 55
        - apt-get -y install devscripts
        - debuild -i -us -uc -b
        - cp ../*.deb .

Dorota Czaplejewicz's avatar
Dorota Czaplejewicz committed
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
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 .

73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
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 .


91
build_deb:arm64:
Dorota Czaplejewicz's avatar
Dorota Czaplejewicz committed
92
    tags:
93
        - librem5:arm64
Dorota Czaplejewicz's avatar
Dorota Czaplejewicz committed
94 95 96 97 98
    stage: build
    artifacts:
      paths:
        - "*.deb"
    script:
99
        - rm -f ../*.deb
100
        - apt-get -y build-dep .
Dorota Czaplejewicz's avatar
Dorota Czaplejewicz committed
101 102 103 104
        - apt-get -y install devscripts
        - debuild -i -us -uc -b
        - cp ../*.deb .

105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121
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
122 123 124 125 126 127 128 129 130
test_lintian:
    <<: *tags
    stage: test
    dependencies:
        - build_deb
    script:
        - apt-get -y install lintian
        - lintian *.deb

131
test:
132 133
  tags:
    - librem5
134
  stage: test
135
  needs:
136 137
    - build_meson
  script:
138
    - apt-get -y build-dep .
139
    - apt-get -y install clang-tidy
140
    - ninja -C _build test
141 142
    - 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
143 144 145 146 147 148 149 150

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