Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 79 additions & 0 deletions .github/workflows/copilot-setup-steps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: "Copilot Setup Steps"

# Automatically run the setup steps when they are changed to allow for easy validation, and
# allow manual testing through the repository's "Actions" tab
on:
workflow_dispatch:
push:
paths:
- .github/workflows/copilot-setup-steps.yml
pull_request:
paths:
- .github/workflows/copilot-setup-steps.yml

jobs:
# The job MUST be called `copilot-setup-steps` or it will not be picked up by Copilot.
copilot-setup-steps:
runs-on: ubuntu-22.04

permissions:
contents: read

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
cmake \
ninja-build \
gperf \
ccache \
dfu-util \
device-tree-compiler \
wget \
python3-dev \
python3-pip \
python3-setuptools \
python3-tk \
python3-wheel \
xz-utils \
file \
make \
gcc \
perl \
libsdl2-dev \
libmagic1 \
doxygen \
graphviz

- name: Install west and Zephyr Python dependencies
run: |
pip3 install --user west
echo "$HOME/.local/bin" >> $GITHUB_PATH

- name: Initialize Zephyr workspace
run: |
west init -m https://github.com/zephyrproject-rtos/zephyr --mr main zephyrproject
cd zephyrproject
west update
west zephyr-export
pip3 install --user -r zephyr/scripts/requirements.txt

- name: Install Zephyr SDK
run: |
SDK_VERSION_FILE="zephyrproject/zephyr/SDK_VERSION"
if [ ! -f "${SDK_VERSION_FILE}" ]; then
echo "ERROR: SDK_VERSION file not found at ${SDK_VERSION_FILE}"
exit 1
fi
SDK_VERSION=$(cat "${SDK_VERSION_FILE}")
SDK_URL="https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v${SDK_VERSION}/zephyr-sdk-${SDK_VERSION}_linux-x86_64.tar.xz"
wget -q "${SDK_URL}" -O /tmp/zephyr-sdk.tar.xz
mkdir -p "$HOME/zephyr-sdk"
tar -xf /tmp/zephyr-sdk.tar.xz -C "$HOME/zephyr-sdk" --strip-components=1
"$HOME/zephyr-sdk/setup.sh" -t all -h -c
echo "ZEPHYR_SDK_INSTALL_DIR=$HOME/zephyr-sdk" >> $GITHUB_ENV
rm /tmp/zephyr-sdk.tar.xz