-
Notifications
You must be signed in to change notification settings - Fork 33
48 lines (46 loc) · 1.82 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
name: CI
on: [push, pull_request]
jobs:
tests:
name: "Python ${{ matrix.python-version }}"
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- name: Install dependencies
run: sudo apt-get install -y gcc-avr avr-libc simulavr
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Checkout code
uses: actions/checkout@v4
- name: Compile C library
run: |
gcc --std=c90 -pedantic -c -Wall -Werror -fpic -o src/secplus.o src/secplus.c
gcc --std=c90 -pedantic -shared -o libsecplus.so src/secplus.o
- name: Compile C library for AVR
run: avr-gcc -mmcu=attiny85 -Os -Wall -Werror -o test/avr_test.elf src/secplus.c test/avr_test.c
- name: Test
run: |
TEST_CYCLES=50000 ./test_secplus.py
TEST_CYCLES=50000 TEST_MODE=c ./test_secplus.py
TEST_CYCLES=1000 TEST_MODE=avr ./test_secplus.py
micropython:
name: "MicroPython"
runs-on: ubuntu-22.04
steps:
- name: Install dependencies
run: sudo apt-get install micropython
- name: Install MicroPython modules
run: |
mkdir -p ~/.micropython/lib/
curl https://raw.githubusercontent.com/micropython/micropython-lib/v1.22.2/python-stdlib/random/random.py > ~/.micropython/lib/random.py
mkdir -p ~/.micropython/lib/unittest/
curl https://raw.githubusercontent.com/micropython/micropython-lib/v1.22.2/python-stdlib/unittest/unittest/__init__.py > ~/.micropython/lib/unittest/__init__.py
- name: Checkout code
uses: actions/checkout@v4
- name: Test
run: |
TEST_CYCLES=50000 micropython ./test_secplus.py