Skip to content

Commit

Permalink
Add --locked in CI and Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
kpcyrd authored and jsha committed Sep 28, 2023
1 parent 4e9e189 commit 6c24d48
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ jobs:
uses: dtolnay/rust-toolchain@nightly

- name: cargo test (debug; all features; -Z minimal-versions)
run: cargo -Z minimal-versions test --all-features
run: cargo -Z minimal-versions test --all-features --locked

format:
name: Format
Expand Down Expand Up @@ -190,7 +190,7 @@ jobs:
# (below) will have a new lint that we want to suppress.
# If we suppress (e.g. #![allow(clippy::arc_with_non_send_sync)]),
# we would get an unknown-lint error from older clippy versions.
run: cargo clippy --workspace -- -D warnings -A unknown-lints
run: cargo clippy --locked --workspace -- -D warnings -A unknown-lints

clippy-nightly-optional:
name: Clippy nightly (optional)
Expand All @@ -205,7 +205,7 @@ jobs:
with:
components: clippy
- name: Check clippy
run: cargo clippy --workspace -- -D warnings
run: cargo clippy --locked --workspace -- -D warnings

clang-tidy:
name: Clang Tidy
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ExternalProject_Add(
DOWNLOAD_COMMAND ""
CONFIGURE_COMMAND ""
BUILD_COMMAND cbindgen --lang C --output "${CMAKE_SOURCE_DIR}/src/rustls.h" "${CMAKE_SOURCE_DIR}"
COMMAND cargo build "$<IF:$<CONFIG:Release>,--release,-->"
COMMAND cargo build --locked "$<IF:$<CONFIG:Release>,--release,-->"
# Rely on cargo checking timestamps, rather than tell CMake where every
# output is.
BUILD_ALWAYS true
Expand All @@ -20,5 +20,5 @@ ExternalProject_Add(
# of "error" in stdout as an error, and we have some test functions that
# end in "_error". Quiet mode suppresses test names, so this is a
# sufficient workaround.
TEST_COMMAND cargo test "$<IF:$<CONFIG:Release>,--release,-->" --quiet
TEST_COMMAND cargo test --locked "$<IF:$<CONFIG:Release>,--release,-->" --quiet
)
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ else
endif

CARGO ?= cargo
CARGOFLAGS += --locked

CFLAGS := -Werror -Wall -Wextra -Wpedantic -g -I src/
PROFILE := release
Expand Down Expand Up @@ -32,7 +33,7 @@ test: all test-rust
./tests/client-server.py ./target/client ./target/server

test-rust:
${CARGO} test
${CARGO} test --locked

target:
mkdir -p $@
Expand Down
4 changes: 2 additions & 2 deletions Makefile.Windows
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ test: all
$(call green_msg, getting 'https://httpbin.org/headers' ...)
target/client.exe httpbin.org 443 /headers
$(call green_msg, Running 'cargo test')
cargo test
cargo test --locked

$(RUSTLS_LIB): src/lib.rs Cargo.toml
$(call green_msg, Building '$@')
RUSTFLAGS="--print native-static-libs" cargo build --release
RUSTFLAGS="--print native-static-libs" cargo build --release --locked
@echo

%.obj: tests/%.c
Expand Down

0 comments on commit 6c24d48

Please sign in to comment.