Skip to content
Open
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
143 changes: 143 additions & 0 deletions .github/workflows/peripheral-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
name: Build peripheral

Check failure on line 1 in .github/workflows/peripheral-build.yml

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

DOS_LINE_ENDINGS

.github/workflows/peripheral-build.yml:1 DOS line endings See https://docs.zephyrproject.org/latest/contribute/guidelines.html#coding-style for more details.
run-name: Build peripheral

Check failure on line 2 in .github/workflows/peripheral-build.yml

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

DOS_LINE_ENDINGS

.github/workflows/peripheral-build.yml:2 DOS line endings See https://docs.zephyrproject.org/latest/contribute/guidelines.html#coding-style for more details.
on:

Check failure on line 3 in .github/workflows/peripheral-build.yml

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

DOS_LINE_ENDINGS

.github/workflows/peripheral-build.yml:3 DOS line endings See https://docs.zephyrproject.org/latest/contribute/guidelines.html#coding-style for more details.
push:

Check failure on line 4 in .github/workflows/peripheral-build.yml

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

DOS_LINE_ENDINGS

.github/workflows/peripheral-build.yml:4 DOS line endings See https://docs.zephyrproject.org/latest/contribute/guidelines.html#coding-style for more details.
pull_request:

Check failure on line 5 in .github/workflows/peripheral-build.yml

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

DOS_LINE_ENDINGS

.github/workflows/peripheral-build.yml:5 DOS line endings See https://docs.zephyrproject.org/latest/contribute/guidelines.html#coding-style for more details.
schedule:

Check failure on line 6 in .github/workflows/peripheral-build.yml

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

DOS_LINE_ENDINGS

.github/workflows/peripheral-build.yml:6 DOS line endings See https://docs.zephyrproject.org/latest/contribute/guidelines.html#coding-style for more details.
- cron: "0 0 * * *"

Check failure on line 7 in .github/workflows/peripheral-build.yml

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

DOS_LINE_ENDINGS

.github/workflows/peripheral-build.yml:7 DOS line endings See https://docs.zephyrproject.org/latest/contribute/guidelines.html#coding-style for more details.
jobs:

Check failure on line 8 in .github/workflows/peripheral-build.yml

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

DOS_LINE_ENDINGS

.github/workflows/peripheral-build.yml:8 DOS line endings See https://docs.zephyrproject.org/latest/contribute/guidelines.html#coding-style for more details.
Build-peripheral:

Check failure on line 9 in .github/workflows/peripheral-build.yml

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

DOS_LINE_ENDINGS

.github/workflows/peripheral-build.yml:9 DOS line endings See https://docs.zephyrproject.org/latest/contribute/guidelines.html#coding-style for more details.
runs-on: ubuntu-latest

Check failure on line 10 in .github/workflows/peripheral-build.yml

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

DOS_LINE_ENDINGS

.github/workflows/peripheral-build.yml:10 DOS line endings See https://docs.zephyrproject.org/latest/contribute/guidelines.html#coding-style for more details.

env:
ZSDK_VERSION: "1.0.1"
HOSTTYPE: "x86_64_minimal"

container:
image: ghcr.io/zephyrproject-rtos/ci-base:latest
options: '--entrypoint /bin/bash'

steps:
- name: check size
run: |
df -h
ls -al /opt/
du -h --max-depth=1 /opt
sudo rm -rf /opt/fvps
echo "-----------------------"
df -h
echo "-----------------------"
du -h --max-depth=1 /opt

- name: set_env
run: |
if [ "${{ github.event_name }}" = "pull_request" -o "${{ github.event_name }}" = "pull_request_target" ];then
echo "This is pull request"
echo "EVENT_TRIGER_REF=${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV
fi
if [ "${{ github.event_name }}" = "push" ];then
echo "This is push"
echo "EVENT_TRIGER_REF=${{ github.ref }}" >> $GITHUB_ENV
fi

- name: print_env
run: |
echo "sdk-version -> ${ZSDK_VERSION}"
echo "event_triger_ref: ${EVENT_TRIGER_REF}"
echo "${{ github.event.pull_request.head.sha || github.ref }}"

