.gitlab-ci.yml 5.97 KB
Newer Older
1
image: registry.gitlab.gnome.org/world/openpaperwork/paperwork/build
2

3
stages:
4
5
6
  # no point in waiting for the tests to end before generating the data files
  # or the development documentation
  - tests_data_doc
7
8
  - deploy_linux
  - deploy_windows
9

10
check:
11
  stage: tests_data_doc
12
13
14
  only:
    - branches@World/OpenPaperwork/paperwork
    - tags@World/OpenPaperwork/paperwork
15
16
17
18
  tags:
    - linux
    - volatile
  script:
19
    - sh ./ci/set_apt_proxy.sh
20
21
    - make check

22

23
24
.apt: &apt
  before_script:
25
    - sh ./ci/set_apt_proxy.sh
26

27

28
test:
29
  stage: tests_data_doc
30
31
32
33
34
35
36
37
  only:
    - branches@World/OpenPaperwork/paperwork
    - tags@World/OpenPaperwork/paperwork
  tags:
    - linux
    - volatile
  <<: *apt
  script:
38
    - source ./activate_test_env.sh && make install
39
    - source ./activate_test_env.sh && paperwork-gtk chkdeps -y && paperwork-cli chkdeps -y
40
    - source ./activate_test_env.sh && make test
Jerome Flesch's avatar
Jerome Flesch committed
41
42


43
generate_data:
44
  stage: tests_data_doc
45
46
47
48
49
50
51
52
53
54
  only:
    - branches@World/OpenPaperwork/paperwork
    - tags@World/OpenPaperwork/paperwork
  tags:
    - linux
    - volatile
  <<: *apt
  script:
    - source ./activate_test_env.sh && make install
    - source ./activate_test_env.sh && paperwork-gtk chkdeps -y && paperwork-cli chkdeps -y
55
    - source ./activate_test_env.sh && make data upload_data
56
57


58
59
doc_devel:
  stage: tests_data_doc
60
61
62
  only:
    - branches@World/OpenPaperwork/paperwork
    - tags@World/OpenPaperwork/paperwork
63
  tags:
64
65
66
    - linux
    - volatile
  <<: *apt
67
  script:
68
    - source ./activate_test_env.sh && make doc && make upload_doc
69

70

71
linux_flatpak:
72
  stage: deploy_linux
73
74
75
76
  only:
    - branches@World/OpenPaperwork/paperwork
    - tags@World/OpenPaperwork/paperwork
  tags:
77
    - openpaper-flatpak
78
  script:
79
80
81
82
    # not running as root, so we cannot actually install anything
    # - apt-get update
    # - apt-get install -y -q rclone flatpak-builder
    - ./ci/update_flatpak_repo.sh
83
84


Jerome Flesch's avatar
Jerome Flesch committed
85
86
.windows: &windows
  before_script:
87
    # Libinsane build dependencies
Jerome Flesch's avatar
Jerome Flesch committed
88
89
90
91
92
93
94
95
    - c:\msys64\usr\bin\pacman --needed --noconfirm -S make
    - c:\msys64\usr\bin\pacman --needed --noconfirm -S mingw-w64-i686-cunit
    - c:\msys64\usr\bin\pacman --needed --noconfirm -S mingw-w64-i686-doxygen
    - c:\msys64\usr\bin\pacman --needed --noconfirm -S mingw-w64-i686-gcc
    - c:\msys64\usr\bin\pacman --needed --noconfirm -S mingw-w64-i686-gobject-introspection
    - c:\msys64\usr\bin\pacman --needed --noconfirm -S mingw-w64-i686-meson
    - c:\msys64\usr\bin\pacman --needed --noconfirm -S mingw-w64-i686-python3-gobject
    - c:\msys64\usr\bin\pacman --needed --noconfirm -S mingw-w64-i686-vala
96
    # Paperwork build dependencies
Jerome Flesch's avatar
Jerome Flesch committed
97
98
99
100
101
102
103
104
105
106
    - c:\msys64\usr\bin\pacman --needed --noconfirm -S mingw-w64-i686-gdk-pixbuf2
    - c:\msys64\usr\bin\pacman --needed --noconfirm -S mingw-w64-i686-cairo
    - c:\msys64\usr\bin\pacman --needed --noconfirm -S mingw-w64-i686-python3-cairo
    - c:\msys64\usr\bin\pacman --needed --noconfirm -S mingw-w64-i686-gtk3
    - c:\msys64\usr\bin\pacman --needed --noconfirm -S mingw-w64-i686-python3-pillow
    - c:\msys64\usr\bin\pacman --needed --noconfirm -S mingw-w64-i686-ca-certificates
    - c:\msys64\usr\bin\pacman --needed --noconfirm -S mingw-w64-i686-python3-setuptools
    - c:\msys64\usr\bin\pacman --needed --noconfirm -S mingw-w64-i686-python3-pip
    - c:\msys64\usr\bin\pacman --needed --noconfirm -S mingw-w64-i686-libnotify
    - c:\msys64\usr\bin\pacman --needed --noconfirm -S mingw-w64-i686-poppler
