diff --git a/.forgejo/workflows/continuous-integration.yaml b/.forgejo/workflows/continuous-integration.yaml index 041ed09..17bc49c 100644 --- a/.forgejo/workflows/continuous-integration.yaml +++ b/.forgejo/workflows/continuous-integration.yaml @@ -17,7 +17,8 @@ jobs: - run: RUSTFLAGS='-D warnings' trunk build # run the automated tests, reporting success if the tests pass and were built - # without warnings + # without warnings. the examples are run as tests, because we've configured + # each example target with `test = true` and `harness = false` in Cargo.toml test: runs-on: docker container: @@ -27,24 +28,4 @@ jobs: working-directory: app-proto steps: - uses: https://code.forgejo.org/actions/checkout@v4 - - run: RUSTFLAGS='-D warnings' cargo test - - # run the Cargo examples, as described here: - # - # Karol Kuczmarski. "Add examples to your Rust libraries" - # http://xion.io/post/code/rust-examples.html - # - # report success if the examples build and run without errors or warnings - run-examples: - runs-on: docker - container: - image: cimg/rust:1.85-node - defaults: - run: - working-directory: app-proto - steps: - - uses: https://code.forgejo.org/actions/checkout@v4 - - run: RUSTFLAGS='-D warnings' cargo run --example irisawa-hexlet - - run: RUSTFLAGS='-D warnings' cargo run --example three-spheres - - run: RUSTFLAGS='-D warnings' cargo run --example point-on-sphere - - run: RUSTFLAGS='-D warnings' cargo run --example kaleidocycle \ No newline at end of file + - run: RUSTFLAGS='-D warnings' cargo test \ No newline at end of file diff --git a/app-proto/Cargo.toml b/app-proto/Cargo.toml index 8000327..5ab7299 100644 --- a/app-proto/Cargo.toml +++ b/app-proto/Cargo.toml @@ -50,3 +50,23 @@ wasm-bindgen-test = "0.3.34" [profile.release] opt-level = "s" # optimize for small code size debug = true # include debug symbols + +[[example]] +name = "irisawa-hexlet" +test = true +harness = false + +[[example]] +name = "kaleidocycle" +test = true +harness = false + +[[example]] +name = "point-on-sphere" +test = true +harness = false + +[[example]] +name = "three-spheres" +test = true +harness = false