.gitlab-ci.yml 4.64 KB
Newer Older
1
2
3
4
cache:
    paths:
        - build/Boost/src/Boost

5
stages:
Felipe Shi Iu Wu's avatar
Felipe Shi Iu Wu committed
6
    - lint
7
8
9
    - build
    - test

Felipe Shi Iu Wu's avatar
Felipe Shi Iu Wu committed
10
11
pattern:
    stage: lint
rafaelatc3sl's avatar
rafaelatc3sl committed
12
    image: 'debian:stretch'
Felipe Shi Iu Wu's avatar
Felipe Shi Iu Wu committed
13
14
15
16
17
18
19
20
    tags:
        - regular
        - debian
    script:
        - shopt -s extglob
        - apt-get update && apt-get install -y git python
        - git clone https://github.com/google/styleguide
        - cd styleguide/cpplint
21
        - ./cpplint.py --filter=-whitespace/blank_line,-build/include_what_you_use,-readability/casting ../../src/agent/!(jsoncpp).cpp
Felipe Shi Iu Wu's avatar
Felipe Shi Iu Wu committed
22

23
compileUnix:
24
    stage: build
rafaelatc3sl's avatar
rafaelatc3sl committed
25
    image: 'debian:stretch'
26
27
    artifacts:
        paths:
28
            - agent-1234.run
29
30
31
            - bin/agent-v0.0
            - conf/datasid-conf.json
            - conf/proxy-conf.json
32
    tags:
33
        - regular
34
35
36
        - debian
    script:
        - echo "Estágio 'build'"
37
        - apt-get update && apt-get install -y build-essential cmake git makeself
38
          libudev-dev
39
40
        - git submodule init
        - git submodule update --init --recursive
41
        - mkdir -p build
42
        - cd build
43
        - cmake -DCURL_STATICLIB=ON  ..
44
        - make
45
        - cd ..
46
        - chmod +x generate_agent.sh
rafaelatc3sl's avatar
rafaelatc3sl committed
47
        - ./generate_agent.sh -idp=1234 -ws=www.C3Sl.ufpr.br -pch=simmcdev.c3sl.ufpr.br -pcp=3000 -pcu=ninguem -pcpasswd=123mudar -prj=simmc
48
        - chmod +x agent-1234.run
49

50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
compileWin32:
    stage: build
    artifacts:
        paths:
            - agent-32.exe
    tags:
        - inno
    script:
        - echo "Estágio 'build'"
        - dpkg --add-architecture i386
        - apt-get update && apt-get install -y build-essential cmake git makeself
          libudev-dev g++-mingw-w64-i686
        - git submodule init
        - git submodule update --init --recursive
        - mkdir -p build
        - cd build
        - cmake -D CMAKE_TOOLCHAIN_FILE=mingw_cross_toolchain_32-bit.cmake ..
        - make
        - su inno
        - Xvfb :98 &
        - export DISPLAY=:98
        - cd /
rafaelatc3sl's avatar
rafaelatc3sl committed
72
        - wine /home/inno/iscc ./builds/simmctic/agent/generate_agent.iss /Didp=1234 /Dws=www.C3Sl.ufpr.br /Dpch=simmcdev.c3sl.ufpr.br /Dpcp=3000 /Dpcu=ninguem /Dpcpasswd=123mudar /Dprj=simmc /Dversion=1.0.0
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
        - mv ./builds/simmctic/agent/agent-1234.exe ./builds/simmctic/agent/agent-32.exe

compileWin64:
    stage: build
    artifacts:
        paths:
            - agent-64.exe
    tags:
        - inno
    script:
        - echo "Estágio 'build'"
        - apt-get update && apt-get install -y build-essential cmake git makeself
          libudev-dev g++-mingw-w64-x86-64
        - git submodule init
        - git submodule update --init --recursive
        - mkdir -p build
        - cd build
        - cmake -D CMAKE_TOOLCHAIN_FILE=mingw_cross_toolchain_64-bit.cmake ..
        - make
        - su inno
        - Xvfb :98 &
        - export DISPLAY=:98
        - cd /
rafaelatc3sl's avatar
rafaelatc3sl committed
96
        - wine /home/inno/iscc ./builds/simmctic/agent/generate_agent.iss /Didp=1234 /Dws=www.C3Sl.ufpr.br /Dpch=simmcdev.c3sl.ufpr.br /Dpcp=3000 /Dpcu=ninguem /Dpcpasswd=123mudar /Dprj=simmc /Dversion=1.0.0
97
        - mv ./builds/simmctic/agent/agent-1234.exe ./builds/simmctic/agent/agent-64.exe
98

99
100
testDebian:
    stage: test
rafaelatc3sl's avatar
rafaelatc3sl committed
101
    image: 'debian:stretch'
102
    tags:
103
        - regular
104
105
        - debian
    script:
106
        - apt-get update && apt-get install -y git jq faketime expect cron
107
        - git clone https://github.com/sstephenson/bats.git
108
        - ./agent-1234.run --quiet
109
110
        - cd bats
        - ./install.sh /usr
111
        - cd ../test
112
113
        - ./create_users.sh
        - last -F
114
        - ./init.sh
115
        - ./returnTest.bats
116
    dependencies:
117
        - compileUnix
118
119
120

testUbuntu:
    stage: test
rafaelatc3sl's avatar
rafaelatc3sl committed
121
    image: 'ubuntu:16.04'
122
123
    tags:
        - ubuntu
124
        - regular
125
    script:
126
        - apt-get update && apt-get install -y bats jq faketime expect cron
127
        - ./agent-1234.run --quiet
128
        - cd test
129
130
        - ./create_users.sh
        - last -F
131
        - ./init.sh
132
133
        - ./returnTest.bats
    dependencies:
134
        - compileUnix
135
136
137
138
139
140
141

testOpensuse:
    stage: test
    tags:
        - opensuse
    script:
        - zypper -n update
142
        - zypper -n install bats jq libfaketime expect tar cron gzip
143
144
145
        - touch /var/log/wtmp
        - chown root.tty /var/log/wtmp
        - chmod 664 /var/log/wtmp
146
        - ./agent-1234.run --quiet
147
        - cd test
148
149
        - ./create_users.sh
        - last -F
150
        - ./init.sh
151
        - ./returnTest.bats
152
    dependencies:
153
        - compileUnix
154

155
156
157
158
# Optamos por remover os testes do windows, pois não conseguimos criar o runner, visto que sua
# criação iriam ter um impacto negativo em todos os demais runners.
# Caso se deseje testar o programa pelo windows existe o script test/testWin.bat, que ira realizar os testes,
# no ambiente windows.