forked from jesec/rtorrent
-
Notifications
You must be signed in to change notification settings - Fork 1
136 lines (109 loc) · 4.27 KB
/
test-ubuntu.yml
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
name: Test on Ubuntu
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
unit-cmake:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- run: sudo apt update
- run: sudo apt install -y build-essential ninja-build libgtest-dev libcurl4-openssl-dev libncursesw5-dev libssl-dev nlohmann-json3-dev zlib1g-dev
- name: Checkout libTorrent
uses: actions/checkout@v3
with:
repository: elegant996/libtorrent
path: libtorrent
- name: Install libTorrent
run: |
cmake -GNinja -S libtorrent -B libtorrent
cmake --build libtorrent
sudo cmake --install libtorrent
sudo ldconfig
- run: cmake -B build -DCMAKE_INSTALL_PREFIX=install -GNinja .
- run: cmake --build build
- run: cmake --install build
- run: cd build && ctest --verbose
- uses: actions/upload-artifact@v2
with:
name: rtorrent-linux-cmake
path: install/
unit-bazel:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- run: sudo apt update
- run: sudo apt install -y build-essential
- run: sudo wget https://github.com/bazelbuild/bazelisk/releases/latest/download/bazelisk-linux-amd64 -O /usr/local/bin/bazel
- run: sudo chmod +x /usr/local/bin/bazel
- run: bazel coverage --instrument_test_targets --collect_code_coverage --combined_report=lcov --test_output=all //...
- uses: codecov/codecov-action@v1
with:
directory: ./bazel-out/_coverage
unit-bazel-clang:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Install Clang
run: |
ubuntu_codename=`lsb_release -c | cut -f2`
wget https://apt.llvm.org/llvm-snapshot.gpg.key
sudo apt-key add llvm-snapshot.gpg.key
sudo add-apt-repository "deb http://apt.llvm.org/$ubuntu_codename/ llvm-toolchain-$ubuntu_codename-$LLVM_VERSION main"
sudo apt-get update
sudo apt-get install -y clang-$LLVM_VERSION llvm-$LLVM_VERSION lld-$LLVM_VERSION
sudo ln -sf /usr/bin/clang-$LLVM_VERSION /usr/bin/clang
sudo ln -sf /usr/bin/ld.lld-$LLVM_VERSION /usr/bin/ld.lld
sudo ln -sf /usr/bin/llvm-ar-$LLVM_VERSION /usr/bin/llvm-ar
sudo ln -sf /usr/bin/llvm-nm-$LLVM_VERSION /usr/bin/llvm-nm
sudo ln -sf /usr/bin/llvm-objcopy-$LLVM_VERSION /usr/bin/llvm-objcopy
sudo ln -sf /usr/bin/llvm-objdump-$LLVM_VERSION /usr/bin/llvm-objdump
sudo ln -sf /usr/bin/llvm-strip-$LLVM_VERSION /usr/bin/llvm-strip
sudo ln -sf /usr/bin/llvm-config-$LLVM_VERSION /usr/bin/llvm-config
env:
LLVM_VERSION: 11
- run: sudo apt update
- run: sudo apt install -y build-essential
- run: sudo wget https://github.com/bazelbuild/bazelisk/releases/latest/download/bazelisk-linux-amd64 -O /usr/local/bin/bazel
- run: sudo chmod +x /usr/local/bin/bazel
- run: bazel test --config=clang -s //...
- run: bazel build --config=clang -s rtorrent-deb
- run: cp -L bazel-bin/rtorrent-deb.deb rtorrent.deb
- uses: actions/upload-artifact@v2
with:
name: rtorrent-deb-glibc-amd64
path: rtorrent.deb
end-to-end:
needs: unit-bazel-clang
runs-on: ubuntu-20.04
steps:
- name: Copy rTorrent built in previous job
uses: actions/download-artifact@v2
with:
name: rtorrent-deb-glibc-amd64
- name: Install rTorrent
run: |
sudo dpkg -i rtorrent.deb
rm rtorrent.deb
- name: Checkout Flood
run: |
git clone --depth 1 --branch master https://github.com/jesec/flood.git .
- name: Use Node.js LTS
uses: actions/setup-node@v3
with:
node-version: lts/*
- name: Build NPM with performant dependencies
run: |
npm i -g pnpm
pnpm i --frozen-lockfile
npm run build
- name: End-to-end test rTorrent with Flood's test suite
uses: nick-invision/retry@v2
with:
max_attempts: 5
timeout_minutes: 30
command: npm t -- --selectProjects rtorrent --runTestsByPath server/routes/api/torrents.test.ts server/routes/api/client.test.ts