Skip to content

Commit e45371d

Browse files
committed
add github action
1 parent 0d6df5b commit e45371d

File tree

1 file changed

+66
-0
lines changed

1 file changed

+66
-0
lines changed
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Simulator self-update test
2+
3+
on:
4+
push:
5+
branches: [ 'master', 'main', 'release/**' ]
6+
pull_request:
7+
branches: [ '*' ]
8+
9+
jobs:
10+
self_update_simulator_test:
11+
runs-on: ubuntu-latest
12+
timeout-minutes: 15
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
with:
17+
submodules: true
18+
19+
- name: Workaround for 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
63+
64+
- name: Run self-update test
65+
run: |
66+
make test-sim-self-update

0 commit comments

Comments
 (0)