Skip to content

Commit 213a8bb

Browse files
committed
Merge branch 'main' into displayio_arg_validation
# Conflicts: # shared-bindings/displayio/Palette.c
2 parents 3601bb3 + 4e169bb commit 213a8bb

File tree

259 files changed

+10147
-3565
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

259 files changed

+10147
-3565
lines changed

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ body:
66
- type: markdown
77
attributes:
88
value: >-
9-
Thanks! for testing out CircuitPython. Now that you have encountered a
9+
Thanks for testing out CircuitPython! Now that you have encountered a
1010
bug... you can file a report for it.
1111
- type: textarea
1212
id: firmware
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
name: Fetch external deps
2+
3+
inputs:
4+
action:
5+
required: false
6+
default: restore
7+
type: choice
8+
options:
9+
- cache
10+
- restore
11+
12+
platform:
13+
required: false
14+
default: none
15+
type: choice
16+
options:
17+
- arm
18+
- aarch
19+
- esp
20+
- riscv
21+
- none
22+
23+
runs:
24+
using: composite
25+
steps:
26+
# aarch
27+
- name: Get aarch toolchain
28+
if: inputs.platform == 'aarch'
29+
run: |
30+
wget --no-verbose https://adafruit-circuit-python.s3.amazonaws.com/gcc-arm-10.3-2021.07-x86_64-aarch64-none-elf.tar.xz
31+
sudo tar -C /usr --strip-components=1 -xaf gcc-arm-10.3-2021.07-x86_64-aarch64-none-elf.tar.xz
32+
sudo apt-get install -y mtools
33+
shell: bash
34+
- name: Install mkfs.fat
35+
if: inputs.platform == 'aarch'
36+
run: |
37+
wget https://github.com/dosfstools/dosfstools/releases/download/v4.2/dosfstools-4.2.tar.gz
38+
tar -xaf dosfstools-4.2.tar.gz
39+
cd dosfstools-4.2
40+
./configure
41+
make -j 2
42+
cd src
43+
echo >> $GITHUB_PATH $(pwd)
44+
shell: bash
45+
46+
# arm
47+
- name: Get arm toolchain
48+
if: inputs.platform == 'aarch' || inputs.platform == 'arm'
49+
uses: carlosperate/arm-none-eabi-gcc-action@v1
50+
with:
51+
release: '10-2020-q4'
52+
53+
# esp
54+
- name: Get esp toolchain
55+
if: inputs.platform == 'esp'
56+
run: sudo apt-get install -y ninja-build
57+
shell: bash
58+
- name: Install IDF tools
59+
if: inputs.platform == 'esp'
60+
run: |
61+
echo "Installing ESP-IDF tools"
62+
$IDF_PATH/tools/idf_tools.py --non-interactive install required
63+
$IDF_PATH/tools/idf_tools.py --non-interactive install cmake
64+
echo "Installing Python environment and packages"
65+
$IDF_PATH/tools/idf_tools.py --non-interactive install-python-env
66+
rm -rf $IDF_TOOLS_PATH/dist
67+
shell: bash
68+
- name: Set environment
69+
if: inputs.platform == 'esp'
70+
run: |
71+
source $IDF_PATH/export.sh
72+
echo >> $GITHUB_ENV "IDF_PYTHON_ENV_PATH=$IDF_PYTHON_ENV_PATH"
73+
echo >> $GITHUB_PATH "$PATH"
74+
shell: bash
75+
76+
# riscv
77+
- name: Get riscv toolchain
78+
if: inputs.platform == 'riscv'
79+
run: |
80+
wget https://static.dev.sifive.com/dev-tools/riscv64-unknown-elf-gcc-8.3.0-2019.08.0-x86_64-linux-centos6.tar.gz
81+
sudo tar -C /usr --strip-components=1 -xaf riscv64-unknown-elf-gcc-8.3.0-2019.08.0-x86_64-linux-centos6.tar.gz
82+
shell: bash
83+
84+
# common
85+
- name: Cache python dependencies
86+
if: inputs.platform != 'esp'
87+
uses: ./.github/actions/deps/python
88+
with:
89+
action: ${{ inputs.action }}
90+
- name: Install python dependencies
91+
run: pip install -r requirements-dev.txt
92+
shell: bash

