Skip to content

Commit fe24018

Browse files
Merge pull request #11 from EmbeddedAndroid/ci-fixes
ci: tolerate upstream poky rebases + drop qemu-runtime cron
2 parents 7ff6dc4 + 93509cb commit fe24018

2 files changed

Lines changed: 42 additions & 14 deletions

File tree

.github/workflows/ci.yml

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,30 @@ jobs:
5151

5252
- name: Clone poky
5353
run: |
54-
if [ ! -d poky/.git ]; then
54+
# When the cache restores an older poky and upstream has since
55+
# rebased the release branch (scarthgap has done this), a plain
56+
# `fetch ... ref:remote-ref` refuses the non-fast-forward update
57+
# and the job dies before bitbake even starts. Force-refspec
58+
# (`+ref`) makes the fetch overwrite the local tracking ref;
59+
# any harder breakage (corrupt cache, repository moved) falls
60+
# back to a clean re-clone.
61+
set -eo pipefail
62+
clone_fresh() {
63+
rm -rf poky
5564
git clone --depth 1 --branch ${{ matrix.poky_branch }} \
5665
https://git.yoctoproject.org/poky poky
66+
}
67+
if [ ! -d poky/.git ]; then
68+
clone_fresh
5769
else
58-
git -C poky fetch --depth 1 origin \
59-
${{ matrix.poky_branch }}:refs/remotes/origin/${{ matrix.poky_branch }}
60-
git -C poky checkout -B ${{ matrix.poky_branch }} \
61-
refs/remotes/origin/${{ matrix.poky_branch }}
70+
if ! git -C poky fetch --depth 1 origin \
71+
"+${{ matrix.poky_branch }}:refs/remotes/origin/${{ matrix.poky_branch }}"; then
72+
echo "fetch failed; falling back to fresh clone"
73+
clone_fresh
74+
else
75+
git -C poky checkout -B ${{ matrix.poky_branch }} \
76+
refs/remotes/origin/${{ matrix.poky_branch }}
77+
fi
6278
fi
6379
6480
- name: Install Yocto host dependencies

.github/workflows/qemu-runtime.yml

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,13 @@ name: qemu-runtime
88
# - Weston actually started on boot
99
# - VSCode can connect to the live wayland-0 socket and stay alive
1010
#
11-
# This is heavy CI (full Yocto image build, ~1-3 hours from cold
12-
# sstate) so it runs weekly + on manual dispatch rather than per-PR.
11+
# This is heavy CI (full Yocto image build) that does NOT fit inside
12+
# the GitHub-hosted runner's hard 6-hour job-runtime cap from a cold
13+
# sstate -- repeated weekly cron runs hit the cap and got cancelled.
14+
# Until we wire up a self-hosted runner (e.g. fio) with persistent
15+
# sstate, this workflow is manual-dispatch only.
1316

1417
on:
15-
schedule:
16-
# 03:17 UTC Sunday. Off-peak; small offset so cdn.kernel.org +
17-
# mirrors aren't slammed alongside everyone else's nightly.
18-
- cron: '17 3 * * 0'
1918
workflow_dispatch:
2019

2120
# Don't pile up qemu runs if one is already in progress.
@@ -82,12 +81,25 @@ jobs:
8281

8382
- name: Clone poky (scarthgap)
8483
run: |
85-
if [ ! -d poky/.git ]; then
84+
# See ci.yml's matching step for why this uses a force refspec
85+
# plus a re-clone fallback. Upstream-branch rebases otherwise
86+
# poison the cached checkout.
87+
set -eo pipefail
88+
clone_fresh() {
89+
rm -rf poky
8690
git clone --depth 1 --branch scarthgap \
8791
https://git.yoctoproject.org/poky poky
92+
}
93+
if [ ! -d poky/.git ]; then
94+
clone_fresh
8895
else
89-
git -C poky fetch --depth 1 origin scarthgap:refs/remotes/origin/scarthgap
90-
git -C poky checkout -B scarthgap refs/remotes/origin/scarthgap
96+
if ! git -C poky fetch --depth 1 origin \
97+
"+scarthgap:refs/remotes/origin/scarthgap"; then
98+
echo "fetch failed; falling back to fresh clone"
99+
clone_fresh
100+
else
101+
git -C poky checkout -B scarthgap refs/remotes/origin/scarthgap
102+
fi
91103
fi
92104
93105
- name: Cache downloads

0 commit comments

Comments
 (0)