Skip to content

Commit e30ca2d

Browse files
authored
Merge pull request #734 from danielinux/refactoring-ci-workflows
Refactoring CI workflows to run in containers
2 parents 2aef0ed + 47f58ad commit e30ca2d

35 files changed

+199
-725
lines changed

.github/workflows/footprint.yml

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,23 @@ on:
88

99
jobs:
1010
footprint_test:
11-
runs-on: ubuntu-24.04
11+
runs-on: ubuntu-latest
12+
container:
13+
image: ghcr.io/wolfssl/wolfboot-ci-arm:v1.0
1214
timeout-minutes: 15
1315

1416
steps:
1517
- uses: actions/checkout@v4
1618
with:
1719
submodules: true
1820

19-
# Get the arm-non-eabi-gcc toolchain
20-
- name: Install arm-none-eabi-gcc
21-
run : |
22-
sudo apt-get install -y gcc-arm-none-eabi
21+
- name: Trust workspace
22+
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
2323

2424
- name: make clean
2525
run: |
2626
make keysclean && rm -f include/target.h
2727
28-
- name: Install wolfSSL
29-
run: |
30-
sudo apt-get install --no-install-recommends -y -q make libwolfssl-dev
31-
3228
- name: Select config
3329
run: |
3430
cp config/examples/stm32f407-discovery.config .config && make include/target.h
@@ -40,4 +36,3 @@ jobs:
4036
- name: Build wolfboot and test footprint
4137
run: |
4238
make test-size-all
43-

.github/workflows/test-build-cmake-dot-config.yml

Lines changed: 4 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ jobs:
99
wolfboot_dot_config_test:
1010
name: cmake .config test (${{ matrix.target }})
1111
runs-on: ubuntu-latest
12+
container:
13+
image: ghcr.io/wolfssl/wolfboot-ci-arm:v1.0
1214
timeout-minutes: 15
1315

1416
strategy:
@@ -36,56 +38,8 @@ jobs:
3638
with:
3739
submodules: true
3840

