-
Notifications
You must be signed in to change notification settings - Fork 8
65 lines (60 loc) · 2.03 KB
/
Copy pathpython-lint-test.yml
File metadata and controls
65 lines (60 loc) · 2.03 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: Lint and Run Test Suite
on: [push]
env:
MPY_STDLIB_COMMIT: f6723531802661e5a1fd3d63d3b7b68c38f40cd2
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: 'Checkout the code'
uses: actions/checkout@v3
- name: Set up Python.
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Lint with flake8
run: |
pip install flake8
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
test-mpy:
runs-on: ubuntu-latest
container:
image: docker.io/micropython/unix:v1.19
steps:
- name: 'Setup basic environment.'
run: apt-get update && apt-get install -y git
- name: 'Checkout the code'
uses: actions/checkout@v3
- name: 'Download MicroPython stdlib and create test environment.'
run: |
mkdir /tmp/testenv && \
cp minipb.py /tmp/testenv/ && \
cp test.py /tmp/testenv/ && \
git clone https://github.com/micropython/micropython-lib.git /tmp/micropython-lib && \
cd /tmp/micropython-lib && \
git checkout "${MPY_STDLIB_COMMIT}" && \
cp python-stdlib/bisect/bisect.py /tmp/testenv && \
cp python-stdlib/logging/logging.py /tmp/testenv && \
cp -r python-stdlib/unittest/unittest /tmp/testenv
- name: Run test suite
run: |
cd /tmp/testenv && micropython-dev test.py
test:
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: ['3.8', '3.9', '3.10']
steps:
- name: 'Checkout the code'
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Run test suite
run: |
python test.py