Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 9 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
env:
CARGO_TERM_COLOR: always
BUILD_PROFILE: debug
WHITAKER_INSTALLER_REV: f768c2e53c47df13658af1168a67851d388750bf
WHITAKER_INSTALLER_VERSION: '0.2.5'
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
with:
Expand Down Expand Up @@ -57,31 +57,24 @@ jobs:
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405
with:
python-version: '3.x'
- name: Cache Whitaker installation
id: cache-whitaker
- name: Cache Whitaker installer
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae
with:
path: |
~/.cargo/bin/whitaker-installer
~/.local/bin/whitaker
~/.dylint_drivers
~/.local/share/whitaker
key: whitaker-v2-${{ runner.os }}-${{ env.WHITAKER_INSTALLER_REV }}
~/.cache/cargo-binstall
key: whitaker-installer-${{ runner.os }}-${{ runner.arch }}-${{ env.WHITAKER_INSTALLER_VERSION }}
- name: Install Whitaker
env:
RUSTFLAGS: ""
run: |
set -euo pipefail
echo "Whitaker cache hit: ${{ steps.cache-whitaker.outputs.cache-hit }}"
if [ "${{ steps.cache-whitaker.outputs.cache-hit }}" != "true" ]; then
echo "Installing Whitaker installer at ${WHITAKER_INSTALLER_REV}"
cargo install --locked \
--git https://github.com/leynos/whitaker \
--rev "${WHITAKER_INSTALLER_REV}" \
whitaker-installer
if command -v whitaker-installer >/dev/null 2>&1; then
echo "whitaker-installer already present; skipping cargo binstall"
else
cargo binstall --no-confirm whitaker-installer@${{ env.WHITAKER_INSTALLER_VERSION }}
fi
whitaker-installer --cranelift
echo "Whitaker binary: $(command -v whitaker || true)"
whitaker-installer
- name: Audit dependencies
if: github.actor != 'dependabot[bot]'
run: make audit
Expand Down
9 changes: 3 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ SHELL := bash

TARGET ?= librentaneko.rlib

USER_WHITAKER := $(HOME)/.local/bin/whitaker
USER_BIN_PATH := $(HOME)/.cargo/bin:$(HOME)/.local/bin:$(HOME)/.bun/bin
CARGO ?= cargo
BUILD_JOBS ?=
RUST_FLAGS ?=
Expand All @@ -21,7 +19,7 @@ COVERAGE_LINKER_FLAGS ?= -fuse-ld=lld
COVERAGE_RUST_FLAGS ?= $(RUST_FLAGS) -C link-arg=$(COVERAGE_LINKER_FLAGS)
MDLINT ?= markdownlint-cli2
NIXIE ?= nixie
WHITAKER ?= $(or $(shell command -v whitaker 2>/dev/null),$(wildcard $(USER_WHITAKER)),whitaker)
WHITAKER ?= whitaker

build: target/debug/$(TARGET) ## Build debug binary
release: target/release/$(TARGET) ## Build release binary
Expand All @@ -46,11 +44,10 @@ coverage: ## Generate lcov coverage with lld for llvm-tools compatibility
LDFLAGS="$(COVERAGE_LINKER_FLAGS)" \
$(CARGO) llvm-cov --lcov --output-path lcov.info $(TEST_FLAGS)

lint: ## Run Clippy with warnings denied
lint: ## Run Clippy and the Whitaker Dylint suite with warnings denied
RUSTDOCFLAGS="$(RUSTDOC_FLAGS)" $(CARGO) doc --no-deps
$(CARGO) clippy $(CLIPPY_FLAGS)
@echo "Whitaker binary: $(WHITAKER)"
PATH="$(USER_BIN_PATH):$(PATH)" RUSTFLAGS="$(RUST_FLAGS)" $(WHITAKER) --all -- $(CARGO_FLAGS)
RUSTFLAGS="$(RUST_FLAGS)" $(WHITAKER) --all -- $(CARGO_FLAGS)
Comment thread
leynos marked this conversation as resolved.

typecheck: ## Type-check without building
RUSTFLAGS="$(RUST_FLAGS)" $(CARGO) check $(CARGO_FLAGS)
Expand Down
Loading