Skip to content

Commit f817bfe

Browse files
committed
switch to checkout@v2 with submodules and fetch-depth 0
In order to get tags, including in submodules, we use our own fetching procedure on top of checkout@v2. A problem occuring in about 1% of jobs was that some submodules inexplicably did not have an "origin" remote configured. "git submodule sync" configures the "origin" remote in those cases. No cause for the problem was determined. Besides keeping up to date on actions/checkout, @v2 is supposed to fix a bug where "re-run" of a pull request would fail checking out the code.
1 parent 76f3aa4 commit f817bfe

File tree

2 files changed

+29
-11
lines changed

2 files changed

+29
-11
lines changed

.github/workflows/build.yml

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,16 @@ jobs:
1616
env:
1717
GITHUB_CONTEXT: ${{ toJson(github) }}
1818
run: echo "$GITHUB_CONTEXT"
19+
- uses: actions/checkout@v2
20+
with:
21+
submodules: true
22+
fetch-depth: 0
23+
- run: git fetch --recurse-submodules=no https://github.com/adafruit/circuitpython refs/tags/*:refs/tags/*
24+
- run: git submodule sync
25+
- run: git submodule foreach git remote -v
26+
- run: git submodule foreach git fetch --recurse-submodules=no origin +refs/tags/*:refs/tags/*
27+
- name: CircuitPython version
28+
run: git describe --dirty --tags
1929
- name: Set up Python 3.8
2030
uses: actions/setup-python@v1
2131
with:
@@ -29,11 +39,6 @@ jobs:
2939
run: |
3040
gcc --version
3141
python3 --version
32-
- uses: actions/checkout@v1
33-
with:
34-
submodules: true
35-
- name: CircuitPython version
36-
run: git describe --dirty --always --tags
3742
- name: Build mpy-cross
3843
run: make -C mpy-cross -j2
3944
- name: Build unix port
@@ -103,11 +108,16 @@ jobs:
103108
gcc --version
104109
python3 --version
105110
msgfmt --version
106-
- uses: actions/checkout@v1
111+
- uses: actions/checkout@v2
107112
with:
108113
submodules: true
114+
fetch-depth: 0
115+
- run: git fetch --recurse-submodules=no https://github.com/adafruit/circuitpython refs/tags/*:refs/tags/*
116+
- run: git submodule sync
117+
- run: git submodule foreach git remote -v
118+
- run: git submodule foreach git fetch --recurse-submodules=no origin +refs/tags/*:refs/tags/*
109119
- name: CircuitPython version
110-
run: git describe --dirty --always --tags
120+
run: git describe --dirty --tags
111121
- name: Build mpy-cross
112122
run: make -C mpy-cross -j2
113123
- uses: actions/[email protected]
@@ -260,9 +270,14 @@ jobs:
260270
gcc --version
261271
arm-none-eabi-gcc --version
262272
python3 --version
263-
- uses: actions/checkout@v1
273+
- uses: actions/checkout@v2
264274
with:
265275
submodules: true
276+
fetch-depth: 0
277+
- run: git fetch --recurse-submodules=no https://github.com/adafruit/circuitpython refs/tags/*:refs/tags/*
278+
- run: git submodule sync
279+
- run: git submodule foreach git remote -v
280+
- run: git submodule foreach git fetch --recurse-submodules=no origin +refs/tags/*:refs/tags/*
266281
- name: mpy-cross
267282
run: make -C mpy-cross -j2
268283
- name: build
@@ -325,4 +340,4 @@ jobs:
325340
env:
326341
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
327342
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
328-
if: github.event_name == 'push' || (github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'rerequested'))
343+
if: github.event_name == 'push' || (github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'rerequested'))

.github/workflows/create_website_pr.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,14 @@ jobs:
2323
run: |
2424
gcc --version
2525
python3 --version
26-
- uses: actions/checkout@v1
26+
- uses: actions/checkout@v2
2727
with:
2828
submodules: true
29+
fetch-depth: 0
30+
- run: git fetch --recurse-submodules=no https://github.com/adafruit/circuitpython refs/tags/*:refs/tags/*
31+
- run: git submodule foreach git fetch --recurse-submodules=no origin +refs/tags/*:refs/tags/*
2932
- name: CircuitPython version
30-
run: git describe --dirty --always --tags
33+
run: git describe --dirty --tags
3134
- name: Website
3235
run: python3 build_board_info.py
3336
working-directory: tools

0 commit comments

Comments
 (0)