forked from yegor256/micromap
-
Notifications
You must be signed in to change notification settings - Fork 0
33 lines (33 loc) · 1020 Bytes
/
examples.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# SPDX-FileCopyrightText: Copyright (c) 2023-2025 Yegor Bugayenko
# SPDX-FileCopyrightText: Copyright (c) 2025 owtotwo
# SPDX-License-Identifier: MIT
---
# yamllint disable rule:line-length
name: examples
'on':
push:
pull_request:
jobs:
run-examples:
timeout-minutes: 15
runs-on: ubuntu-24.04
env:
CARGO_TERM_COLOR: always
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- id: list-examples
# For now we only identify single .rs file examples, and will not consider the examples
# listed in cargo.toml or complex examples in the form of Cargo workspace folders.
run: |
{
echo "examples<<EOF"
find examples -name '*.rs' -print0 | xargs -0 -I {} basename {} .rs
echo "EOF"
} >> "$GITHUB_ENV"
- run: |
echo "${{ env.examples }}" | while IFS= read -r example; do
cargo run --example "$example"
done