Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a script to execute cargo-hack #5048

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
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
19 changes: 18 additions & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
on: [ push, pull_request ]
on: [push, pull_request]

name: Rust

Expand All @@ -7,6 +7,23 @@ env:
RUSTDOCFLAGS: -D warnings

jobs:
cargo-hack-test:
name: cargo-hack test
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.76.0

- run: sudo apt-get update && sudo apt-get install libgtk-3-dev libatk1.0-dev

- name: Set up cargo cache
uses: Swatinem/rust-cache@v2

- name: Run cargo-hack
run: ./scripts/hack.sh

fmt-crank-check-test:
name: Format + check + test
runs-on: ubuntu-22.04
Expand Down
18 changes: 18 additions & 0 deletions scripts/hack.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env bash

set -eu
script_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )
cd "$script_path/.."
#set -x

export RUSTFLAGS="-D warnings"
cargo +1.76.0 install --quiet cargo-hack
# We maybe should also check "egui-wgpu" and "egui_demo_app"
members=("ecolor" "eframe" "egui" "egui_demo_lib" "egui_extras" "egui_glow" "egui-winit" "emath" "epaint" "epaint_default_fonts")

for member in "${members[@]}"; do
echo "Checking $member"
cargo hack check --each-feature --no-dev-deps --quiet --clean-per-run --manifest-path "crates/${member}/Cargo.toml"
done

echo "All checks passed!"
Loading