From 71f4cd184c28d5b31010ed47bf13c979900aeda2 Mon Sep 17 00:00:00 2001
From: Aaron Fenyes <aaron.fenyes@fareycircles.ooo>
Date: Sat, 8 Mar 2025 11:11:01 -0800
Subject: [PATCH] Fail continuous integration on warnings

---
 .../workflows/continuous-integration.yaml     | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/.forgejo/workflows/continuous-integration.yaml b/.forgejo/workflows/continuous-integration.yaml
index d200b53..762ee62 100644
--- a/.forgejo/workflows/continuous-integration.yaml
+++ b/.forgejo/workflows/continuous-integration.yaml
@@ -3,7 +3,7 @@ on:
   push:
     branches: [main]
 jobs:
-  # build the application, reporting success if the build completes
+  # build the application, reporting success if there are no errors or warnings
   build:
     runs-on: docker
     container:
@@ -13,9 +13,10 @@ jobs:
         working-directory: app-proto
     steps:
       - uses: https://code.forgejo.org/actions/checkout@v4
-      - run: trunk build
+      - run: RUSTFLAGS='-D warnings' trunk build
   
-  # run the automated tests, reporting success if the tests pass
+  # run the automated tests, reporting success if the tests pass and were built
+  # without warnings
   test:
     runs-on: docker
     container:
@@ -25,14 +26,14 @@ jobs:
         working-directory: app-proto
     steps:
       - uses: https://code.forgejo.org/actions/checkout@v4
-      - run: cargo test
+      - 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
+  # report success if the examples build and run without errors or warnings
   run-examples:
     runs-on: docker
     container:
@@ -42,7 +43,7 @@ jobs:
         working-directory: app-proto
     steps:
       - uses: https://code.forgejo.org/actions/checkout@v4
-      - run: cargo run --example irisawa-hexlet
-      - run: cargo run --example three-spheres
-      - run: cargo run --example point-on-sphere
-      - run: cargo run --example kaleidocycle
\ No newline at end of file
+      - 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