Build examples in github workflow #12
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build & Test | |
on: | |
push: | |
branches: ["main"] | |
pull_request: | |
branches: ["main"] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Rust | |
run: | | |
curl -L https://github.com/esp-rs/espup/releases/latest/download/espup-x86_64-unknown-linux-gnu -o espup | |
chmod a+x espup && ./espup install | |
source $HOME/export-esp.sh | |
- name: Build | |
run: cargo build --verbose | |
- name: Run lib test | |
run: cargo test --lib --verbose | |
- name: Test documentation generation | |
run: cargo test && cargo doc | |
- name: Build examples | |
if: always() | |
run: | | |
for dir in examples/*/; do | |
echo "Building $dir" | |
(cd "$dir" && cargo build --release) | |
done |