Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update CI #619

Merged
merged 4 commits into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
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
57 changes: 33 additions & 24 deletions .github/actions/build_ci/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,38 +31,46 @@ pre_build(){
build_linux(){
echo " Build for linux"
apt-get install -y libsysfs-dev libhugetlbfs-dev gcc || exit 1
export || exit 1
pwd || exit 1
ls -l || exit 1
cd libmetal || exit 1
cmake . -Bbuild \
-DCMAKE_C_FLAGS="-Werror -Wall -Wextra -Wshadow -Wunused-but-set-variable" || exit 1
cd build || exit 1
make || exit 1
export || exit 1
cd ../.. || exit 1
cmake . -Bbuild -DCMAKE_C_FLAGS="-Werror -Wall -Wextra -Wshadow -Wunused-but-set-variable" \
-DWITH_APPS=on -DWITH_PROXY=on -DCMAKE_INCLUDE_PATH="./libmetal/build/lib/include" \
-DCMAKE_LIBRARY_PATH="./libmetal/build/lib" || exit 1
cd build || exit 1
make VERBOSE=1 all || exit 1
export PROJECT_ROOT=$PWD
echo " -- Build libmetal --"
cd $PROJECT_ROOT/libmetal &&
cmake . -Bbuild -DCMAKE_INSTALL_PREFIX=$PROJECT_ROOT/target \
-DCMAKE_C_FLAGS="-Werror -Wall -Wextra -Wshadow -Wunused-but-set-variable" || exit 1
make -C build install || exit 1
echo " -- Build open_amp --"
cd $PROJECT_ROOT/open-amp
cmake . -Bbuild -DCMAKE_INCLUDE_PATH=$PROJECT_ROOT/libmetal/build/lib/include/ \
-DCMAKE_LIBRARY_PATH=$PROJECT_ROOT/libmetal/build/lib/ \
-DCMAKE_INSTALL_PREFIX=$PROJECT_ROOT/target -DWITH_PROXY=on \
-DCMAKE_C_FLAGS="-Werror -Wall -Wextra -Wshadow -Wunused-but-set-variable" || exit 1
make -C build install || exit 1
pwd
echo " -- Build legacy Apps --"
cd $PROJECT_ROOT/openamp-system-reference/examples/legacy_apps
cmake -Bbuild \
-DCMAKE_INCLUDE_PATH="$PROJECT_ROOT/libmetal/build/lib/include/;$PROJECT_ROOT/open-amp/build/lib/include/" \
-DCMAKE_LIBRARY_PATH="$PROJECT_ROOT/libmetal/build/lib/;$PROJECT_ROOT/open-amp/build/lib/" \
-DCMAKE_INSTALL_PREFIX=$PROJECT_ROOT/target \
-DCMAKE_C_FLAGS="-Werror -Wall -Wextra -Wshadow -Wunused-but-set-variable" || exit 1
make -C build install || exit 1
exit 0
}

build_generic(){
echo " Build for generic platform "
apt-get install -y gcc-arm-none-eabi || exit 1
cd libmetal || exit 1
export PROJECT_ROOT=$PWD
cd $PROJECT_ROOT/libmetal || exit 1
cmake . -Bbuild-generic -DCMAKE_TOOLCHAIN_FILE=template-generic \
-DCMAKE_C_FLAGS="-Werror -Wall -Wextra -Wshadow -Wunused-but-set-variable" || exit 1
cd build-generic || exit 1
make VERBOSE=1 || exit 1
cd ../../ || exit 1
cd $PROJECT_ROOT/open-amp || exit 1
cmake . -Bbuild-generic -DCMAKE_TRY_COMPILE_TARGET_TYPE="STATIC_LIBRARY" \
-DCMAKE_C_FLAGS="-Werror -Wall -Wextra -Wshadow -Wunused-but-set-variable" \
-DCMAKE_SYSTEM_PROCESSOR="arm" -DCMAKE_C_COMPILER=arm-none-eabi-gcc \
-DCMAKE_INCLUDE_PATH="./libmetal/build-generic/lib/include" \
-DCMAKE_LIBRARY_PATH="./libmetal/build-generic/lib" || exit 1
-DCMAKE_INCLUDE_PATH="$PROJECT_ROOT/libmetal/build-generic/lib/include" \
-DCMAKE_LIBRARY_PATH="$PROJECT_ROOT/libmetal/build-generic/lib" || exit 1
cd build-generic || exit 1
make VERBOSE=1 || exit 1
exit 0
Expand All @@ -89,6 +97,7 @@ build_zephyr(){
sudo apt-get install -y libc6-dev-i386 gperf g++ python3-ply python3-yaml device-tree-compiler ncurses-dev uglifyjs -qq || exit 1
pip3 install west || exit 1

export PROJECT_ROOT=$PWD
wget $ZEPHYR_SDK_DOWNLOAD_URL || exit 1
tar xvf $ZEPHYR_SDK_SETUP_TAR || exit 1
rm -rf $ZEPHYR_SDK_INSTALL_DIR || exit 1
Expand All @@ -100,11 +109,11 @@ build_zephyr(){
pip3 install -r ./zephyr/scripts/requirements.txt || exit 1
echo "Update zephyr OpenAMP repos"
#Update zephyr OpenAMP repos
cp -r ../lib modules/lib/open-amp/open-amp/ || exit 1
cp ../CMakeLists.txt modules/lib/open-amp/open-amp/ || exit 1
cp ../VERSION modules/lib/open-amp/open-amp/ || exit 1
cp -r ../cmake modules/lib/open-amp/open-amp/ || exit 1
cp -r ../libmetal modules/hal/libmetal/ || exit 1
cp -r $PROJECT_ROOT/open-amp/lib modules/lib/open-amp/open-amp/ || exit 1
cp $PROJECT_ROOT/open-amp/CMakeLists.txt modules/lib/open-amp/open-amp/ || exit 1
cp $PROJECT_ROOT/open-amp/VERSION modules/lib/open-amp/open-amp/ || exit 1
cp -r $PROJECT_ROOT/open-amp/cmake modules/lib/open-amp/open-amp/ || exit 1
cp -r $PROJECT_ROOT/libmetal modules/hal/libmetal/ || exit 1
cd ./zephyr || exit 1
source zephyr-env.sh || exit 1
echo "build openamp sample"
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/compliance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@ on:
- docs/**
- cmake/**
- scripts/**
- .github/**

jobs:
checkpatch_review:
name: checkpatch review
runs-on: ubuntu-latest
steps:
- name: Checkout the code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
Expand Down
17 changes: 12 additions & 5 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,31 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout open-amp
uses: actions/checkout@v3
uses: actions/checkout@v4
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"path: open-amp" HERE ???
with adjustments in script?

I think libmetal and openamp-system-reference are sub directories of open-amp. That works but is a little strange. Is this easy to fix as described above?? If not we will deal with it later.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I take this comment back. Every build would need to be updated not just the linux build.
We should do this in another PR

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"path: open-amp" HERE ??? with adjustments in script?

I think libmetal and openamp-system-reference are sub directories of open-amp. That works but is a little strange. Is this easy to fix as described above?? If not we will deal with it later.

Not straightforward as expected but I added a commit to address this.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I take this comment back. Every build would need to be updated not just the linux build. We should do this in another PR

extra commit added in the PR

with:
path: open-amp
- name: Checkout libmetal
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: OpenAMP/libmetal
path: libmetal
- name: Checkout openamp-system-reference
uses: actions/checkout@v4
with:
repository: OpenAMP/openamp-system-reference
path: openamp-system-reference
- name: build for Linux
id: build_linux
uses: ./.github/actions/build_ci
uses: ./open-amp/.github/actions/build_ci
with:
target: linux
- name: build for Zephyr
id: build_Zephyr
uses: ./.github/actions/build_ci
uses: ./open-amp/.github/actions/build_ci
with:
target: zephyr
- name: build for generic arm
id: build_generic
uses: ./.github/actions/build_ci
uses: ./open-amp/.github/actions/build_ci
with:
target: generic