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

chore(ci): Run examples in CI #297

Merged
merged 2 commits into from
Nov 21, 2024
Merged
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
13 changes: 13 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,19 @@ jobs:
components: rustfmt
- run: just fmt-check

examples:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: taiki-e/install-action@just
- uses: dtolnay/rust-toolchain@nightly
with:
toolchain: nightly
- run: just examples

cfg-check:
runs-on: ubuntu-latest
timeout-minutes: 30
Expand Down
9 changes: 9 additions & 0 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ alias f := fmtf
alias b := build
alias h := hack
alias c := check
alias e := examples

# default recipe to display help information
default:
Expand Down Expand Up @@ -62,3 +63,11 @@ source:
# Generate file bindings for super-registry
bind:
@just --justfile ./crates/registry/Justfile bind

# List all available examples and run each one
examples:
example_list=$(cargo build --example 2>&1); \
example_list=$(echo "$example_list" | tail -n +3 | sed 's/^[ \t]*//;s/[ \t]*$//'); \
for example in $example_list; do \
cargo run --example $example; \
done
Loading