1717 fail-fast : false
1818 matrix :
1919 os : [ubuntu-latest, macos-13, windows-latest]
20- rust-toolchain : [1.70.0, stable, beta]
20+ rust-toolchain : [1.70.0, stable, nightly]
21+ type : [debug]
22+ include :
23+ - os : ubuntu-latest
24+ rust-toolchain : stable
25+ type : release
26+ env :
27+ BUILD_TYPE : ${{ matrix.type == 'release' && '--release' || '' }}
2128 runs-on : ${{ matrix.os }}
2229 defaults :
2330 run :
3542 env :
3643 DEBIAN_FRONTEND : noninteractive
3744 run : |
38- sudo apt-get install -y --no-install-recommends gyp mercurial ninja-build
45+ sudo apt-get install -y --no-install-recommends gyp mercurial ninja-build lld
3946 curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
47+ echo "RUSTFLAGS=-C link-arg=-fuse-ld=lld" >> "$GITHUB_ENV"
4048
4149 # In addition to installing dependencies, first make sure System Integrity Protection (SIP)
4250 # is disabled on this MacOS runner. This is needed to allow the NSS libraries to be loaded
@@ -47,13 +55,15 @@ jobs:
4755 if : runner.os == 'MacOS'
4856 run : |
4957 csrutil status | grep disabled
50- brew install ninja mercurial cargo-binstall
58+ brew install ninja mercurial cargo-binstall llvm
59+ echo "/usr/local/opt/llvm/bin" >> "$GITHUB_PATH"
5160 # python3 -m pip install gyp-next
5261 # Above does not work, since pypi only has gyp 0.15.0, which is too old
5362 # for the homebrew python3. Install from source instead.
5463 python3 -m pip install git+https://github.com/nodejs/gyp-next
5564 python3 -m pip install packaging
5665 echo "$(python3 -m site --user-base)/bin" >> "$GITHUB_PATH"
66+ echo "RUSTFLAGS=-C link-arg=-fuse-ld=lld" >> "$GITHUB_ENV"
5767
5868 - name : Install dependencies (Windows)
5969 if : runner.os == 'Windows'
6575 run : |
6676 echo "C:\\msys64\\usr\\bin" >> "$GITHUB_PATH"
6777 echo "C:\\msys64\\mingw64\\bin" >> "$GITHUB_PATH"
68- /c/msys64/usr/bin/pacman -S --noconfirm nsinstall
78+ /c/msys64/usr/bin/pacman -S --noconfirm nsinstall lld
6979 python3 -m pip install git+https://github.com/nodejs/gyp-next
7080 echo "$(python3 -m site --user-base)/bin" >> "$GITHUB_PATH"
81+ echo "RUSTFLAGS=-C link-arg=-fuse-ld=lld.exe" >> "$GITHUB_ENV"
7182
7283 - name : Set up MSVC build environment (Windows)
7384 if : runner.os == 'Windows'
@@ -83,10 +94,11 @@ jobs:
8394 # version of NSS. Ubuntu 20.04 only has 3.49, which is far too old.
8495 # (neqo-crypto/build.rs would also need to query pkg-config to get the
8596 # right build flags rather than building NSS.)
97+ # Clone from the main hg repo, because the GitHub mirror can be out of date.
8698 - name : Fetch NSS and NSPR
8799 run : |
88100 hg clone https://hg.mozilla.org/projects/nspr "$NSPR_DIR"
89- git clone --depth=1 https://github.com/nss-dev /nss "$NSS_DIR"
101+ hg clone https://hg.mozilla.org/projects /nss "$NSS_DIR"
90102 echo "NSS_DIR=$NSS_DIR" >> "$GITHUB_ENV"
91103 echo "NSPR_DIR=$NSPR_DIR" >> "$GITHUB_ENV"
92104 env :
@@ -104,44 +116,50 @@ jobs:
104116
105117 - name : Build
106118 run : |
107- cargo +${{ matrix.rust-toolchain }} build -v --all-targets
108- echo "LD_LIBRARY_PATH=${{ github.workspace }}/dist/Debug/lib" >> "$GITHUB_ENV"
109- echo "DYLD_FALLBACK_LIBRARY_PATH=${{ github.workspace }}/dist/Debug/lib" >> "$GITHUB_ENV"
110- echo "${{ github.workspace }}/dist/Debug/lib" >> "$GITHUB_PATH"
119+ cargo +${{ matrix.rust-toolchain }} build $BUILD_TYPE --all-targets --features ci,bench
120+ echo "LD_LIBRARY_PATH=${{ github.workspace }}/dist/$LIB_DIR/lib" >> "$GITHUB_ENV"
121+ echo "DYLD_FALLBACK_LIBRARY_PATH=${{ github.workspace }}/dist/$LIB_DIR/lib" >> "$GITHUB_ENV"
122+ echo "${{ github.workspace }}/dist/$LIB_DIR/lib" >> "$GITHUB_PATH"
123+ env :
124+ LIB_DIR : ${{ matrix.type == 'release' && 'Release' || 'Debug' }}
111125
112126 - name : Run tests and determine coverage
113- run : cargo +${{ matrix.rust-toolchain }} llvm-cov nextest --features ci --all-targets --no-fail-fast --lcov --output-path lcov.info
127+ run : cargo +${{ matrix.rust-toolchain }} llvm-cov nextest $BUILD_TYPE --all-targets --features ci,bench --no-fail-fast --lcov --output-path lcov.info
114128
115129 - name : Run client/server transfer
116130 run : |
117- cargo +${{ matrix.rust-toolchain }} build --bin neqo-client --bin neqo-server
118- cargo +${{ matrix.rust-toolchain }} run --bin neqo-server -- $HOST:4433 &
131+ cargo +${{ matrix.rust-toolchain }} build $BUILD_TYPE --features ci,bench --bin neqo-client --bin neqo-server
132+ cargo +${{ matrix.rust-toolchain }} run $BUILD_TYPE --features ci,bench --bin neqo-server -- $HOST:4433 &
119133 PID=$!
120- cargo +${{ matrix.rust-toolchain }} run --bin neqo-client -- --output-dir . https://$HOST:4433/$SIZE
134+ cargo +${{ matrix.rust-toolchain }} run $BUILD_TYPE --features ci,bench --bin neqo-client -- --output-dir . https://$HOST:4433/$SIZE
121135 kill $PID
122136 [ "$(wc -c <"$SIZE")" -eq "$SIZE" ] || exit 1
123137 env :
124138 HOST : localhost
125139 SIZE : 54321
126- RUST_LOG : info
140+ RUST_LOG : warn
127141
128142 - name : Check formatting
129- run : cargo +${{ matrix.rust-toolchain }} fmt --all -- --check
143+ run : |
144+ if [ "${{ matrix.rust-toolchain }}" != "nightly" ]; then
145+ export CONFIG_PATH="--config-path=$(mktemp)"
146+ fi
147+ cargo +${{ matrix.rust-toolchain }} fmt --all -- --check $CONFIG_PATH
130148 if : success() || failure()
131149
132150 - name : Clippy
133- run : cargo +${{ matrix.rust-toolchain }} clippy -v --tests -- -D warnings
151+ run : cargo +${{ matrix.rust-toolchain }} clippy --all-targets -- -D warnings
134152 if : success() || failure()
135- continue-on-error : ${{ matrix.rust-toolchain == 'beta ' }}
153+ continue-on-error : ${{ matrix.rust-toolchain == 'nightly ' }}
136154
137155 - name : Check rustdoc links
138- run : cargo +${{ matrix.rust-toolchain }} doc --verbose -- workspace --no-deps --document-private-items
156+ run : cargo +${{ matrix.rust-toolchain }} doc --workspace --no-deps --document-private-items
139157 env :
140158 RUSTDOCFLAGS : " --deny rustdoc::broken_intra_doc_links --deny warnings"
141159 if : success() || failure()
142160
143161 - name : Upload coverage reports to Codecov
144- uses : codecov/codecov-action@v3
162+ uses : codecov/codecov-action@v4
145163 with :
146164 file : lcov.info
147165 fail_ci_if_error : false
0 commit comments