@@ -3,71 +3,87 @@ name: CI
33on : [pull_request]
44
55jobs :
6- tests :
7- strategy :
8- matrix :
9- toolchain :
10- - nightly
11- - 1.43
12- os :
13- - ubuntu-latest
14- - macOS-latest
15- - windows-latest
16- runs-on : ${{ matrix.os }}
17- steps :
18- - name : Checkout source code
19- uses : actions/checkout@v2
20- - name : Install Rust ${{ matrix.toolchain }} toolchain
21- uses : actions-rs/toolchain@v1
22- with :
23- toolchain : ${{ matrix.toolchain }}
24- override : true
25- profile : minimal
26- - name : Build on Rust ${{ matrix.toolchain }} default features
27- # We can't compile tor on windows, cross-compile only :)
28- if : matrix.os == 'windows-latest'
29- run : cargo build --verbose --color always
30- - name : Build on Rust ${{ matrix.toolchain }} all features
31- if : matrix.os != 'windows-latest'
32- run : cargo build --all-features --verbose --color always
33- - name : Test on Rust ${{ matrix.toolchain }} default features
34- # We can't compile tor on windows, cross-compile only :)
35- if : matrix.os == 'windows-latest'
36- run : cargo test --verbose --color always
37- - name : Test on Rust ${{ matrix.toolchain }} all features
38- if : matrix.os != 'windows-latest'
39- run : cargo test --all-features --verbose --color always
40- - name : Fuzz
41- if : matrix.os == 'ubuntu-latest' && matrix.toolchain == 'nightly'
42- run : ./fuzz/run.sh
43-
44- windows-tor-cross-compile :
45- strategy :
46- matrix :
47- toolchain :
48- - nightly
49- - 1.43
50- runs-on : ubuntu-latest
51- steps :
52- - name : Checkout source code
53- uses : actions/checkout@v2
54- - name : Install Rust ${{ matrix.toolchain }} toolchain
55- uses : actions-rs/toolchain@v1
56- with :
57- toolchain : ${{ matrix.toolchain }}
58- target : x86_64-pc-windows-gnu
59- override : true
60- profile : minimal
61- - name : Install MingW
62- run : sudo apt-get update && sudo apt-get install -y mingw-w64
63- - name : Cross-compile for Windows
64- run : cargo build --all-features --verbose --color always --target x86_64-pc-windows-gnu
65-
6+ # linux-tests:
7+ # strategy:
8+ # matrix:
9+ # toolchain:
10+ # - nightly
11+ # - 1.43
12+ # runs-on: ubuntu-latest
13+ # steps:
14+ # - name: Checkout source code
15+ # uses: actions/checkout@v2
16+ # - name: Install Rust ${{ matrix.toolchain }} toolchain
17+ # uses: actions-rs/toolchain@v1
18+ # with:
19+ # toolchain: ${{ matrix.toolchain }}
20+ # override: true
21+ # profile: minimal
22+ # # We need to download Tor for the tests. Notice that it's not
23+ # # needed if you don't run the tests
24+ # - name: Download Tor
25+ # run: sudo apt-get install -y tor
26+ # - name: Build on Rust ${{ matrix.toolchain }}
27+ # run: cargo build --all-features --verbose --color always
28+ # - name: Test on Rust ${{ matrix.toolchain }}
29+ # run: cargo test --all-features --verbose --color always
30+ # - name: Fuzz
31+ # if: matrix.toolchain == 'nightly'
32+ # run: ./fuzz/run.sh
33+ #
34+ # macos-tests:
35+ # strategy:
36+ # matrix:
37+ # toolchain:
38+ # - nightly
39+ # - 1.43
40+ # runs-on: macOS-latest
41+ # steps:
42+ # - name: Checkout source code
43+ # uses: actions/checkout@v2
44+ # - name: Install Rust ${{ matrix.toolchain }} toolchain
45+ # uses: actions-rs/toolchain@v1
46+ # with:
47+ # toolchain: ${{ matrix.toolchain }}
48+ # override: true
49+ # profile: minimal
50+ # # We need to download Tor for the tests. Notice that it's not
51+ # # needed if you don't run the tests
52+ # - name: Download deps
53+ # run: brew install tor autoconf
54+ # - name: Build on Rust ${{ matrix.toolchain }}
55+ # run: cargo build --all-features --verbose --color always
56+ # - name: Test on Rust ${{ matrix.toolchain }}
57+ # run: cargo test --all-features --verbose --color always
58+ #
6659 # windows-tests:
6760 # strategy:
6861 # matrix:
6962 # toolchain:
70- # #- nightly
63+ # - nightly
64+ # - 1.43
65+ # runs-on: windows-latest
66+ # steps:
67+ # - name: Checkout source code
68+ # uses: actions/checkout@v2
69+ # - name: Install Rust ${{ matrix.toolchain }} toolchain
70+ # uses: actions-rs/toolchain@v1
71+ # with:
72+ # toolchain: ${{ matrix.toolchain }}
73+ # override: true
74+ # profile: minimal
75+ # - name: Build on Rust ${{ matrix.toolchain }}
76+ # # We can't compile tor on windows, cross-compile only :)
77+ # run: cargo build --verbose --color always
78+ # - name: Test on Rust ${{ matrix.toolchain }}
79+ # # We can't compile tor on windows, cross-compile only :)
80+ # run: cargo test --verbose --color always
81+
82+ # windows-tests-full:
83+ # strategy:
84+ # matrix:
85+ # toolchain:
86+ # - nightly
7187 # - 1.43
7288 # runs-on: windows-latest
7389 # steps:
@@ -80,29 +96,77 @@ jobs:
8096 # with:
8197 # toolchain: ${{ matrix.toolchain }}
8298 # target: x86_64-pc-windows-gnu
83- # override: true
99+ # # override: true
84100 # profile: minimal
85101 # - name: Debug
86102 # run: rustup show
87103 # # libsodium build.rs is broken: https://github.com/sodiumoxide/sodiumoxide/issues/377
88104 # - name: Fix libsodium compilation
89105 # run: rustup default stable-gnu
90- # #rustup set default-host x86_64-pc-windows-gnu
106+ # - name: Fix libsodium compilation again
107+ # run: rustup set default-host x86_64-pc-windows-gnu
91108 # - name: Debug
92109 # run: rustup show
93110 # - name: Build on Rust ${{ matrix.toolchain }}
94111 # run: cargo build -vv --color always --all-features
95112 # - name: Test on Rust ${{ matrix.toolchain }}
96113 # run: cargo test --all-features --verbose --color always
97114
98- rustfmt_check :
115+ windows-tests-full :
116+ strategy :
117+ matrix :
118+ toolchain :
119+ # - nightly
120+ - 1.43
99121 runs-on : ubuntu-latest
100122 steps :
101- - uses : actions/checkout@v1
102- - uses : actions-rs/toolchain@v1
123+ - name : Checkout source code
124+ uses : actions/checkout@v2
125+ - name : Install Rust ${{ matrix.toolchain }} toolchain
126+ uses : actions-rs/toolchain@v1
103127 with :
104- toolchain : stable
105- components : rustfmt
106- override : true
107- - run : cargo fmt -- --check
128+ toolchain : ${{ matrix.toolchain }}
129+ target : x86_64-pc-windows-gnu
130+ override : true
131+ profile : minimal
132+ - name : Install toolchain
133+ run : sudo apt-get update && sudo apt-get install -y mingw-w64 tar
134+ - name : Debug
135+ run : rustup show
136+ - name : Find libsodium
137+ run : export SODIUM_LIB_DIR=$(find ~/.cargo/registry -name libsodium.a | grep libsodium-sys-0.2.7 | grep mingw/win64)
138+ - name : Debug
139+ run : find $HOME/.cargo/registry -name libsodium.a
140+ - name : Debug2
141+ run : ls $HOME/.cargo/registry
142+ - name : Debug3
143+ run : wget https://download.libsodium.org/libsodium/releases/libsodium-1.0.18-mingw.tar.gz && tar xvf libsodium-1.0.18-mingw.tar.gz
144+ - name : Find libsodium
145+ run : export SODIUM_LIB_DIR=$PWD/libsodium-1.0.18-mingw/libsodium-win64/lib/libsodium.a
146+ - name : Debug4
147+ run : ls $SODIUM_LIB_DIR
148+ - name : Debug5
149+ run : echo $SODIUM_LIB_DIR
150+ # libsodium build.rs is broken: https://github.com/sodiumoxide/sodiumoxide/issues/377
151+ # - name: Install target toolchain
152+ # - name: Fix libsodium compilation
153+ # run: rustup default stable-gnu
154+ # - name: Fix libsodium compilation again
155+ # run: rustup set default-host x86_64-pc-windows-gnu
156+ # - name: Debug
157+ # run: rustup show
158+ - name : Build on Rust ${{ matrix.toolchain }}
159+ run : SODIUM_LIB_DIR=$PWD/libsodium-1.0.18-mingw/libsodium-win64/lib/ cargo build -vv --color always --all-features --target x86_64-pc-windows-gnu -j 1
160+ # run: SODIUM_LIB_DIR=$(find ~/.cargo/registry -name libsodium.a | grep libsodium-sys-0.2.7 | grep mingw/win64) cargo build -vv --color always --all-features --target x86_64-pc-windows-gnu -j 1
108161
162+ # rustfmt_check:
163+ # runs-on: ubuntu-latest
164+ # steps:
165+ # - uses: actions/checkout@v1
166+ # - uses: actions-rs/toolchain@v1
167+ # with:
168+ # toolchain: stable
169+ # components: rustfmt
170+ # override: true
171+ # - run: cargo fmt -- --check
172+ #
0 commit comments