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

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

10
check:
11
  stage: tests
12 13 14
  only:
    - branches@World/OpenPaperwork/paperwork
    - tags@World/OpenPaperwork/paperwork
15 16 17 18 19 20
  tags:
    - linux
    - volatile
  script:
    - make check

21

22
test:
23
  stage: tests
24 25 26 27 28 29 30
  only:
    - branches@World/OpenPaperwork/paperwork
    - tags@World/OpenPaperwork/paperwork
  tags:
    - linux
    - volatile
  script:
31
    - apt-get update
32
    - source ./activate_test_env.sh && make install
33
    - source ./activate_test_env.sh && paperwork-gtk chkdeps -y && paperwork-cli chkdeps -y
34
    - source ./activate_test_env.sh && make test
Jerome Flesch's avatar
Jerome Flesch committed
35 36


37
generate_data:
38
  stage: data
39 40 41 42 43 44 45
  only:
    - branches@World/OpenPaperwork/paperwork
    - tags@World/OpenPaperwork/paperwork
  tags:
    - linux
    - volatile
  script:
46
    - apt-get update
47 48
    - source ./activate_test_env.sh && make install
    - source ./activate_test_env.sh && paperwork-gtk chkdeps -y && paperwork-cli chkdeps -y
49
    - source ./activate_test_env.sh && make data upload_data
50 51


52
doc_devel:
53
  stage: data
54 55 56
  only:
    - branches@World/OpenPaperwork/paperwork
    - tags@World/OpenPaperwork/paperwork
57
  tags:
58 59
    - linux
    - volatile
60
  script:
61
    - source ./activate_test_env.sh && make doc && make upload_doc
62

63

64
linux_flatpak:
65 66
  stage: deploy
  timeout: 48h
67 68 69 70
  only:
    - branches@World/OpenPaperwork/paperwork
    - tags@World/OpenPaperwork/paperwork
  tags:
71
    - openpaper-flatpak
72
  script:
73 74 75 76
    # Running in from a gitlab-runner directly in a shell, as the user
    # 'gitlab-runner'
    # --> not running as root, so we cannot actually install anything
    # - apt-get update
77
    # - apt-get install -y -q rsync flatpak-builder make
78
    - ./ci/update_flatpak_repo.sh
79 80


Jerome Flesch's avatar
Jerome Flesch committed
81 82
.windows: &windows
  before_script:
83
    # Libinsane build dependencies
Jerome Flesch's avatar
Jerome Flesch committed
84 85 86 87 88 89 90 91
    - 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
92
    # Paperwork build dependencies
Jerome Flesch's avatar
Jerome Flesch committed
93 94 95 96 97 98 99 100 101 102
    - 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
103
    - c:\msys64\usr\bin\pacman --needed --noconfirm -S mingw-w64-i686-python-psutil
104
    - c:\msys64\usr\bin\pacman --needed --noconfirm -S mingw-w64-i686-gettext
Jerome Flesch's avatar
Jerome Flesch committed
105
    - c:\msys64\usr\bin\pacman --needed --noconfirm -S git  # for 'make version'
106
    - c:\msys64\usr\bin\pacman --needed --noconfirm -S wget  # for downloading data files
Jerome Flesch's avatar
Jerome Flesch committed
107
    - c:\msys64\usr\bin\pacman --needed --noconfirm -S mingw-w64-i686-python3-cx_Freeze
108
    - c:\msys64\usr\bin\pacman --needed --noconfirm -S zip unzip
Jerome Flesch's avatar
Jerome Flesch committed
109 110
    - 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
111 112 113 114 115 116 117 118 119 120
    - 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:
121
  stage: tests
Jerome Flesch's avatar
Jerome Flesch committed
122 123 124 125 126 127 128 129 130 131 132 133
  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)
134
    - c:\msys64\usr\bin\pacman --needed --noconfirm -S mingw-w64-i686-libarchive  # missing tesseract dependency
Jerome Flesch's avatar
Jerome Flesch committed
135 136 137 138
    - 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
139
    - c:\msys64\usr\bin\bash -lc "export TESSDATA_PREFIX=/mingw32/share/tessdata && make install test"
Jerome Flesch's avatar
Jerome Flesch committed
140 141 142 143
    - c:\msys64\usr\bin\bash -lc "make uninstall"


windows_exe:
144
  stage: deploy
Jerome Flesch's avatar
Jerome Flesch committed
145 146 147 148 149 150 151 152 153 154 155
  only:
    - branches@World/OpenPaperwork/paperwork
    - tags@World/OpenPaperwork/paperwork
  variables:
    MSYSTEM: "MINGW32"
    CHERE_INVOKING: "yes"
  tags:
    - windows
    - msys2
  <<: *windows
  script:
156
    # We need rclone to upload the files on OVH object storage
157 158 159 160 161
    - c:\msys64\usr\bin\rm -f rclone-v1.53.3-windows-386.zip
    - c:\msys64\usr\bin\rm -rf rclone-v1.53.3-windows-386
    - c:\msys64\usr\bin\wget -q https://github.com/rclone/rclone/releases/download/v1.53.3/rclone-v1.53.3-windows-386.zip
    - c:\msys64\usr\bin\unzip rclone-v1.53.3-windows-386.zip
    - c:\msys64\usr\bin\cp rclone-v1.53.3-windows-386/rclone.exe /usr/bin
162
    # Build
Jerome Flesch's avatar
Jerome Flesch committed
163
    - c:\msys64\usr\bin\bash -lc "make windows_exe"
164
    - c:\msys64\usr\bin\bash -lc "./ci/deliver.sh dist/paperwork.zip windows .zip"
Jerome Flesch's avatar
Jerome Flesch committed
165
    - c:\msys64\usr\bin\bash -lc "make uninstall"