Merge pull request #100 from jgoguen/ci-run-tests
feat(ci): Run tests as part of CI
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user