Skip to content

Commit f0b0c10

Browse files
committed
Test
1 parent 78baf89 commit f0b0c10

File tree

8 files changed

+55
-50
lines changed

8 files changed

+55
-50
lines changed

.github/scripts/on-push.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ fi
6969

7070
SCRIPTS_DIR="./.github/scripts"
7171
if [ "$BUILD_PIO" -eq 0 ]; then
72-
#source ${SCRIPTS_DIR}/install-arduino-ide.sh
7372
source ${SCRIPTS_DIR}/install-arduino-cli.sh
7473
source ${SCRIPTS_DIR}/install-arduino-core-esp32.sh
7574

.github/scripts/tests_build.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ while [ ! -z "$1" ]; do
5151
shift
5252
done
5353

54-
#source ${SCRIPTS_DIR}/install-arduino-ide.sh
5554
source ${SCRIPTS_DIR}/install-arduino-cli.sh
5655
source ${SCRIPTS_DIR}/install-arduino-core-esp32.sh
5756

.github/workflows/hw.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,18 @@ jobs:
5656
with:
5757
ref: ${{ github.event.pull_request.head.sha || github.sha }}
5858

59+
- uses: actions/setup-python@v5
60+
if: steps.check-tests.outputs.enabled == 'true'
61+
with:
62+
cache: 'pip'
63+
python-version: '3.10.1'
64+
65+
- name: Install dependencies
66+
if: ${{ steps.check-tests.outputs.enabled == 'true' }}
67+
run: |
68+
pip install -U pip
69+
pip install -r tests/requirements.txt --extra-index-url https://dl.espressif.com/pypi
70+
5971
- name: Get binaries
6072
id: cache-build-binaries
6173
uses: actions/cache/restore@v4
@@ -68,12 +80,6 @@ jobs:
6880
~/.arduino/tests/**/build*.tmp/*.elf
6981
~/.arduino/tests/**/build*.tmp/*.json
7082
71-
- name: Install dependencies
72-
if: ${{ steps.check-tests.outputs.enabled == 'true' }}
73-
run: |
74-
pip install -U pip
75-
pip install -r tests/requirements.txt --extra-index-url https://dl.espressif.com/pypi
76-
7783
- name: Run Tests
7884
if: ${{ steps.check-tests.outputs.enabled == 'true' }}
7985
run: |

.github/workflows/push.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,6 @@ jobs:
3535
- uses: actions/setup-python@v5
3636
with:
3737
python-version: '3.x'
38-
- name: Cache tools
39-
id: cache-linux
40-
uses: actions/cache@v4
41-
with:
42-
path: |
43-
~/arduino_ide
44-
key: ${{ runner.os }}-${{ hashFiles('.github/scripts/install-arduino-ide.sh') }}
4538

4639
- name: Get libs cache
4740
uses: actions/cache@v4

.github/workflows/qemu.yml

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,12 @@ concurrency:
1414
group: qemu-${{ github.event.pull_request.number || github.ref }}-${{ inputs.chip }}-${{ inputs.type }}
1515
cancel-in-progress: true
1616

17-
env:
18-
QEMU_INSTALL_PATH: "$HOME"
19-
2017
jobs:
2118
qemu-test:
2219
name: QEMU ${{ inputs.chip }} ${{ inputs.type }} tests
2320
env:
2421
id: ${{ github.event.pull_request.number || github.ref }}-${{ inputs.chip }}-${{ inputs.type }}-${{ github.event.pull_request.head.sha || github.sha }}
22+
QEMU_INSTALL_PATH: "$HOME"
2523
runs-on: ubuntu-latest
2624
steps:
2725
- name: Check if already run
@@ -54,6 +52,25 @@ jobs:
5452
with:
5553
ref: ${{ github.event.pull_request.head.sha || github.sha }}
5654

55+
- uses: actions/setup-python@v5
56+
if: steps.check-tests.outputs.enabled == 'true'
57+
with:
58+
cache: 'pip'
59+
python-version: '3.x'
60+
61+
- name: Install Python dependencies
62+
if: steps.check-tests.outputs.enabled == 'true'
63+
run: |
64+
pip install -U pip
65+
pip install -r tests/requirements.txt --extra-index-url https://dl.espressif.com/pypi
66+
67+
- name: Install APT dependencies
68+
uses: awalsh128/[email protected]
69+
if: steps.check-tests.outputs.enabled == 'true'
70+
with:
71+
packages: libpixman-1-0 libnuma1 libglib2.0-0 libslirp0 libsdl2-2.0-0
72+
version: 1.0
73+
5774
- name: Get QEMU version
5875
uses: pozetroninc/[email protected]
5976
if: steps.check-tests.outputs.enabled == 'true'
@@ -64,27 +81,17 @@ jobs:
6481
repo: qemu
6582
excludes: prerelease, draft
6683

67-
- name: Cache tools
68-
id: cache-linux
84+
- name: Cache QEMU
85+
id: cache-qemu
6986
uses: actions/cache@v4
7087
if: steps.check-tests.outputs.enabled == 'true'
7188
with:
7289
path: |
7390
~/qemu
74-
~/.cache/pip
75-
key: qemu-${{ steps.get-qemu-version.outputs.release }}-${{ hashFiles('.github/workflows/qemu.yml',
76-
'tests/requirements.txt',
77-
'.github/workflows/tests.yml') }}
78-
79-
- name: Install dependencies
80-
if: steps.check-tests.outputs.enabled == 'true'
81-
run: |
82-
pip install -U pip
83-
pip install -r tests/requirements.txt --extra-index-url https://dl.espressif.com/pypi
84-
sudo apt update && sudo apt install libpixman-1-0 libnuma1 libglib2.0-0 libslirp0 libsdl2-2.0-0
91+
key: qemu-${{ steps.get-qemu-version.outputs.release }}-${{ hashFiles('.github/workflows/qemu.yml') }}
8592

8693
- name: Download QEMU
87-
if: steps.cache-linux.outputs.cache-hit != 'true' && steps.check-tests.outputs.enabled == 'true'
94+
if: steps.cache-qemu.outputs.cache-hit != 'true' && steps.check-tests.outputs.enabled == 'true'
8895
run: |
8996
cd ${{ env.QEMU_INSTALL_PATH }}
9097
underscore_release=$(echo ${{ steps.get-qemu-version.outputs.release }} | sed 's/\-/_/g')

.github/workflows/tests.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ concurrency:
1111
group: tests-${{ github.event.pull_request.number || github.ref }}
1212
cancel-in-progress: true
1313

14-
permissions: {}
14+
# To avoid giving elevated permissions to the entire workflow, specify default permissions at the top level
15+
# and then override them for specific jobs.
16+
permissions: { contents: read }
1517

1618
jobs:
1719
gen-matrix:
@@ -95,7 +97,6 @@ jobs:
9597
name: Run tests on QEMU
9698
uses: ./.github/workflows/qemu.yml
9799
needs: [gen-matrix, call-build-tests]
98-
if: false
99100
strategy:
100101
fail-fast: false
101102
matrix:

.github/workflows/wokwi.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,16 @@ jobs:
6767
cache: 'pip'
6868
python-version: '3.x'
6969

70+
- name: Install dependencies
71+
if: steps.check-tests.outputs.enabled == 'true'
72+
run: |
73+
pip install -U pip
74+
pip install -r tests/requirements.txt --extra-index-url https://dl.espressif.com/pypi
75+
76+
- name: Install Wokwi CLI
77+
if: steps.check-tests.outputs.enabled == 'true'
78+
run: curl -L https://wokwi.com/ci/install.sh | sh
79+
7080
- name: Get binaries
7181
if: steps.check-tests.outputs.enabled == 'true'
7282
id: cache-build-binaries
@@ -79,16 +89,6 @@ jobs:
7989
~/.arduino/tests/**/build*.tmp/*.elf
8090
~/.arduino/tests/**/build*.tmp/*.json
8191
82-
- name: Install Wokwi CLI
83-
if: steps.check-tests.outputs.enabled == 'true'
84-
run: curl -L https://wokwi.com/ci/install.sh | sh
85-
86-
- name: Install dependencies
87-
if: steps.check-tests.outputs.enabled == 'true'
88-
run: |
89-
pip install -U pip
90-
pip install -r tests/requirements.txt --extra-index-url https://dl.espressif.com/pypi
91-
9292
- name: Run Tests
9393
if: steps.check-tests.outputs.enabled == 'true'
9494
env:

tests/requirements.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
cryptography>=2.1.4
1+
cryptography==42.0.7
22
--only-binary cryptography
3-
pytest-cov
4-
pytest-embedded-serial-esp>=1.10.2
5-
pytest-embedded-arduino>=1.10.2
6-
pytest-embedded-wokwi>=1.10.2
7-
pytest-embedded-qemu>=1.10.2
3+
pytest-cov==5.0.0
4+
pytest-embedded-serial-esp==1.10.2
5+
pytest-embedded-arduino==1.10.2
6+
pytest-embedded-wokwi==1.10.2
7+
pytest-embedded-qemu==1.10.2

0 commit comments

Comments
 (0)