1name: Linux
2
3on:
4   push:
5      branches: [ RC_1_2 RC_2_0 master ]
6   pull_request:
7
8jobs:
9
10   build:
11      name: build
12      runs-on: ubuntu-20.04
13      continue-on-error: true
14
15      strategy:
16         matrix:
17            config: [ asio-debugging=on picker-debugging=on, extensions=off logging=off streaming=off super-seeding=off share-mode=off predictive-pieces=off dht=off alert-msg=off encryption=off mutable-torrents=off deprecated-functions=off, crypto=gcrypt ]
18
19      steps:
20      - name: checkout
21        uses: actions/checkout@v2.3.3
22        with:
23           submodules: recursive
24
25      - name: update package lists
26        continue-on-error: true
27        run: |
28          sudo apt update
29
30      - name: install boost
31        run: |
32          sudo apt install libboost-tools-dev libboost-dev libboost-system-dev
33          echo "using gcc ;" >>~/user-config.jam
34
35      - name: install gcrypt
36        run: sudo apt install libgcrypt20-dev
37
38      - name: build library
39        run: |
40          b2 ${{ matrix.config }} -j2 cxxstd=11
41
42      - name: build examples
43        run: |
44          cd examples
45          b2 ${{ matrix.config }} -j2 cxxstd=11
46
47      - name: build tools
48        run: |
49          cd tools
50          b2 ${{ matrix.config }} -j2 cxxstd=11
51
52
53
54   fuzzers:
55      name: Fuzzers
56      runs-on: ubuntu-20.04
57      continue-on-error: true
58
59      steps:
60      - name: checkout
61        uses: actions/checkout@v2.3.3
62        with:
63           submodules: recursive
64
65      - name: update package lists
66        continue-on-error: true
67        run: |
68          sudo apt update
69
70      - name: install boost
71        run: |
72          sudo apt install libboost-tools-dev libboost-dev libboost-system-dev
73          echo "using clang : 9 : clang++-9 ;" >>~/user-config.jam
74
75      - name: build library
76        run: |
77          cd fuzzers
78          b2 clang -j2 cxxstd=11
79
80
81
82   check_headers:
83      name: check headers
84      runs-on: ubuntu-20.04
85
86      steps:
87      - name: checkout
88        uses: actions/checkout@v2.3.3
89        with:
90           submodules: recursive
91
92      - name: update package lists
93        continue-on-error: true
94        run: |
95          sudo apt update
96
97      - name: install boost
98        run: |
99          sudo apt install libboost-tools-dev libboost-dev libboost-system-dev
100          echo "using gcc ;" >>~/user-config.jam
101
102      - name: compile header files individually
103        run: |
104          b2 -j2 check-headers cxxstd=11
105
106
107
108   clang_tidy:
109      name: clang-tidy
110      runs-on: ubuntu-20.04
111
112      steps:
113      - name: checkout
114        uses: actions/checkout@v2.3.3
115        with:
116           submodules: recursive
117
118      - name: update package lists
119        continue-on-error: true
120        run: |
121          sudo apt update
122
123      - name: install clang-tidy
124        run: sudo apt install clang-tidy libc++-dev
125
126      - name: install boost
127        run: |
128          sudo apt install libboost-tools-dev libboost-dev
129          echo "using clang_tidy : : clang-tidy \"-checks=-clang-analyzer-core.*,-clang-analyzer-unix.*\" : <cxxflags>-std=c++11 <cxxflags>-I/usr/local/clang-7.0.0/include/c++/v1 <cxxflags>-stdlib=libc++ <linkflags>-stdlib=libc++ ;" >> ~/user-config.jam;
130
131      - name: analyze
132        run: |
133          b2 -a -j2 clang_tidy
134
135
136
137   test:
138      name: Tests
139      runs-on: ubuntu-20.04
140      continue-on-error: true
141
142      strategy:
143         matrix:
144            config: [ crypto=openssl, toolset=clang, deprecated-functions=off ]
145
146      steps:
147      - name: checkout
148        uses: actions/checkout@v2.3.3
149        with:
150           submodules: recursive
151
152      - name: update package lists
153        continue-on-error: true
154        run: |
155          sudo apt update
156
157      - name: install boost
158        run: |
159          sudo apt install libboost-tools-dev libboost-dev libboost-system-dev
160          echo "using gcc ;" >>~/user-config.jam
161          echo "using clang : 9 : clang++-9 ;" >>~/user-config.jam
162
163      - name: build and run tests
164        uses: nick-invision/retry@v2
165        with:
166          timeout_minutes: 30
167          retry_wait_seconds: 4
168          max_attempts: 3
169          command: (cd test; b2 ${{ matrix.config }} -j2 -l400 debug-iterators=on invariant-checks=full asserts=on cxxstd=11)
170
171
172
173   sim:
174      name: Simulations
175      runs-on: ubuntu-20.04
176
177      steps:
178      - name: checkout
179        uses: actions/checkout@v2.3.3
180        with:
181           submodules: recursive
182
183      - name: update package lists
184        continue-on-error: true
185        run: |
186          sudo apt update
187
188      - name: install boost
189        run: |
190          sudo apt install libboost-tools-dev libboost-dev libboost-system-dev
191          echo "using gcc ;" >>~/user-config.jam
192
193      - name: build and run simulations
194        run: |
195          cd simulation
196          b2 -j2 debug-iterators=on invariant-checks=full asserts=on picker-debugging=on
197
198
199   dist:
200      name: build dist
201      runs-on: ${{ matrix.os }}
202
203      strategy:
204         matrix:
205            os: [ubuntu-20.04, ubuntu-18.04]
206
207      steps:
208      - name: checkout
209        uses: actions/checkout@v2.3.3
210        with:
211           submodules: recursive
212
213      - name: update package lists
214        continue-on-error: true
215        run: |
216          sudo apt update
217
218      - name: install dependencies
219        run: |
220          sudo apt install libboost-tools-dev libboost-python-dev libboost-dev libboost-system-dev
221          sudo apt install python-docutils python-pygments python-pil gsfonts inkscape icoutils graphviz hunspell imagemagick python3-setuptools
222          python3 -m pip install aafigure
223          echo "using gcc ;" >>~/user-config.jam
224
225      - name: build tarball
226        run: |
227          ./autotool.sh
228          ./configure --enable-python-binding --enable-examples=yes --enable-encryption --enable-tests=yes
229          (cd docs; make AAFIGURE=~/.local/bin/aafigure RST2HTML=rst2html html)
230          make dist
231
232      - uses: actions/upload-artifact@v2
233        with:
234          name: tarball
235          path: libtorrent-rasterbar-*.tar.gz
236
237      - name: test-tarball (install)
238        run: |
239          tar xvzf libtorrent-rasterbar-*.tar.gz
240          cd libtorrent-rasterbar-*/
241          b2 install cxxflags=-std=c++11 --prefix=test-install-root
242          cat test-install-root/share/pkgconfig/libtorrent-rasterbar.pc
243
244      - name: test-tarball (bjam)
245        uses: nick-invision/retry@v2
246        with:
247          timeout_minutes: 30
248          retry_wait_seconds: 4
249          max_attempts: 3
250          command: |
251            cd libtorrent-rasterbar-*/test
252            b2 cxxflags=-std=c++11 testing.execute=off
253            b2 cxxflags=-std=c++11 test_torrent_info
254
255      - name: test-tarball (make)
256        run: |
257          cd libtorrent-rasterbar-*/
258          ./configure --enable-python-binding --enable-examples=yes --enable-encryption --enable-tests=yes
259          make -j2
260