summaryrefslogtreecommitdiff
path: root/.gitlab-ci.yml
blob: 2c339f508df7b72fa13990499416b903c1b030ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# This file controls GitLab CI (Continuous Integration) for FLTK.
#
# It serves two purposes:
#
# (1) Continuously building FLTK with several build systems.
# (2) Generating current HTML documentation and putting it online.
#
# The documentation will be viewable at:
#
# https://fltk.gitlab.io/<repository>/
#
# <repository> can be one of:
#  - fltk
#  - fltk-test
#
# Details of this script:
#
# use the official gcc image, based on debian
# can use versions as well, like gcc:5.2
# see https://hub.docker.com/_/gcc/

image: gcc

stages:
  - build
  - test
  - deploy

# Build with autoconf/make (including Pango and Cairo)

build-autotools:
  stage: build
  # install the necessary build tools
  before_script:
    - apt update && apt -y install make autoconf man
    - apt -y install freeglut3-dev libfontconfig-dev libxft-dev libglew-dev
    - apt -y install libxcursor-dev libxinerama-dev libasound2-dev
    - apt -y install libpango1.0-dev libcairo2-dev
  script:
    - make clean
    - ./configure --enable-pango --enable-cairo
    - time make -j3
    - cd examples && time make
  artifacts:
    paths:
      - lib/
      - test/cairo_test
      - test/glpuzzle
      - test/unittests
      - test/fltk-versions

# Build with CMake and Ninja (default configuration)

build-cmake:
  stage: build
  # install the necessary build tools
  before_script:
    - apt update && apt -y install cmake ninja-build
    - apt -y install freeglut3-dev libfontconfig-dev libxft-dev libglew-dev
    - apt -y install libxcursor-dev libxinerama-dev libasound2-dev
  script:
    - mkdir build && cd build
    - cmake -DCMAKE_BUILD_TYPE=Debug -DFLTK_BUILD_EXAMPLES=ON -G Ninja ..
    - time ninja
  artifacts:
    paths:
      - build/lib/
      - build/bin/

# Build HTML documentation

documentation:
  stage: build
  only:
    - schedules
  # install the necessary build tools
  before_script:
    - apt update && apt -y install make autoconf man doxygen
  script:
    - make clean
    - doxygen --version
    - cd documentation && make && make html
  artifacts:
    paths:
      - documentation/src/*.[1-6]
      - documentation/html

  # depending on your build setup it's most likely a good idea to
  #   cache outputs to reduce the build time
  # cache:
  #   paths:
  #     - "*.o"

# run tests using the binary built before
#test:
#  stage: test
#  script:
#    - ./runmytests.sh


# Generate and install HTML documentation

pages:
  stage: deploy
  # install the necessary build tools
  before_script:
    - apt update && apt -y install make autoconf man doxygen
  script:
    - make clean
    - cd documentation
    - make && make html
    - cd ..
    - mkdir -p public/
    - mv documentation/html/* public/
  artifacts:
    paths:
      - public