39-
- name: Workaround for sources.list
40-
run: |
41-
# Replace sources
42-
43-
set -euxo pipefail
44-
45-
# Peek (what repos are active now)
46-
apt-cache policy
47-
grep -RInE '^(deb|Types|URIs)' /etc/apt || true
48-
49-
# Enable nullglob so *.list/*.sources that don't exist don't break sed
50-
shopt -s nullglob
51-
52-
echo "Replace sources.list (legacy)"
53-
sudo sed -i \
54-
-e "s|https\?://azure\.archive\.ubuntu\.com/ubuntu/?|http://mirror.arizona.edu/ubuntu/|g" \
55-
/etc/apt/sources.list || true
56-
57-
echo "Replace sources.list.d/*.list (legacy)"
58-
for f in /etc/apt/sources.list.d/*.list; do
59-
sudo sed -i \
60-
-e "s|https\?://azure\.archive\.ubuntu\.com/ubuntu/?|http://mirror.arizona.edu/ubuntu/|g" \
61-
"$f"
62-
done
63-
64-
echo "Replace sources.list.d/*.sources (deb822)"
65-
for f in /etc/apt/sources.list.d/*.sources; do
66-
sudo sed -i \
67-
-e "s|https\?://azure\.archive\.ubuntu\.com/ubuntu/?|http://mirror.arizona.edu/ubuntu/|g" \
68-
-e "s|https\?://azure\.archive\.ubuntu\.com|http://mirror.arizona.edu|g" \
69-
"$f"
70-
done
71-
72-
echo "Fix /etc/apt/apt-mirrors.txt (used by URIs: mirror+file:...)"
73-
if grep -qE '^[[:space:]]*https?://azure\.archive\.ubuntu\.com/ubuntu/?' /etc/apt/apt-mirrors.txt; then
74-
# Replace azure with our mirror (idempotent)
75-
sudo sed -i 's|https\?://azure\.archive\.ubuntu\.com/ubuntu/|http://mirror.arizona.edu/ubuntu/|g' /etc/apt/apt-mirrors.txt
76-
fi
77-
78-
# Peek (verify changes)
79-
grep -RIn "azure.archive.ubuntu.com" /etc/apt || true
80-
grep -RInE '^(deb|Types|URIs)' /etc/apt || true
81-
echo "--- apt-mirrors.txt ---"
82-
cat /etc/apt/apt-mirrors.txt || true
83-
84-
- name: Install requirements
85-
run: |
86-
# Run system updates and install toolchain
87-
sudo apt-get update
88-
sudo apt-get install -y gcc-arm-none-eabi gcc-powerpc-linux-gnu cmake
41+
- name: Trust workspace
42+
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
8943

9044
- name: Run dot-config examples
9145
run: |

.github/workflows/test-build-cmake-presets.yml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,14 @@ on:
88

99
permissions:
1010
contents: read
11+
packages: read
1112

1213
jobs:
1314
ubuntu-cmake:
1415
name: Build on Ubuntu
1516
runs-on: ubuntu-latest
17+
container:
18+
image: ghcr.io/wolfssl/wolfboot-ci-arm:v1.0
1619
timeout-minutes: 20
1720
defaults:
1821
run:
@@ -53,15 +56,8 @@ jobs:
5356
with:
5457
submodules: true
5558

56-
# Lock down network/runner
57-
# See https://github.com/step-security/harden-runner/releases
58-
# Currently only supported on Ubuntu
59-
60-
# ARM GCC toolchain (adds the bin dir to PATH)
61-
- name: Set up ARM none-eabi GCC
62-
run: |
63-
sudo apt update
64-
sudo apt install -y gcc-arm-none-eabi
59+
- name: Trust workspace
60+
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
6561

6662
- name: List all environment variables
6763
run: |

.github/workflows/test-build-cmake-script.yml

Lines changed: 4 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ jobs:
1313
wolfboot_build_script_test:
1414
name: Build wolfBoot (target=${{ matrix.target }})
1515
runs-on: ubuntu-latest
16+
container:
17+
image: ghcr.io/wolfssl/wolfboot-ci-arm:v1.0
1618
timeout-minutes: 15
1719

1820
strategy:
@@ -42,55 +44,8 @@ jobs:
4244
with:
4345
submodules: true
4446

45-
- name: Workaround for sources.list
46-
run: |
47-
# Replace sources
48-
49-
set -euxo pipefail
50-
51-
# Peek (what repos are active now)
52-
apt-cache policy
53-
grep -RInE '^(deb|Types|URIs)' /etc/apt || true
54-
55-
# Enable nullglob so *.list/*.sources that don't exist don't break sed
56-
shopt -s nullglob
57-
58-
echo "Replace sources.list (legacy)"
59-
sudo sed -i \
60-
-e "s|https\?://azure\.archive\.ubuntu\.com/ubuntu/?|http://mirror.arizona.edu/ubuntu/|g" \
61-
/etc/apt/sources.list || true
62-
63-
echo "Replace sources.list.d/*.list (legacy)"
64-
for f in /etc/apt/sources.list.d/*.list; do
65-
sudo sed -i \
66-
-e "s|https\?://azure\.archive\.ubuntu\.com/ubuntu/?|http://mirror.arizona.edu/ubuntu/|g" \
67-
"$f"
68-
done
69-
70-
echo "Replace sources.list.d/*.sources (deb822)"
71-
for f in /etc/apt/sources.list.d/*.sources; do
72-
sudo sed -i \
73-
-e "s|https\?://azure\.archive\.ubuntu\.com/ubuntu/?|http://mirror.arizona.edu/ubuntu/|g" \
74-
-e "s|https\?://azure\.archive\.ubuntu\.com|http://mirror.arizona.edu|g" \
75-
"$f"
76-
done
77-
78-
echo "Fix /etc/apt/apt-mirrors.txt (used by URIs: mirror+file:...)"
79-
if grep -qE '^[[:space:]]*https?://azure\.archive\.ubuntu\.com/ubuntu/?' /etc/apt/apt-mirrors.txt; then
80-
# Replace azure with our mirror (idempotent)
81-
sudo sed -i 's|https\?://azure\.archive\.ubuntu\.com/ubuntu/|http://mirror.arizona.edu/ubuntu/|g' /etc/apt/apt-mirrors.txt
82-
fi
83-
84-
# Peek (verify changes)
85-
grep -RIn "azure.archive.ubuntu.com" /etc/apt || true
86-
grep -RInE '^(deb|Types|URIs)' /etc/apt || true
87-
echo "--- apt-mirrors.txt ---"
88-
cat /etc/apt/apt-mirrors.txt || true
89-
90-
- name: Install requirements
91-
run: |
92-
sudo apt-get update
93-
sudo apt-get install -y gcc-arm-none-eabi gcc-powerpc-linux-gnu cmake
47+
- name: Trust workspace
48+
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
9449

9550
- name: View Presets
9651
run: |

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

Lines changed: 4 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -7,63 +7,17 @@ on:
77
jobs:
88
cmake_automated_test:
99
runs-on: ubuntu-latest
10+
container:
11+
image: ghcr.io/wolfssl/wolfboot-ci-arm:v1.0
1012
timeout-minutes: 15
1113

1214
steps:
1315
- uses: actions/checkout@v4
1416
with:
1517
submodules: true
1618

17-
- name: Workaround for sources.list
18-
run: |
19-
# Replace sources
20-
21-
set -euxo pipefail
22-
23-
# Peek (what repos are active now)
24-
apt-cache policy
25-
grep -RInE '^(deb|Types|URIs)' /etc/apt || true
26-
27-
# Enable nullglob so *.list/*.sources that don't exist don't break sed
28-
shopt -s nullglob
29-
30-
echo "Replace sources.list (legacy)"
31-
sudo sed -i \
32-
-e "s|https\?://azure\.archive\.ubuntu\.com/ubuntu/?|http://mirror.arizona.edu/ubuntu/|g" \
33-
/etc/apt/sources.list || true
34-
35-
echo "Replace sources.list.d/*.list (legacy)"
36-
for f in /etc/apt/sources.list.d/*.list; do
37-
sudo sed -i \
38-
-e "s|https\?://azure\.archive\.ubuntu\.com/ubuntu/?|http://mirror.arizona.edu/ubuntu/|g" \
39-
"$f"
40-
done
41-
42-
echo "Replace sources.list.d/*.sources (deb822)"
43-
for f in /etc/apt/sources.list.d/*.sources; do
44-
sudo sed -i \
45-
-e "s|https\?://azure\.archive\.ubuntu\.com/ubuntu/?|http://mirror.arizona.edu/ubuntu/|g" \
46-
-e "s|https\?://azure\.archive\.ubuntu\.com|http://mirror.arizona.edu|g" \
47-
"$f"
48-
done
49-
50-
echo "Fix /etc/apt/apt-mirrors.txt (used by URIs: mirror+file:...)"
51-
if grep -qE '^[[:space:]]*https?://azure\.archive\.ubuntu\.com/ubuntu/?' /etc/apt/apt-mirrors.txt; then
52-
# Replace azure with our mirror (idempotent)
53-
sudo sed -i 's|https\?://azure\.archive\.ubuntu\.com/ubuntu/|http://mirror.arizona.edu/ubuntu/|g' /etc/apt/apt-mirrors.txt
54-
fi
55-
56-
# Peek (verify changes)
57-
grep -RIn "azure.archive.ubuntu.com" /etc/apt || true
58-
grep -RInE '^(deb|Types|URIs)' /etc/apt || true
59-
echo "--- apt-mirrors.txt ---"
60-
cat /etc/apt/apt-mirrors.txt || true
61-
62-
63-
- name: Install requirements
64-
run: |
65-
sudo apt-get update
66-
sudo apt-get install -y gcc-arm-none-eabi gcc-powerpc-linux-gnu cmake
19+
- name: Trust workspace
20+
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
6721

6822
- name: Run CMake build for STM32U5
6923
run: |

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

Lines changed: 4 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -18,64 +18,17 @@ jobs:
1818

1919
build:
2020
runs-on: ubuntu-latest
21+
container:
22+
image: ghcr.io/wolfssl/wolfboot-ci-arm:v1.0
2123
timeout-minutes: 30
2224

2325
steps:
2426
- uses: actions/checkout@v4
2527
with:
2628
submodules: true
2729

28-
- name: Workaround for 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
72-
73-
- name: Update repository
74-
run: sudo apt-get update
75-
76-
- name: Install cross compilers
77-
run: |
78-
sudo apt-get install -y gcc-arm-none-eabi gcc-aarch64-linux-gnu gcc-powerpc-linux-gnu gnu-efi
30+
- name: Trust workspace
31+
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
7932

8033
- name: make clean
8134
run: |

0 commit comments

Comments
 (0)