Skip to content

Commit 14c3b52

Browse files
committed
Merge branch 'main' into espnow
2 parents 7028a3a + e207db7 commit 14c3b52

283 files changed

Lines changed: 3340 additions & 2234 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: 'Fetch Submodules'
2+
3+
inputs:
4+
submodules:
5+
description: 'The submodules to cache'
6+
required: false
7+
default: '["extmod/ulab", "lib/", "tools/"]'
8+
type: string
9+
10+
cache:
11+
description: 'The cache action to use'
12+
required: false
13+
default: 'restore'
14+
type: choice
15+
options:
16+
- cache
17+
- restore
18+
19+
version:
20+
description: 'Whether to generate CP version'
21+
required: false
22+
default: false
23+
type: boolean
24+
25+
outputs:
26+
frozen:
27+
description: 'Whether frozen submodules were fetched'
28+
value: ${{ steps.cp-deps.outputs.frozen_tags }}
29+
30+
version:
31+
description: 'The CP version'
32+
value: ${{ steps.cp-version.outputs.cp-version }}
33+
34+
runs:
35+
using: "composite"
36+
steps:
37+
- name: Create submodule status
38+
id: create-submodule-status
39+
run: |
40+
git submodule status ${{ join(fromJSON(inputs.submodules), ' ') }} >> submodule_status
41+
echo $(cut -d ' ' -f 2 submodule_status) | echo "submodules=[\"$(sed "s/ /\", \"/g")\"]" >> $GITHUB_OUTPUT
42+
shell: bash
43+
44+
- name: Cache submodules
45+
if: ${{ inputs.cache == 'cache' }}
46+
uses: actions/cache@v3
47+
with:
48+
path: ".git/modules/\n${{ join(fromJSON(steps.create-submodule-status.outputs.submodules), '\n') }}"
49+
key: submodules-common-${{ hashFiles('submodule_status') }}
50+
enableCrossOsArchive: true
51+
52+
- name: Restore submodules
53+
if: ${{ inputs.cache == 'restore' }}
54+
uses: actions/cache/restore@v3
55+
with:
56+
path: ".git/modules/\n${{ join(fromJSON(steps.create-submodule-status.outputs.submodules), '\n') }}"
57+
key: submodules-common-${{ hashFiles('submodule_status') }}
58+
enableCrossOsArchive: true
59+
60+
- name: Remove submodule status
61+
run: rm submodule_status
62+
shell: bash
63+
64+
- name: CircuitPython dependencies
65+
id: cp-deps
66+
run: python tools/ci_fetch_deps.py ${{ matrix.board || github.job }}
67+
shell: bash
68+
69+
- name: CircuitPython version
70+
id: cp-version
71+
if: ${{ inputs.version == 'true' }}
72+
run: |
73+
echo "::group::Fetch history and tags"
74+
git fetch --no-recurse-submodules --shallow-since="2021-07-01" --tags https://github.com/adafruit/circuitpython HEAD
75+
git fetch --no-recurse-submodules --shallow-since="2021-07-01" origin $GITHUB_SHA
76+
git repack -d
77+
echo "::endgroup::"
78+
CP_VERSION=$(tools/describe)
79+
echo "$CP_VERSION"
80+
echo "CP_VERSION=$CP_VERSION" >> $GITHUB_ENV
81+
echo "cp-version=$CP_VERSION" >> $GITHUB_OUTPUT
82+
shell: bash

0 commit comments

Comments
 (0)