From 57c313737f5531885d143e99afe1847dad7712f9 Mon Sep 17 00:00:00 2001 From: Joel Goguen Date: Sat, 18 Apr 2026 01:10:05 -0400 Subject: [PATCH] feat(ci): Run tests as part of CI --- .github/workflows/ci.yml | 44 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 41 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f933013c..3910ba30 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,7 @@ jobs: - uses: actions/setup-python@v6 with: - python-version: '3.14' + python-version: "3.14" - name: Install clang-format-21 run: | @@ -42,7 +42,7 @@ jobs: - uses: actions/setup-python@v6 with: - python-version: '3.14' + python-version: "3.14" - name: Install uv uses: astral-sh/setup-uv@v7 @@ -65,7 +65,7 @@ jobs: - uses: actions/setup-python@v6 with: - python-version: '3.14' + python-version: "3.14" - name: Install uv uses: astral-sh/setup-uv@v7 @@ -102,12 +102,50 @@ jobs: path: .pio/build/default/firmware.bin if-no-files-found: error + run-tests: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + with: + submodules: recursive + + - uses: actions/setup-python@v6 + with: + python-version: "3.14" + + - name: Run standalone tests + run: | + set +e + shopt -s nullglob + + failed=0 + tests=("test/run_*.sh") + + if [ ${#tests[@]} -eq 0 ]; then + printf 'No tests found in test/ directory\n' + exit 1 + fi + + run_test() { + printf '\n== Running %s ==\n' "${1}" + if ! bash "${1}"; then + failed=1 + fi + } + + for t in ${tests[@]}; do + run_test "$t" + done + + exit "${failed}" + # This job is used as the PR required actions check, allows for changes to other steps in the future without breaking # PR requirements. test-status: name: Test Status needs: - build + - run-tests - clang-format - cppcheck if: always()