Skip to content

Commit c07e257

Browse files
committed
ci: twister: Remove unnecessary Linux environment setup steps
The twister build job now runs inside a container using the `ci` Docker image and it is no longer necessary to set up many of the components currently installed in the Linux environment setup step. All `sudo` usages are also removed because the CI Docker image defaults to the root user inside the container. Signed-off-by: Stephanos Ioannidis <[email protected]>
1 parent 9de4964 commit c07e257

File tree

1 file changed

+15
-61
lines changed

1 file changed

+15
-61
lines changed

.github/workflows/twister.yml

Lines changed: 15 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,11 @@ jobs:
7676
case "${{ github.event.inputs.host }}" in
7777
linux-x86_64)
7878
runner="zephyr-runner-v2-linux-x64-4xlarge"
79-
container="ghcr.io/zephyrproject-rtos/ci:main"
79+
container="ghcr.io/zephyrproject-rtos/ci:v0.28.3"
8080
;;
8181
linux-aarch64)
8282
runner="zephyr-runner-v2-linux-arm64-4xlarge"
83-
container="ghcr.io/zephyrproject-rtos/ci:main"
83+
container="ghcr.io/zephyrproject-rtos/ci:v0.28.3"
8484
;;
8585
macos-x86_64)
8686
runner="zephyr-runner-v2-macos-arm64-2xlarge"
@@ -118,6 +118,10 @@ jobs:
118118
group: ${{ needs.prep.outputs.runner }}
119119
container: ${{ needs.prep.outputs.container }}
120120

121+
defaults:
122+
run:
123+
shell: bash
124+
121125
strategy:
122126
fail-fast: false
123127
matrix:
@@ -146,68 +150,18 @@ jobs:
146150
- name: Set up test environment (Linux)
147151
if: ${{ runner.os == 'Linux' }}
148152
run: |
149-
# Add ccache PPA to install up-to-date ccache
150-
sudo add-apt-repository -y -n ppa:stephanosio/ccache
151-
152153
# Add GitHub CLI source
153-
sudo mkdir -p -m 755 /etc/apt/keyrings
154-
sudo curl -L -o /etc/apt/keyrings/githubcli-archive-keyring.gpg \
155-
https://cli.github.com/packages/githubcli-archive-keyring.gpg
156-
sudo chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg
157-
sudo mkdir -p -m 755 /etc/apt/sources.list.d
158-
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
154+
mkdir -p -m 755 /etc/apt/keyrings
155+
wget -O /etc/apt/keyrings/githubcli-archive-keyring.gpg \
156+
https://cli.github.com/packages/githubcli-archive-keyring.gpg
157+
chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg
158+
mkdir -p -m 755 /etc/apt/sources.list.d
159+
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null
159160
160161
# Install required system packages
161-
sudo apt-get update
162-
sudo apt-get install -y \
163-
ccache \
164-
cmake \
165-
device-tree-compiler \
166-
dfu-util \
167-
dos2unix \
168-
file \
169-
g++ \
170-
gcc \
171-
gh \
172-
git \
173-
gperf \
174-
jq \
175-
libmagic1 \
176-
make \
177-
ninja-build \
178-
protobuf-compiler \
179-
python3-dev \
180-
python3-tk \
181-
python3-venv \
182-
wget \
183-
xz-utils
184-
185-
if [ "${HOSTTYPE}" = "x86_64" ]; then
186-
sudo apt install -y \
187-
g++-multilib \
188-
gcc-multilib
189-
fi
190-
191-
# Set up Rust
192-
## Install Cargo package manager
193-
wget -q -O- "https://sh.rustup.rs" | sh -s -- -y --default-toolchain 1.86
194-
195-
## Make Cargo globally available
196-
PATH=~/.cargo/bin:$PATH
197-
echo "~/.cargo/bin" >> $GITHUB_PATH
198-
199-
## Install uefi-run utility
200-
sudo -E cargo install uefi-run --root /usr
201-
echo "OVMF_FD_PATH=/usr/share/ovmf/OVMF.fd" >> $GITHUB_ENV
202-
203-
## Install Rust target support required by Zephyr
204-
rustup target install riscv32i-unknown-none-elf
205-
rustup target install riscv64imac-unknown-none-elf
206-
rustup target install thumbv6m-none-eabi
207-
rustup target install thumbv7em-none-eabi
208-
rustup target install thumbv7m-none-eabi
209-
rustup target install thumbv8m.main-none-eabi
210-
rustup target install x86_64-unknown-none
162+
apt-get update
163+
apt-get install -y \
164+
gh
211165
212166
# Set environment variables
213167
echo "TAR=tar" >> $GITHUB_ENV

0 commit comments

Comments
 (0)