.github/actions/deps/ports/action.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Fetch port deps
2+
3+
inputs:
4+
board:
5+
required: true
6+
type: string
7+
8+
outputs:
9+
port:
10+
value: ${{ steps.board-to-port.outputs.port }}
11+
12+
runs:
13+
using: composite
14+
steps:
15+
- name: Board to port
16+
id: board-to-port
17+
run: |
18+
PORT=$(find ports/*/boards/ -type d -name ${{ inputs.board }} | sed 's/^ports\///g;s/\/boards.*//g')
19+
if [ -z $PORT ]; then (exit 1); else echo >> $GITHUB_OUTPUT "port=$PORT"; fi
20+
shell: bash
21+
22+
- name: Set up espressif port
23+
if: steps.board-to-port.outputs.port == 'espressif'
24+
uses: ./.github/actions/deps/ports/espressif
25+
26+
- name: Set up nrf port
27+
if: steps.board-to-port.outputs.port == 'nrf'
28+
uses: ./.github/actions/deps/ports/nrf
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Fetch espressif port deps
2+
3+
runs:
4+
using: composite
5+
steps:
6+
- name: Set IDF env
7+
run: |
8+
echo >> $GITHUB_ENV "IDF_PATH=$GITHUB_WORKSPACE/ports/espressif/esp-idf"
9+
echo >> $GITHUB_ENV "IDF_TOOLS_PATH=$GITHUB_WORKSPACE/.idf_tools"
10+
shell: bash
11+
12+
- name: Get IDF commit
13+
id: idf-commit
14+
run: |
15+
COMMIT=$(git submodule status ports/espressif/esp-idf | grep -o -P '(?<=^-).*(?= )')
16+
echo "$COMMIT"
17+
echo "commit=$COMMIT" >> $GITHUB_OUTPUT
18+
shell: bash
19+
20+
- name: Cache IDF submodules
21+
uses: actions/cache@v3
22+
with:
23+
path: |
24+
.git/modules/ports/espressif/esp-idf
25+
ports/espressif/esp-idf
26+
key: submodules-idf-${{ steps.idf-commit.outputs.commit }}
27+
28+
- name: Cache IDF tools
29+
uses: actions/cache@v3
30+
with:
31+
path: ${{ env.IDF_TOOLS_PATH }}
32+
key: ${{ runner.os }}-${{ env.pythonLocation }}-tools-idf-${{ steps.idf-commit.outputs.commit }}
33+
34+
- name: Initialize IDF submodules
35+
run: git submodule update --init --depth=1 --recursive $IDF_PATH
36+
shell: bash
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Fetch nrf port deps
2+
3+
runs:
4+
using: composite
5+
steps:
6+
- name: Get nrfutil 7+
7+
run: |
8+
wget https://developer.nordicsemi.com/.pc-tools/nrfutil/x64-linux/nrfutil
9+
chmod +x nrfutil
10+
./nrfutil install nrf5sdk-tools
11+
mkdir -p $HOME/.local/bin
12+
mv nrfutil $HOME/.local/bin
13+
echo "$HOME/.local/bin" >> $GITHUB_PATH
14+
shell: bash
15+
- name: Print nrfutil version
16+
run: nrfutil -V
17+
shell: bash
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Fetch python deps
2+
3+
inputs:
4+
action:
5+
description: The cache action to use
6+
required: false
7+
default: restore
8+
type: choice
9+
options:
10+
- cache
11+
- restore
12+
13+
runs:
14+
using: composite
15+
steps:
16+
- name: Cache python dependencies
17+
id: cache-python-deps
18+
if: inputs.action == 'cache'
19+
uses: actions/cache@v3
20+
with:
21+
path: .cp_tools
22+
key: ${{ runner.os }}-${{ env.pythonLocation }}-tools-cp-${{ hashFiles('requirements-dev.txt') }}
23+
24+
- name: Restore python dependencies
25+
id: restore-python-deps
26+
if: inputs.action == 'restore'
27+
uses: actions/cache/restore@v3
28+
with:
29+
path: .cp_tools
30+
key: ${{ runner.os }}-${{ env.pythonLocation }}-tools-cp-${{ hashFiles('requirements-dev.txt') }}
31+
32+
- name: Set up venv
33+
if: inputs.action == 'cache' && !steps.cache-python-deps.outputs.cache-hit
34+
run: python -m venv .cp_tools
35+
shell: bash
36+
37+
- name: Activate venv
38+
if: inputs.action == 'cache' || (inputs.action == 'restore' && steps.restore-python-deps.outputs.cache-hit)
39+
run: |
40+
source .cp_tools/bin/activate
41+
echo >> $GITHUB_PATH "$PATH"
42+
shell: bash

.github/actions/fetch_submodules/action.yml renamed to .github/actions/deps/submodules/action.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
name: 'Fetch Submodules'
22

33
inputs:
4+
target:
5+
description: 'The target for ci_fetch_deps'
6+
required: false
7+
type: string
8+
49
submodules:
510
description: 'The submodules to cache'
611
required: false
712
default: '["extmod/ulab", "lib/", "tools/"]'
813
type: string
914

10-
cache:
15+
action:
1116
description: 'The cache action to use'
1217
required: false
1318
default: 'restore'
@@ -42,15 +47,15 @@ runs:
4247
shell: bash
4348

4449
- name: Cache submodules
45-
if: ${{ inputs.cache == 'cache' }}
50+
if: ${{ inputs.action == 'cache' }}
4651
uses: actions/cache@v3
4752
with:
4853
path: ".git/modules/\n${{ join(fromJSON(steps.create-submodule-status.outputs.submodules), '\n') }}"
4954
key: submodules-common-${{ hashFiles('submodule_status') }}
5055
enableCrossOsArchive: true
5156

5257
- name: Restore submodules
53-
if: ${{ inputs.cache == 'restore' }}
58+
if: ${{ inputs.action == 'restore' }}
5459
uses: actions/cache/restore@v3
5560
with:
5661
path: ".git/modules/\n${{ join(fromJSON(steps.create-submodule-status.outputs.submodules), '\n') }}"
@@ -63,7 +68,7 @@ runs:
6368

6469
- name: CircuitPython dependencies
6570
id: cp-deps
66-
run: python tools/ci_fetch_deps.py ${{ matrix.board || github.job }}
71+
run: python tools/ci_fetch_deps.py ${{ inputs.target || matrix.board || github.job }}
6772
shell: bash
6873

6974
- name: CircuitPython version

.github/actions/mpy_cross/action.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Set up mpy-cross
2+
3+
inputs:
4+
download:
5+
required: false
6+
default: true
7+
type: boolean
8+
9+
runs:
10+
using: composite
11+
steps:
12+
- name: Download mpy-cross
13+
id: download-mpy-cross
14+
if: inputs.download == 'true'
15+
continue-on-error: true
16+
uses: actions/download-artifact@v3
17+
with:
18+
name: mpy-cross
19+
path: mpy-cross
20+
21+
- name: Make mpy-cross executable
22+
if: inputs.download == 'true' && steps.download-mpy-cross.outcome == 'success'
23+
run: sudo chmod +x mpy-cross/mpy-cross
24+
shell: bash
25+
26+
- name: Build mpy-cross
27+
if: inputs.download == 'false' || steps.download-mpy-cross.outcome == 'failure'
28+
run: make -C mpy-cross -j2
29+
shell: bash
30+
31+
- name: Upload mpy-cross
32+
if: inputs.download == 'false' || steps.download-mpy-cross.outcome == 'failure'
33+
continue-on-error: true
34+
uses: actions/upload-artifact@v3
35+
with:
36+
name: mpy-cross
37+
path: mpy-cross/mpy-cross

.github/actions/upload_aws/action.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Upload to AWS S3
2+
3+
inputs:
4+
source:
5+
required: true
6+
type: string
7+
8+
destination:
9+
required: false
10+
type: string
11+
12+
AWS_ACCESS_KEY_ID:
13+
required: true
14+
15+
AWS_SECRET_ACCESS_KEY:
16+
required: true
17+
18+
runs:
19+
using: composite
20+
steps:
21+
- name: Upload to S3
22+
if: >-
23+
(github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository_owner == 'adafruit') ||
24+
(github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'rerequested'))
25+
run: >-
26+
[ -z "$AWS_ACCESS_KEY_ID" ] ||
27+
aws s3 cp ${{ inputs.source }} s3://adafruit-circuit-python/bin/${{ inputs.destination }}
28+
${{ endsWith(inputs.source, '/') && '--recursive' || '' }} --no-progress --region us-east-1
29+
env:
30+
AWS_PAGER: ''
31+
AWS_ACCESS_KEY_ID: ${{ inputs.AWS_ACCESS_KEY_ID }}
32+
AWS_SECRET_ACCESS_KEY: ${{ inputs.AWS_SECRET_ACCESS_KEY }}
33+
shell: bash

0 commit comments

Comments
 (0)