Skip to content

Commit 62ce4cf

Browse files
authored
Merge pull request #603 from gojimmypi/pr-timeout
Fix workflow timeout with revised apt-get source replacements
2 parents 71dc6ff + 0ddbb29 commit 62ce4cf

File tree

7 files changed

+152
-10
lines changed

7 files changed

+152
-10
lines changed

.github/workflows/test-build-aarch64.yml

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,52 @@ jobs:
2626
submodules: true
2727

2828
- name: Workaround for sources.list
29-
run: sudo sed -i 's|http://azure.archive.ubuntu.com/ubuntu/|http://mirror.arizona.edu/ubuntu/|g' /etc/apt/sources.list
29+
run: |
30+
# Replace sources
31+
32+
set -euxo pipefail
33+
34+
# Peek (what repos are active now)
35+
apt-cache policy
36+
grep -RInE '^(deb|Types|URIs)' /etc/apt || true
37+
38+
# Enable nullglob so *.list/*.sources that don't exist don't break sed
39+
shopt -s nullglob
40+
41+
echo "Replace sources.list (legacy)"
42+
sudo sed -i \
43+
-e "s|https\?://azure\.archive\.ubuntu\.com/ubuntu/?|http://mirror.arizona.edu/ubuntu/|g" \
44+
/etc/apt/sources.list || true
45+
46+
echo "Replace sources.list.d/*.list (legacy)"
47+
for f in /etc/apt/sources.list.d/*.list; do
48+
sudo sed -i \
49+
-e "s|https\?://azure\.archive\.ubuntu\.com/ubuntu/?|http://mirror.arizona.edu/ubuntu/|g" \
50+
"$f"
51+
done
52+
53+
echo "Replace sources.list.d/*.sources (deb822)"
54+
for f in /etc/apt/sources.list.d/*.sources; do
55+
sudo sed -i \
56+
-e "s|https\?://azure\.archive\.ubuntu\.com/ubuntu/?|http://mirror.arizona.edu/ubuntu/|g" \
57+
-e "s|https\?://azure\.archive\.ubuntu\.com|http://mirror.arizona.edu|g" \
58+
"$f"
59+
done
60+
61+
echo "Fix /etc/apt/apt-mirrors.txt (used by URIs: mirror+file:...)"
62+
if grep -qE '^[[:space:]]*https?://azure\.archive\.ubuntu\.com/ubuntu/?' /etc/apt/apt-mirrors.txt; then
63+
# Replace azure with our mirror (idempotent)
64+
sudo sed -i 's|https\?://azure\.archive\.ubuntu\.com/ubuntu/|http://mirror.arizona.edu/ubuntu/|g' /etc/apt/apt-mirrors.txt
65+
fi
66+
67+
# Peek (verify changes)
68+
grep -RIn "azure.archive.ubuntu.com" /etc/apt || true
69+
grep -RInE '^(deb|Types|URIs)' /etc/apt || true
70+
echo "--- apt-mirrors.txt ---"
71+
cat /etc/apt/apt-mirrors.txt || true
3072
3173
- name: Update repository
32-
run: sudo apt-get update
74+
run: sudo apt-get update -o Acquire::Retries=3
3375

3476
- name: Install dependencies
3577
run: |

.github/workflows/test-build-lms.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@ jobs:
2626
submodules: true
2727

2828
- name: Workaround for sources.list
29-
run: sudo sed -i 's|http://azure.archive.ubuntu.com/ubuntu/|http://mirror.arizona.edu/ubuntu/|g' /etc/apt/sources.list
29+
run: |
30+
# workaround disabled, splitting the load between azure and arizona.edu to avoid timeouts
31+
32+
# See reference code in test-build.yml for various sources that may be updated. Enable as needed here.
33+
echo "Workaround for sources.list disabled for this workflow"
3034
3135
- name: Update repository
3236
run: sudo apt-get update

.github/workflows/test-build-mcux-sdk.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,11 @@ jobs:
3636
path: CMSIS_5
3737

3838
- name: Workaround for sources.list
39-
run: sudo sed -i 's|http://azure.archive.ubuntu.com/ubuntu/|http://mirror.arizona.edu/ubuntu/|g' /etc/apt/sources.list
39+
run: |
40+
# workaround disabled, splitting the load between azure and arizona.edu to avoid timeouts
41+
42+
# See reference code in test-build.yml for various sources that may be updated. Enable as needed here.
43+
echo "Workaround for sources.list disabled for this workflow"
4044
4145
- name: Update repository
4246
run: sudo apt-get update

.github/workflows/test-build-pico-sdk.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,11 @@ jobs:
3939
git submodule update --init --recursive
4040
4141
- name: Workaround for sources.list
42-
run: sudo sed -i 's|http://azure.archive.ubuntu.com/ubuntu/|http://mirror.arizona.edu/ubuntu/|g' /etc/apt/sources.list
42+
run: |
43+
# workaround disabled, splitting the load between azure and arizona.edu to avoid timeouts
44+
45+
# See reference code in test-build.yml for various sources that may be updated. Enable as needed here.
46+
echo "Workaround for sources.list disabled for this workflow"
4347
4448
- name: Update repository
4549
run: sudo apt-get update

.github/workflows/test-build.yml

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,52 @@ jobs:
2626
submodules: true
2727

2828
- name: Workaround for sources.list
29-
run: sudo sed -i 's|http://azure.archive.ubuntu.com/ubuntu/|http://mirror.arizona.edu/ubuntu/|g' /etc/apt/sources.list
29+
run: |
30+
# Replace sources
31+
32+
set -euxo pipefail
33+
34+
# Peek (what repos are active now)
35+
apt-cache policy
36+
grep -RInE '^(deb|Types|URIs)' /etc/apt || true
37+
38+
# Enable nullglob so *.list/*.sources that don't exist don't break sed
39+
shopt -s nullglob
40+
41+
echo "Replace sources.list (legacy)"
42+
sudo sed -i \
43+
-e "s|https\?://azure\.archive\.ubuntu\.com/ubuntu/?|http://mirror.arizona.edu/ubuntu/|g" \
44+
/etc/apt/sources.list || true
45+
46+
echo "Replace sources.list.d/*.list (legacy)"
47+
for f in /etc/apt/sources.list.d/*.list; do
48+
sudo sed -i \
49+
-e "s|https\?://azure\.archive\.ubuntu\.com/ubuntu/?|http://mirror.arizona.edu/ubuntu/|g" \
50+
"$f"
51+
done
52+
53+
echo "Replace sources.list.d/*.sources (deb822)"
54+
for f in /etc/apt/sources.list.d/*.sources; do
55+
sudo sed -i \
56+
-e "s|https\?://azure\.archive\.ubuntu\.com/ubuntu/?|http://mirror.arizona.edu/ubuntu/|g" \
57+
-e "s|https\?://azure\.archive\.ubuntu\.com|http://mirror.arizona.edu|g" \
58+
"$f"
59+
done
60+
61+
echo "Fix /etc/apt/apt-mirrors.txt (used by URIs: mirror+file:...)"
62+
if grep -qE '^[[:space:]]*https?://azure\.archive\.ubuntu\.com/ubuntu/?' /etc/apt/apt-mirrors.txt; then
63+
# Replace azure with our mirror (idempotent)
64+
sudo sed -i 's|https\?://azure\.archive\.ubuntu\.com/ubuntu/|http://mirror.arizona.edu/ubuntu/|g' /etc/apt/apt-mirrors.txt
65+
fi
66+
67+
# Peek (verify changes)
68+
grep -RIn "azure.archive.ubuntu.com" /etc/apt || true
69+
grep -RInE '^(deb|Types|URIs)' /etc/apt || true
70+
echo "--- apt-mirrors.txt ---"
71+
cat /etc/apt/apt-mirrors.txt || true
3072
3173
- name: Update repository
32-
run: sudo apt-get update
74+
run: sudo apt-get update -o Acquire::Retries=3
3375

3476
- name: Install cross compilers
3577
run: |

.github/workflows/test-sunnyday-simulator.yml

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,52 @@ jobs:
1717
submodules: true
1818

1919
- name: Workaround for sources.list
20-
run: sudo sed -i 's|http://azure.archive.ubuntu.com/ubuntu/|http://mirror.arizona.edu/ubuntu/|g' /etc/apt/sources.list
20+
run: |
21+
# Replace sources
22+
23+
set -euxo pipefail
24+
25+
# Peek (what repos are active now)
26+
apt-cache policy
27+
grep -RInE '^(deb|Types|URIs)' /etc/apt || true
28+
29+
# Enable nullglob so *.list/*.sources that don't exist don't break sed
30+
shopt -s nullglob
31+
32+
echo "Replace sources.list (legacy)"
33+
sudo sed -i \
34+
-e "s|https\?://azure\.archive\.ubuntu\.com/ubuntu/?|http://mirror.arizona.edu/ubuntu/|g" \
35+
/etc/apt/sources.list || true
36+
37+
echo "Replace sources.list.d/*.list (legacy)"
38+
for f in /etc/apt/sources.list.d/*.list; do
39+
sudo sed -i \
40+
-e "s|https\?://azure\.archive\.ubuntu\.com/ubuntu/?|http://mirror.arizona.edu/ubuntu/|g" \
41+
"$f"
42+
done
43+
44+
echo "Replace sources.list.d/*.sources (deb822)"
45+
for f in /etc/apt/sources.list.d/*.sources; do
46+
sudo sed -i \
47+
-e "s|https\?://azure\.archive\.ubuntu\.com/ubuntu/?|http://mirror.arizona.edu/ubuntu/|g" \
48+
-e "s|https\?://azure\.archive\.ubuntu\.com|http://mirror.arizona.edu|g" \
49+
"$f"
50+
done
51+
52+
echo "Fix /etc/apt/apt-mirrors.txt (used by URIs: mirror+file:...)"
53+
if grep -qE '^[[:space:]]*https?://azure\.archive\.ubuntu\.com/ubuntu/?' /etc/apt/apt-mirrors.txt; then
54+
# Replace azure with our mirror (idempotent)
55+
sudo sed -i 's|https\?://azure\.archive\.ubuntu\.com/ubuntu/|http://mirror.arizona.edu/ubuntu/|g' /etc/apt/apt-mirrors.txt
56+
fi
57+
58+
# Peek (verify changes)
59+
grep -RIn "azure.archive.ubuntu.com" /etc/apt || true
60+
grep -RInE '^(deb|Types|URIs)' /etc/apt || true
61+
echo "--- apt-mirrors.txt ---"
62+
cat /etc/apt/apt-mirrors.txt || true
2163
2264
- name: Update repository
23-
run: sudo apt-get update
65+
run: sudo apt-get update -o Acquire::Retries=3
2466

2567
- name: Install 32-bit libc
2668
run: |

.github/workflows/test-wolfhsm-simulator.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,11 @@ jobs:
3434
submodules: true
3535

3636
- name: Workaround for sources.list
37-
run: sudo sed -i 's|http://azure.archive.ubuntu.com/ubuntu/|http://mirror.arizona.edu/ubuntu/|g' /etc/apt/sources.list
37+
run: |
38+
# workaround disabled, splitting the load between azure and arizona.edu to avoid timeouts
39+
40+
# See reference code in test-build.yml for various sources that may be updated. Enable as needed here.
41+
echo "Workaround for sources.list disabled for this workflow"
3842
3943
- name: Update repository
4044
run: sudo apt-get update

0 commit comments

Comments
 (0)