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
|
- uses: actions/setup-python@v6
|
||||||
with:
|
with:
|
||||||
python-version: '3.14'
|
python-version: "3.14"
|
||||||
|
|
||||||
- name: Install clang-format-21
|
- name: Install clang-format-21
|
||||||
run: |
|
run: |
|
||||||
@@ -42,7 +42,7 @@ jobs:
|
|||||||
|
|
||||||
- uses: actions/setup-python@v6
|
- uses: actions/setup-python@v6
|
||||||
with:
|
with:
|
||||||
python-version: '3.14'
|
python-version: "3.14"
|
||||||
|
|
||||||
- name: Install uv
|
- name: Install uv
|
||||||
uses: astral-sh/setup-uv@v7
|
uses: astral-sh/setup-uv@v7
|
||||||
@@ -65,7 +65,7 @@ jobs:
|
|||||||
|
|
||||||
- uses: actions/setup-python@v6
|
- uses: actions/setup-python@v6
|
||||||
with:
|
with:
|
||||||
python-version: '3.14'
|
python-version: "3.14"
|
||||||
|
|
||||||
- name: Install uv
|
- name: Install uv
|
||||||
uses: astral-sh/setup-uv@v7
|
uses: astral-sh/setup-uv@v7
|
||||||
@@ -102,12 +102,50 @@ jobs:
|
|||||||
path: .pio/build/default/firmware.bin
|
path: .pio/build/default/firmware.bin
|
||||||
if-no-files-found: error
|
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
|
# This job is used as the PR required actions check, allows for changes to other steps in the future without breaking
|
||||||
# PR requirements.
|
# PR requirements.
|
||||||
test-status:
|
test-status:
|
||||||
name: Test Status
|
name: Test Status
|
||||||
needs:
|
needs:
|
||||||
- build
|
- build
|
||||||
|
- run-tests
|
||||||
- clang-format
|
- clang-format
|
||||||
- cppcheck
|
- cppcheck
|
||||||
if: always()
|
if: always()
|
||||||
|
|||||||
Reference in New Issue
Block a user