@@ -3,17 +3,13 @@ name: CI
3
3
on : [pull_request]
4
4
5
5
jobs :
6
- tests :
6
+ linux- tests :
7
7
strategy :
8
8
matrix :
9
9
toolchain :
10
10
- nightly
11
11
- 1.43
12
- os :
13
- - ubuntu-latest
14
- - macOS-latest
15
- - windows-latest
16
- runs-on : ${{ matrix.os }}
12
+ runs-on : ubuntu-latest
17
13
steps :
18
14
- name : Checkout source code
19
15
uses : actions/checkout@v2
@@ -23,14 +19,99 @@ jobs:
23
19
toolchain : ${{ matrix.toolchain }}
24
20
override : true
25
21
profile : minimal
22
+ # We need to download Tor for the tests. Not needed if
23
+ # you don't run the tor-specific tests, which need to
24
+ # start a tor HS from command line.
25
+ - name : Download Tor
26
+ run : sudo apt-get install -y tor
26
27
- name : Build on Rust ${{ matrix.toolchain }}
27
- run : cargo build --verbose --color always
28
+ run : cargo build --all-features -- verbose --color always
28
29
- name : Test on Rust ${{ matrix.toolchain }}
29
30
run : cargo test --all-features --verbose --color always
30
31
- name : Fuzz
31
- if : matrix.os == 'ubuntu-latest' && matrix. toolchain == 'nightly'
32
+ if : matrix.toolchain == 'nightly'
32
33
run : ./fuzz/run.sh
33
34
35
+ macos-tests :
36
+ strategy :
37
+ matrix :
38
+ toolchain :
39
+ - nightly
40
+ - 1.43
41
+ runs-on : macOS-latest
42
+ steps :
43
+ - name : Checkout source code
44
+ uses : actions/checkout@v2
45
+ - name : Install Rust ${{ matrix.toolchain }} toolchain
46
+ uses : actions-rs/toolchain@v1
47
+ with :
48
+ toolchain : ${{ matrix.toolchain }}
49
+ override : true
50
+ profile : minimal
51
+ # We need to download Tor for the tests. Not needed if
52
+ # you don't run the tor-specific tests, which need to
53
+ # start a tor HS from command line.
54
+ - name : Download deps
55
+ run : brew install tor autoconf automake
56
+ - name : Build on Rust ${{ matrix.toolchain }}
57
+ run : cargo build --all-features -vv --color always
58
+ - name : Test on Rust ${{ matrix.toolchain }}
59
+ run : cargo test --all-features -vv --color always
60
+
61
+ windows-tests :
62
+ strategy :
63
+ matrix :
64
+ toolchain :
65
+ - nightly
66
+ - 1.43
67
+ runs-on : windows-latest
68
+ steps :
69
+ - name : Checkout source code
70
+ uses : actions/checkout@v2
71
+ - name : Install Rust ${{ matrix.toolchain }} toolchain
72
+ uses : actions-rs/toolchain@v1
73
+ with :
74
+ toolchain : ${{ matrix.toolchain }}
75
+ override : true
76
+ profile : minimal
77
+ - name : Build on Rust ${{ matrix.toolchain }}
78
+ # We can't compile tor on windows, cross-compile only :)
79
+ run : cargo build --verbose --color always
80
+ - name : Test on Rust ${{ matrix.toolchain }}
81
+ run : cargo test --verbose --color always
82
+
83
+ # We only cross compile revualt_net with the tor feature for windows,
84
+ # but we don't run any test. In the future we could download the artifact
85
+ # from CI and try to run it *somehow*, at the moment I think the tests
86
+ # are Unix dependent anyways.
87
+ windows-cross-compile-tor :
88
+ strategy :
89
+ matrix :
90
+ toolchain :
91
+ - nightly
92
+ - 1.43
93
+ runs-on : ubuntu-latest
94
+ steps :
95
+ - name : Checkout source code
96
+ uses : actions/checkout@v2
97
+ - name : Install needed deps
98
+ run : sudo apt-get update && sudo apt-get install -y mingw-w64 tar
99
+ - name : Install Rust ${{ matrix.toolchain }} toolchain
100
+ uses : actions-rs/toolchain@v1
101
+ with :
102
+ toolchain : ${{ matrix.toolchain }}
103
+ target : x86_64-pc-windows-gnu
104
+ override : true
105
+ profile : minimal
106
+ # libsodium build.rs is broken: https://github.com/sodiumoxide/sodiumoxide/issues/377
107
+ # We need to manually download libsodium and give it to cargo while compiling
108
+ # Note that we could use the libsodium.a already provided in sodiumoxide, but it's tricky to find
109
+ # FIXME: we are not verifying sigs!! In CI who cares but don't forget to verify them in real life lol
110
+ - name : Download libsodium
111
+ run : wget https://download.libsodium.org/libsodium/releases/libsodium-1.0.18-mingw.tar.gz && tar xvf libsodium-1.0.18-mingw.tar.gz
112
+ - name : Build on Rust ${{ matrix.toolchain }}
113
+ run : SODIUM_LIB_DIR=$PWD/libsodium-win64/lib/ cargo build -vv --color always --all-features --target x86_64-pc-windows-gnu
114
+
34
115
rustfmt_check :
35
116
runs-on : ubuntu-latest
36
117
steps :
0 commit comments