Skip to content

Commit

Permalink
chore: speed up check-features (#481)
Browse files Browse the repository at this point in the history
  • Loading branch information
tobz authored Feb 10, 2025
1 parent b8af303 commit 535a88b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
7 changes: 5 additions & 2 deletions .ci/images/build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,17 @@ ENV PATH="/usr/local/go/bin:${PATH}"
RUN curl -s -L -o /tmp/go-1.23.0.tar.gz https://go.dev/dl/go1.23.0.linux-${TARGETARCH}.tar.gz
RUN tar -C /usr/local -xzf /tmp/go-1.23.0.tar.gz

# Install Protocol Buffers compiler by hand, since Ubuntu 14.04 does not have a recent enough version.
# Install a number of packages/tools by hand, because the versions in Ubuntu 14.04 are too old or not available at all.
COPY .ci/install-protoc.sh /
RUN chmod +x /install-protoc.sh && /install-protoc.sh

# Install awscli by hand, for similar reasons to the Protocol Buffers compiler.
COPY .ci/install-awscli.sh /
RUN chmod +x /install-awscli.sh && /install-awscli.sh

RUN curl -s -L -o /tmp/jq https://github.com/jqlang/jq/releases/download/jq-1.7.1/jq-linux-${TARGETARCH} && \
mv /tmp/jq /usr/local/bin/jq && \
chmod +x /usr/local/bin/jq

# Install Rust and common Cargo tooling that we depend on.
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain ${RUST_VERSION}
ENV PATH="/root/.cargo/bin:${PATH}"
Expand Down
10 changes: 8 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,9 @@ check-rust-build-tools:
ifeq ($(shell command -v cargo >/dev/null || echo not-found), not-found)
$(error "Please install Rust: https://www.rust-lang.org/tools/install")
endif
ifeq ($(shell command -v jq >/dev/null || echo not-found), not-found)
$(error "Please install jq: https://jqlang.org/download/")
endif

##@ Running

Expand Down Expand Up @@ -380,9 +383,12 @@ check-licenses: ## Check that the third-party license file is up to date

.PHONY: check-features
check-features: check-rust-build-tools cargo-install-cargo-hack
check-features: ## Check that ADP builds with all possible combinations of feature flags
check-features: ## Checks that all packages with feature flags can be built with different flag combinations
@echo "[*] Checking feature flag compatibility matrix..."
@cargo hack check --feature-powerset --tests --quiet
@find . -name Cargo.toml | grep -v '^./Cargo.toml' | \
xargs -I {} -- cargo read-manifest --manifest-path {} | \
jq -r "select(.features | del(.default) | length > 0) | .name" | \
xargs -I {} -- cargo hack --feature-powerset --package {} check --tests --quiet

##@ Testing

Expand Down

0 comments on commit 535a88b

Please sign in to comment.