Skip to content

Commit 6b2deb7

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 6b2deb7

File tree

1 file changed

+8
-58
lines changed

1 file changed

+8
-58
lines changed

.github/workflows/twister.yml

Lines changed: 8 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -146,68 +146,18 @@ jobs:
146146
- name: Set up test environment (Linux)
147147
if: ${{ runner.os == 'Linux' }}
148148
run: |
149-
# Add ccache PPA to install up-to-date ccache
150-
sudo add-apt-repository -y -n ppa:stephanosio/ccache
151-
152149
# 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 \
150+
mkdir -p -m 755 /etc/apt/keyrings
151+
curl -L -o /etc/apt/keyrings/githubcli-archive-keyring.gpg \
155152
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
153+
chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg
154+
mkdir -p -m 755 /etc/apt/sources.list.d
155+
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
159156
160157
# 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
158+
apt-get update
159+
apt-get install -y \
160+
gh
211161
212162
# Set environment variables
213163
echo "TAR=tar" >> $GITHUB_ENV

0 commit comments

Comments
 (0)