-
Notifications
You must be signed in to change notification settings - Fork 0
98 lines (84 loc) · 3.07 KB
/
micropython.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
name: MicroPython
on:
push:
pull_request:
release:
types: [created]
jobs:
build:
name: MicroPython ${{ matrix.name }}
runs-on: ubuntu-24.04
continue-on-error: true
strategy:
matrix:
include:
- name: pico_w_inky
- name: pico2_w_inky
env:
# MicroPython version will be contained in github.event.release.tag_name for releases
RELEASE_FILE: ${{ matrix.name }}-${{ github.event.release.tag_name || github.sha }}-micropython
CI_PROJECT_ROOT: ${{ github.workspace }}/src-${{ github.sha }}
CI_BUILD_ROOT: ${{ github.workspace }}
steps:
- name: Compiler Cache Fixup
run: |
mkdir -p /home/runner/.ccache
- name: "CCache: Restore saved cache"
uses: actions/cache@v4
with:
path: /home/runner/.ccache
key: ccache-micropython-${{ matrix.name }}-${{ github.ref }}-${{ github.sha }}
restore-keys: |
ccache-micropython-${{ matrix.name }}-${{ github.ref }}
ccache-micropython-${{ matrix.name }}-
- name: "Checkout Project"
uses: actions/checkout@v4
with:
submodules: true
path: ${{ env.CI_PROJECT_ROOT }}
- name: "Install Arm GNU Toolchain (arm-none-eabi-gcc)"
uses: carlosperate/arm-none-eabi-gcc-action@v1
with:
release: '13.3.Rel1'
- name: "Prepare tools & dependencies"
shell: bash
run: |
source $CI_PROJECT_ROOT/ci/micropython.sh && ci_debug
mkdir -p $CI_BUILD_ROOT
ci_apt_install_build_deps
ci_prepare_all
- name: "MicroPython: Configure"
shell: bash
run: |
source $CI_PROJECT_ROOT/ci/micropython.sh && ci_debug
micropython_version
ci_cmake_configure ${{ matrix.name }}
- name: "MicroPython: Build"
shell: bash
run: |
source $CI_PROJECT_ROOT/ci/micropython.sh && ci_debug
python3 -m venv "$CI_BUILD_ROOT/.dir2uf2"
source "$CI_BUILD_ROOT/.dir2uf2/bin/activate"
ci_cmake_build ${{ matrix.name }}
mv "$CI_BUILD_ROOT/${{ matrix.name }}.uf2" "$CI_BUILD_ROOT/$RELEASE_FILE.uf2"
mv "$CI_BUILD_ROOT/${{ matrix.name }}-with-filesystem.uf2" "$CI_BUILD_ROOT/$RELEASE_FILE-with-filesystem.uf2"
- name: "Artifacts: Upload .uf2"
uses: actions/upload-artifact@v4
with:
name: ${{ env.RELEASE_FILE }}.uf2
path: ${{ env.CI_BUILD_ROOT }}/${{ env.RELEASE_FILE }}.uf2
- name: "Artifacts: Upload .uf2 (With Filesystem)"
uses: actions/upload-artifact@v4
with:
name: ${{ env.RELEASE_FILE }}-with-filesystem.uf2
path: ${{ env.CI_BUILD_ROOT }}/${{ env.RELEASE_FILE }}-with-filesystem.uf2
- name: "Release: Upload .uf2"
if: github.event_name == 'release'
uses: softprops/action-gh-release@v1
with:
files: ${{ env.CI_BUILD_ROOT }}/${{ env.RELEASE_FILE }}.uf2
- name: "Release: Upload .uf2 (With Filesystem)"
if: github.event_name == 'release'
uses: softprops/action-gh-release@v1
with:
files: ${{ env.CI_BUILD_ROOT }}/${{ env.RELEASE_FILE }}-with-filesystem.uf2