-
Notifications
You must be signed in to change notification settings - Fork 21
83 lines (66 loc) · 2.39 KB
/
pre-compile.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# This workflow will pre-compile the module using mpy-cross
# To test with act:
# act -j precompile-v5 -s GITHUB_TOKEN=GH_token --artifact-server-path artifacts_v5
# act -j precompile-v6 -s GITHUB_TOKEN=GH_token --artifact-server-path artifacts_v6
name: Pre-compile modules
on:
push:
jobs:
precompile-v5:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
path: max30102
- uses: actions/checkout@v3
with:
repository: 'micropython/micropython'
path: micropython
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.8'
# For MicroPython version <1.19, compile with mpy-cross-v5
- name: Install mpy-cross v5
run: |
pip install mpy-cross-v5
- name: Pre-compile module using mpy-cross v5
run: |
mkdir -p precompiled/v5/max30102
python -m mpy_cross_v5 max30102/max30102/__init__.py -o precompiled/v5/max30102/__init__.mpy
python -m mpy_cross_v5 max30102/max30102/circular_buffer.py -o precompiled/v5/max30102/circular_buffer.mpy
ls -l precompiled/v5/max30102
- name: Upload artifact for MicroPython version <=1.18
uses: actions/upload-artifact@v2
with:
name: v1.18_precompiled_module
path: precompiled/v5
precompile-v6:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
path: max30102
- uses: actions/checkout@v3
with:
repository: 'micropython/micropython'
path: micropython
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.8'
# For MicroPython version 1.19+, compile with mpy-cross-v6
- name: Install mpy-cross v6
run: |
pip install mpy-cross-v6
- name: Pre-compile module using mpy-cross v6
run: |
mkdir -p precompiled/v6/max30102
python -m mpy_cross_v6 max30102/max30102/__init__.py -o precompiled/v6/max30102/__init__.mpy
python -m mpy_cross_v6 max30102/max30102/circular_buffer.py -o precompiled/v6/max30102/circular_buffer.mpy
ls -l precompiled/v6/max30102
- name: Upload artifact for MicroPython version >=1.19
uses: actions/upload-artifact@v2
with:
name: v1.19_precompiled_module
path: precompiled/v6