37
37
swift build --sanitize=address
38
38
swift test --sanitize=address
39
39
40
- run-test-suite-windows :
41
- runs-on : windows-latest
42
- steps :
43
- - uses : actions/checkout@v3
44
- - uses : Swatinem/rust-cache@v2
45
- - name : ' Setup Rust'
46
- run : |
47
- curl -sSf https://sh.rustup.rs | sh -s -- -y
48
- - name : ' Install environment packages'
49
- run : |
50
- choco install -y cmake protoc openssl
51
- shell : sh
52
- - name : ' Install IPFS Kubo'
53
- uses : ibnesayeed/setup-ipfs@master
54
- with :
55
- ipfs_version : v0.17.0
56
- run_daemon : true
57
- - name : ' Run Rust native target tests'
58
- # Increase stack size on Windows tests; (non-main) threads are spawned with 2MB
59
- # default stack size, which `orb_can_render_peers_in_the_sphere_address_book`
60
- # uses (at time of writing) slightly more than 2MB. While we could set the thread
61
- # stack size at runtime (via tokio's `thread_stack_size`), it appears to not solve the
62
- # problem, possibly due to the harness thread overflowing (e.g. a non-main thread that
63
- # we can't configure within the test). In lieu of that, set RUST_MIN_STACK to increase
64
- # the stack sizes of threads created by tokio within tests, as well as the test harness
65
- # threads themselves.
66
- #
67
- # While our main thread isn't under fire here, notating this for future use:
68
- # https://users.rust-lang.org/t/stack-overflow-when-compiling-on-windows-10/50818/8
69
- run : $env:RUST_MIN_STACK = '4000000'; cargo test --features test-kubo,helpers
70
- env :
71
- NOOSPHERE_LOG : deafening
72
-
73
40
run-linting-linux :
74
41
runs-on : ubuntu-latest
75
42
steps :
@@ -89,15 +56,31 @@ jobs:
89
56
- name : ' Run Linter'
90
57
run : cargo clippy --all -- -D warnings
91
58
92
- run-test-suite-linux :
93
- runs-on : ubuntu-latest
59
+ run-rust-test-suite :
60
+ name : ' Run Rust test suite'
61
+ strategy :
62
+ matrix :
63
+ features : ['test-kubo,headers', 'test-kubo,headers,rocksdb']
64
+ platform : ['ubuntu-latest', 'windows-latest', 'macos-13']
65
+ toolchain : ['stable']
66
+ exclude :
67
+ - platform : ' windows-latest'
68
+ features : ' test-kubo,headers,rocksdb'
69
+ runs-on : ${{ matrix.platform }}
94
70
steps :
95
71
- uses : actions/checkout@v3
96
72
- uses : Swatinem/rust-cache@v2
97
73
- name : ' Setup Rust'
98
74
run : |
99
75
curl -sSf https://sh.rustup.rs | sh -s -- -y
100
- - name : ' Install environment packages'
76
+ rustup toolchain install ${{matrix.toolchain}}
77
+ - name : ' Install environment packages (Windows)'
78
+ if : ${{ matrix.platform == 'windows-latest' }}
79
+ run : |
80
+ choco install -y cmake protoc openssl
81
+ shell : sh
82
+ - name : ' Install environment packages (Linux)'
83
+ if : ${{ matrix.platform == 'ubuntu-latest' }}
101
84
run : |
102
85
sudo apt-get update -qqy
103
86
sudo apt-get install jq protobuf-compiler cmake
@@ -106,28 +89,55 @@ jobs:
106
89
with :
107
90
ipfs_version : v0.17.0
108
91
run_daemon : true
109
- - name : ' Run Rust native target tests'
110
- run : NOOSPHERE_LOG=deafening cargo test --features test-kubo,headers
111
-
112
- run-test-suite-linux-rocksdb :
113
- runs-on : ubuntu-latest
114
- steps :
115
- - uses : actions/checkout@v3
116
- - uses : Swatinem/rust-cache@v2
117
- - name : ' Setup Rust'
92
+ - name : Install cargo-binstall
93
+ uses :
cargo-bins/[email protected]
94
+ - name : Install binaries from cargo
118
95
run : |
119
- curl -sSf https://sh.rustup.rs | sh -s -- -y
120
- - name : ' Install environment packages'
96
+ cargo +${{ matrix.toolchain }} binstall cargo-nextest --no-confirm --force
97
+ - name : ' Run Rust tests'
98
+ shell : bash
121
99
run : |
122
- sudo apt-get update -qqy
123
- sudo apt-get install jq protobuf-compiler cmake libclang-dev
124
- - name : ' Install IPFS Kubo'
125
- uses : ibnesayeed/setup-ipfs@master
100
+ mkdir -p test-results
101
+
102
+ echo "${{ matrix.platform }}
103
+ ${{ matrix.features }}
104
+ ${{ matrix.toolchain}}" > test-results/target
105
+
106
+ FEATURES="";
107
+
108
+ if [ -n "${{matrix.features}}" ]; then
109
+ FEATURES="--features ${{matrix.features}}"
110
+ fi
111
+
112
+ # Increase stack size on Windows tests; (non-main) threads are spawned with 2MB
113
+ # default stack size, which `orb_can_render_peers_in_the_sphere_address_book`
114
+ # uses (at time of writing) slightly more than 2MB. While we could set the thread
115
+ # stack size at runtime (via tokio's `thread_stack_size`), it appears to not solve the
116
+ # problem, possibly due to the harness thread overflowing (e.g. a non-main thread that
117
+ # we can't configure within the test). In lieu of that, set RUST_MIN_STACK to increase
118
+ # the stack sizes of threads created by tokio within tests, as well as the test harness
119
+ # threads themselves.
120
+ #
121
+ # While our main thread isn't under fire here, notating this for future use:
122
+ # https://users.rust-lang.org/t/stack-overflow-when-compiling-on-windows-10/50818/8
123
+ if [[ "${{matrix.platform}}" == "windows-latest" ]]
124
+ export RUST_MIN_STACK = '4000000'
125
+ fi
126
+
127
+ cargo +${{ matrix.toolchain }} nextest run $FEATURES --retries 5 --color always 2>&1 | tee test-results/log
128
+ env :
129
+ NOOSPHERE_LOG : academic
130
+ - uses : actions/upload-artifact@v3
126
131
with :
127
- ipfs_version : v0.17.0
128
- run_daemon : true
129
- - name : ' Run Rust native target tests (RocksDB)'
130
- run : NOOSPHERE_LOG=defeaning cargo test -p noosphere -p noosphere-storage --features rocksdb,test-kubo
132
+ name : test-results-${{ hashFiles('./test-results') }}
133
+ path : ./test-results
134
+
135
+ report-test-flakes :
136
+ name : ' Report test flakes (Linux)'
137
+ needs : ['run-rust-test-suite']
138
+ if : always()
139
+ uses : ./.github/workflows/report_test_flakes.yaml
140
+ secrets : inherit
131
141
132
142
run-test-suite-linux-c :
133
143
runs-on : ubuntu-latest
0 commit comments