Skip to content

Commit 36346c3

Browse files
authored
Merge pull request #225 from TcMenu/main-unity-test
#221 move unit tests to unity, in progress.
2 parents bc61c56 + 1741fac commit 36346c3

File tree

2 files changed

+63
-0
lines changed

2 files changed

+63
-0
lines changed

.github/workflows/test.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Test
2+
on: [push]
3+
4+
jobs:
5+
test:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@v4
9+
- uses: actions/cache@v4
10+
with:
11+
path: |
12+
~/.cache/pip
13+
~/.platformio/.cache
14+
key: ${{ runner.os }}-pio
15+
- name: Install dependencies
16+
run: sudo apt-get update && sudo apt-get install -y libsdl2-2.0-0
17+
- uses: actions/setup-python@v5
18+
with:
19+
python-version: '3.12'
20+
- name: Install PlatformIO Core
21+
run: pip install --upgrade platformio
22+
- name: Set up QEMU
23+
id: setup-qemu
24+
run: |
25+
if [[ "$(uname -m)" == "x86_64" ]]; then
26+
QEMU_URL="https://github.com/espressif/qemu/releases/download/esp-develop-8.2.0-20240122/qemu-xtensa-softmmu-esp_develop_8.2.0_20240122-x86_64-linux-gnu.tar.xz"
27+
elif [[ "$(uname -m)" == "aarch64" ]]; then
28+
QEMU_URL="https://github.com/espressif/qemu/releases/download/esp-develop-8.2.0-20240122/qemu-xtensa-softmmu-esp_develop_8.2.0_20240122-aarch64-linux-gnu.tar.xz"
29+
else
30+
echo "Unsupported architecture: $(uname -m)"
31+
exit 1
32+
fi
33+
wget $QEMU_URL -O qemu.tar.xz
34+
mkdir -p qemu
35+
tar -xf qemu.tar.xz -C qemu --strip-components=1
36+
sudo mv qemu /usr/local/qemu
37+
38+
- name: Add QEMU to PATH
39+
run: echo "/usr/local/qemu/bin" >> $GITHUB_PATH
40+
41+
- name: Run unit tests
42+
run: pio test --without-uploading --project-conf=platformio-test.ini
43+
44+
static-analysis:
45+
runs-on: ubuntu-latest
46+
steps:
47+
- uses: actions/checkout@v4
48+
- uses: actions/cache@v4
49+
with:
50+
path: |
51+
~/.cache/pip
52+
~/.platformio/.cache
53+
key: ${{ runner.os }}-pio
54+
- uses: actions/setup-python@v5
55+
with:
56+
python-version: '3.12'
57+
58+
- name: Install PlatformIO Core
59+
run: pip install --upgrade platformio
60+
61+
- name: Run static analysis
62+
run: pio check

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# TcMenu library for Arduino and mbed.
22
[![PlatformIO](https://github.com/TcMenu/tcMenuLib/actions/workflows/platformio.yml/badge.svg)](https://github.com/TcMenu/tcMenuLib/actions/workflows/platformio.yml)
3+
[![Test](https://github.com/TcMenu/tcMenuLib/actions/workflows/test.yml/badge.svg)](https://github.com/TcMenu/tcMenuLib/actions/workflows/test.yml)
34
[![License: Apache 2.0](https://img.shields.io/badge/license-Apache--2.0-green.svg)](https://github.com/TcMenu/tcMenuLib/blob/main/LICENSE)
45
[![GitHub release](https://img.shields.io/github/release/TcMenu/tcMenuLib.svg?maxAge=3600)](https://github.com/TcMenu/tcMenuLib/releases)
56
[![davetcc](https://img.shields.io/badge/davetcc-dev-blue.svg)](https://github.com/davetcc)

0 commit comments

Comments
 (0)