8000 custom board build · atrawog/circuitpython@729fc97 · GitHub
[go: up one dir, main page]

Skip to content

Commit 729fc97

Browse files
committed
custom board build
1 parent 3036348 commit 729fc97

File tree

3 files changed

+115
-1
lines changed

3 files changed

+115
-1
lines changed

.github/actions/deps/external/action.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
name: Fetch external deps
22

33
inputs:
4+
action:
5+
required: false
6+
default: restore
7+
type: choice
8+
options:
9+
- cache
10+
- restore
11+
412
platform:
513
required: false
614
default: none
@@ -78,7 +86,7 @@ runs:
7886
if: inputs.platform != 'esp'
7987
uses: ./.github/actions/deps/python
8088
with:
81-
action: ${{ fromJSON('["restore", "cache"]')[github.job == 'scheduler'] }}
89+
action: ${{ inputs.action }}
8290
- name: Install python dependencies
8391
run: pip install -r requirements-dev.txt
8492
shell: bash
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
name: Custom board build
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
board:
7+
description: 'Board: Found in ports/*/boards/[board_id]'
8+
required: true
9+
type: string
10+
version:
11+
description: 'Version: Can be a tag or a commit (>=8.1.0)'
12+
required: false
13+
default: latest
14+
type: string
15+
language:
16+
description: 'Language: Found in locale/[language].po'
17+
required: false
18+
default: en_US
19+
type: string
20+
flags:
21+
description: 'Flags: Build flags (e.g. CIRCUITPY_WIFI=1)'
22+
required: false
23+
type: string
24+
debug:
25+
description: 'Make a debug build'
26+
required: false
27+
default: false
28+
type: boolean
29+
30+
run-name: ${{ inputs.board }}-${{ inputs.language }}-${{ inputs.version }}${{ inputs.flags != '' && '-custom' || '' }}${{ inputs.debug && '-debug' || '' }}
31+
32+
jobs:
33+
build:
34+
runs-on: ubuntu-22.04
35+
env:
36+
PLATFORM_atmel-samd: arm
37+
PLATFORM_broadcom: aarch
38+
PLATFORM_cxd56: arm
39+
PLATFORM_espressif: esp
40+
PLATFORM_litex: riscv
41+
PLATFORM_mimxrt10xx: arm
42+
PLATFORM_nrf: arm
43+
PLATFORM_raspberrypi: arm
44+
PLATFORM_stm: arm
45+
steps:
46+
- name: Set up repository
47+
run: |
48+
git clone --filter=tree:0 https://github.com/adafruit/circuitpython.git $GITHUB_WORKSPACE
49+
git checkout ${{ inputs.version == 'latest' && 'HEAD' || inputs.version }}
50+
- name: Set up identifier
51+
if: inputs.debug || inputs.flags != ''
52+
run: |
53+
> custom-build && git add custom-build
54+
- name: Get port
55+
id: get-port
56+
run: |
57+
PORT=$(find ports/*/boards/ -type d -name ${{ inputs.board }} | sed 's/^ports\///g;s/\/boards.*//g')
58+
if [ -z $PORT ]; then (exit 1); else echo >> $GITHUB_OUTPUT "port=$PORT"; fi
59+
- name: Port to platform
60+
run: echo >> $GITHUB_ENV "PLATFORM=${{ env[format('PLATFORM_{0}', steps.get-port.outputs.port)] }}"
61+
- name: Set up python
62+
uses: actions/setup-python@v4
63+
with:
64+
python-version: 3.x
65+
- name: Set up port
66+
if: env.PLATFORM == 'esp'
67+
uses: ./.github/actions/deps/ports/espressif
68+
- name: Set up submodules
69+
id: set-up-submodules
70+
uses: ./.github/actions/deps/submodules
71+
with:
72+
action: cache
73+
target: ${{ inputs.board }}
74+
- name: Set up external
75+
uses: ./.github/actions/deps/external
76+
with:
77+
action: cache
78+
platform: ${{ env.PLATFORM }}
79+
- name: Set up mpy-cross
80+
if: steps.set-up-submodules.outputs.frozen == 'True'
81+
uses: ./.github/actions/mpy_cross
82+
with:
83+
download: false
84+
- name: Versions
85+
run: |
86+
tools/describe
87+
gcc --version
88+
python3 --version
89+
cmake --version || true
90+
ninja --version || true
91+
aarch64-none-elf-gcc --version || true
92+
arm-none-eabi-gcc --version || true
93+
xtensa-esp32-elf-gcc --version || true
94+
riscv32-esp-elf-gcc --version || true
95+
riscv64-unknown-elf-gcc --version || true
96+
mkfs.fat --version || true
97+
- name: Build board
98+
run: make -j2 ${{ inputs.flags }} BOARD=${{ inputs.board }} DEBUG=${{ inputs.debug && '1' || '0' }} TRANSLATION=${{ inputs.language }}
99+
working-directory: ports/${{ steps.get-port.outputs.port }}
100+
- name: Upload artifact
101+
uses: actions/upload-artifact@v3
102+
with:
103+
name: ${{ inputs.board }}-${{ inputs.language }}-${{ inputs.version }}${{ inputs.flags != '' && '-custom' || '' }}${{ inputs.debug && '-debug' || '' }}
104+
path: ports/${{ steps.get-port.outputs.port }}/build-${{ inputs.board }}/firmware.*

.github/workflows/build.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ jobs:
5252
version: true
5353
- name: Set up external
5454
uses: ./.github/actions/deps/external
55+
with:
56+
action: cache
5557
# Disabled: Needs to be updated
5658
# - name: Get last commit with checks
5759
# id: get-last-commit-with-checks

0 commit comments

Comments
 (0)
0