- name: setup sdk
shell: bash
run: |
mkdir -p /opt/toolchains
cd /opt/toolchains
wget -q --show-progress --progress=bar:force:noscroll https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v${ZSDK_VERSION}/zephyr-sdk-${ZSDK_VERSION}_linux-${HOSTTYPE}.tar.xz
wget -q https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v${ZSDK_VERSION}/toolchain_gnu_linux-x86_64_arm-zephyr-eabi.tar.xz
tar xf zephyr-sdk-${ZSDK_VERSION}_linux-${HOSTTYPE}.tar.xz
mkdir -p /opt/toolchains/zephyr-sdk-${ZSDK_VERSION}/gnu
tar xf toolchain_gnu_linux-x86_64_arm-zephyr-eabi.tar.xz -C /opt/toolchains/zephyr-sdk-${ZSDK_VERSION}/gnu/
zephyr-sdk-${ZSDK_VERSION}/setup.sh -c
rm zephyr-sdk-${ZSDK_VERSION}_linux-${HOSTTYPE}.tar.xz
echo "zephyr sdk -> zephyr-sdk-${ZSDK_VERSION}"
echo "-----------------------"
ls /opt/toolchains/zephyr-sdk-${ZSDK_VERSION}
echo "-----------------------"
du -sh /opt/toolchains/zephyr-sdk-${ZSDK_VERSION}
echo "-----------------------"
/opt/toolchains/zephyr-sdk-${ZSDK_VERSION}/setup.sh -c
echo "-----------------------"
df -h

- name: checkout manifest
uses: actions/checkout@v4
with:
repository: "rtkconnectivity/realtek-zephyr-project.git"
path: "realtek-zephyr-project"
ref: "rtl87x2j"
fetch-depth: 0
persist-credentials: false

- name: west update
shell: bash
run: |
cd realtek-zephyr-project
west init -m https://github.com/rtkconnectivity/realtek-zephyr-project --mr rtl87x2j
west update
echo "workspace: $(west topdir)"
echo "current: $(pwd)"

- name: check zephyr path and manifest_rev
shell: bash
run: |
echo "GITHUB_REPOSITORY -> $GITHUB_REPOSITORY"
cd realtek-zephyr-project
readarray -t project_list <<< "$(west list)"
EVENT_PROJECT_PATH=""
for i in "${project_list[@]}"
do
project_detail=($i)
project_url=`echo ${project_detail[3]}`
repository_name=`echo "$GITHUB_REPOSITORY" | awk -F/ '{print $NF}'`
if [[ $project_url == *"${repository_name}" ]]
then
EVENT_PROJECT_PATH=`echo ${project_detail[1]}`
echo "EVENT_PROJECT_PATH=$EVENT_PROJECT_PATH" >> $GITHUB_ENV
echo "EVENT_PROJECT_PATH -> $EVENT_PROJECT_PATH"
echo "GITHUB_ENV -> $GITHUB_ENV"
break
fi
done
if [ -z "$EVENT_PROJECT_PATH" ]
then
echo "logic error, can not find local path for ${GITHUB_REPOSITY}"
exit 1
fi
cd $EVENT_PROJECT_PATH
git log --reverse -1
echo "need to checkout ${GITHUB_REPOSITORY} in realtek-zephyr-project/$EVENT_PROJECT_PATH"
echo "manifest_rev=$( git rev-parse manifest-rev )" >> $GITHUB_ENV

- name: checkout event triggered ref
uses: actions/checkout@v4
with:
repository: ${{ github.repository }}
path: ${{ format('{0}/{1}','realtek-zephyr-project',env.EVENT_PROJECT_PATH) }}
ref: ${{ github.event.pull_request.head.sha || github.ref }}
fetch-depth: 0
persist-credentials: false
clean: false

- name: after check temp module
shell: bash
run: |
cd realtek-zephyr-project/$EVENT_PROJECT_PATH
echo "manifest_rev -> ${manifest_rev}"
git branch manifest-rev $manifest_rev

- name: do build
shell: bash
run: |
cd realtek-zephyr-project/zephyr
echo "============= build rtl87x2j ============="
west build -b rtl87x2j_evb/rtl8762jth samples/bluetooth/peripheral -p
rm -rf build

Check warning on line 143 in .github/workflows/peripheral-build.yml

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

YAMLLint (new-line-at-end-of-file)

.github/workflows/peripheral-build.yml:143 no new line character at the end of file Check YAML files with YAMLLint.
Loading