107
    - c:\msys64\usr\bin\pacman --needed --noconfirm -S mingw-w64-i686-python-psutil
108
    - c:\msys64\usr\bin\pacman --needed --noconfirm -S mingw-w64-i686-gettext
Jerome Flesch's avatar
Jerome Flesch committed
109
    - c:\msys64\usr\bin\pacman --needed --noconfirm -S git  # for 'make version'
110
    - c:\msys64\usr\bin\pacman --needed --noconfirm -S wget  # for downloading data files
Jerome Flesch's avatar
Jerome Flesch committed
111
    - c:\msys64\usr\bin\pacman --needed --noconfirm -S mingw-w64-i686-python3-cx_Freeze
112
    - c:\msys64\usr\bin\pacman --needed --noconfirm -S zip unzip
Jerome Flesch's avatar
Jerome Flesch committed
113
114
    - c:\msys64\usr\bin\pacman --needed --noconfirm -S mingw-w64-i686-nsis
    - c:\msys64\usr\bin\pacman --needed --noconfirm -S mingw-w64-i686-nsis-nsisunz
Jerome Flesch's avatar
Jerome Flesch committed
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
    - git submodule init
    - git submodule update --recursive --remote
    - c:\msys64\usr\bin\bash -lc "make clean"
    - c:\msys64\usr\bin\bash -lc "make uninstall"
    # a 2nd time just to be really sure
    # (that's the problem when can't use containers ..)
    - c:\msys64\usr\bin\bash -lc "make uninstall"


windows_tests:
  stage: tests_data_doc
  only:
    - branches@World/OpenPaperwork/paperwork
    - tags@World/OpenPaperwork/paperwork
  variables:
    MSYSTEM: "MINGW32"
    CHERE_INVOKING: "yes"
  tags:
    - windows
    - msys2
  <<: *windows
  script:
    # Tesseract (required for unit tests)
138
    - c:\msys64\usr\bin\pacman --needed --noconfirm -S mingw-w64-i686-libarchive  # missing tesseract dependency
Jerome Flesch's avatar
Jerome Flesch committed
139
140
141
142
    - c:\msys64\usr\bin\pacman --needed --noconfirm -S mingw-w64-i686-tesseract-ocr
    - c:\msys64\usr\bin\pacman --needed --noconfirm -S mingw-w64-i686-tesseract-data-eng
    - c:\msys64\usr\bin\pacman --needed --noconfirm -S mingw-w64-i686-tesseract-data-fra
    # Build
143
    - c:\msys64\usr\bin\bash -lc "export TESSDATA_PREFIX=/mingw32/share/tessdata && make install test"
Jerome Flesch's avatar
Jerome Flesch committed
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
    - c:\msys64\usr\bin\bash -lc "make uninstall"


windows_exe:
  stage: deploy_windows
  only:
    - branches@World/OpenPaperwork/paperwork
    - tags@World/OpenPaperwork/paperwork
  variables:
    MSYSTEM: "MINGW32"
    CHERE_INVOKING: "yes"
  tags:
    - windows
    - msys2
  <<: *windows
  script:
160
161
162
163
164
165
    # We need rclone to upload the files on OVH object storage
    - c:\msys64\usr\bin\rm -f rclone-v1.50.1-windows-386.zip
    - c:\msys64\usr\bin\rm -rf rclone-v1.50.1-windows-386
    - c:\msys64\usr\bin\wget -q https://downloads.rclone.org/v1.50.1/rclone-v1.50.1-windows-386.zip
    - c:\msys64\usr\bin\unzip rclone-v1.50.1-windows-386.zip
    - c:\msys64\usr\bin\cp rclone-v1.50.1-windows-386/rclone.exe /usr/bin
166
    # Build
Jerome Flesch's avatar
Jerome Flesch committed
167
    - c:\msys64\usr\bin\bash -lc "make windows_exe"
168
    - c:\msys64\usr\bin\bash -lc "./ci/deliver.sh dist/paperwork.zip windows .zip"
Jerome Flesch's avatar
Jerome Flesch committed
169
    - c:\msys64\usr\bin\bash -lc "make uninstall"