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

Fix Build Issues, Improve Test Coverage #483

Merged
merged 9 commits into from
Mar 10, 2023
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
83 changes: 9 additions & 74 deletions .github/workflows/Build_Examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,50 +99,16 @@ jobs:

# Add riscv tools to path
echo "/home/runner/riscv-none-embed-gcc/$TOOL_VER/.content/bin" >> $GITHUB_PATH
- name: Install ccache

- name: Setup Python
if: ${{ steps.check_watch.outputs.RUN_TEST == '1' }}
run: |
# Install ccache
sudo apt install -y ccache
uses: actions/setup-python@v4.5.0
with:
cache: pip

# Prepend ccache into the PATH
echo "/usr/bin" >> $GITHUB_PATH
echo "/usr/lib/ccache" >> $GITHUB_PATH

# Setup ccache links
sudo ln -s ../../bin/ccache /usr/bin/arm-none-eabi-addr2line
sudo ln -s ../../bin/ccache /usr/bin/arm-none-eabi-ar
sudo ln -s ../../bin/ccache /usr/bin/arm-none-eabi-as
sudo ln -s ../../bin/ccache /usr/bin/arm-none-eabi-c
sudo ln -s ../../bin/ccache /usr/bin/arm-none-eabi-c++filt
sudo ln -s ../../bin/ccache /usr/bin/arm-none-eabi-cpp
sudo ln -s ../../bin/ccache /usr/bin/arm-none-eabi-elfedit
sudo ln -s ../../bin/ccache /usr/bin/arm-none-eabi-g
sudo ln -s ../../bin/ccache /usr/bin/arm-none-eabi-gcc
sudo ln -s ../../bin/ccache /usr/bin/arm-none-eabi-gcc-10.2.1
sudo ln -s ../../bin/ccache /usr/bin/arm-none-eabi-gcc-ar
sudo ln -s ../../bin/ccache /usr/bin/arm-none-eabi-gcc-nm
sudo ln -s ../../bin/ccache /usr/bin/arm-none-eabi-gcc-ranlib
sudo ln -s ../../bin/ccache /usr/bin/arm-none-eabi-gcov
sudo ln -s ../../bin/ccache /usr/bin/arm-none-eabi-gcov-dump
sudo ln -s ../../bin/ccache /usr/bin/arm-none-eabi-gcov-tool
sudo ln -s ../../bin/ccache /usr/bin/arm-none-eabi-gdb-add-index
sudo ln -s ../../bin/ccache /usr/bin/arm-none-eabi-gdb-add-index-py
sudo ln -s ../../bin/ccache /usr/bin/arm-none-eabi-gdb-py
sudo ln -s ../../bin/ccache /usr/bin/arm-none-eabi-gprof
sudo ln -s ../../bin/ccache /usr/bin/arm-none-eabi-ld
sudo ln -s ../../bin/ccache /usr/bin/arm-none-eabi-ld.bfd
sudo ln -s ../../bin/ccache /usr/bin/arm-none-eabi-lto-dump
sudo ln -s ../../bin/ccache /usr/bin/arm-none-eabi-nm
sudo ln -s ../../bin/ccache /usr/bin/arm-none-eabi-objcopy
sudo ln -s ../../bin/ccache /usr/bin/arm-none-eabi-objdump
sudo ln -s ../../bin/ccache /usr/bin/arm-none-eabi-ranlib
sudo ln -s ../../bin/ccache /usr/bin/arm-none-eabi-readelf
sudo ln -s ../../bin/ccache /usr/bin/arm-none-eabi-size
sudo ln -s ../../bin/ccache /usr/bin/arm-none-eabi-strings
sudo ln -s ../../bin/ccache /usr/bin/arm-none-eabi-strip
sudo ln -s ../../bin/ccache /usr/bin/riscv-none-embed-gcc
- name: Install packages
if: ${{ steps.check_watch.outputs.RUN_TEST == '1' }}
run: pip install -r .github/workflows/scripts/requirements.txt

# Runs a set of commands using the runners shell
- name: Build_Examples
Expand All @@ -155,35 +121,4 @@ jobs:
# Set MAXIM_PATH to limit warnings
export MAXIM_PATH=$(pwd)

cd Examples
# Rebuild all of the peripheral drivers and build all of the Hello_World examples
# Exclude the MAX32572, currently in development
# Exclude the MAX32570, examples are located in another repo
SUBDIRS=$(find . -type d -not -path "./MAX3257*" -name "Hello_World")
for dir in ${SUBDIRS}
do
echo "Testing peripheral driver build from: ${dir}"
make -C ${dir} FORCE_COLOR=1 clean > /dev/null
make -C ${dir} FORCE_COLOR=1 libclean > /dev/null
make -C ${dir} -j8 --output-sync=target --no-print-directory FORCE_COLOR=1 > /dev/null
echo "---"
done

# Find all of the examples,
# Exclude the MAX32572, currently in development
# Exclude the MAX32570, examples are located in another repo
SUBDIRS=$(find . -mindepth 3 -not \( -path "./MAX3257*" -o -path "./MAX*/UCL*" \) -name "?akefile" -printf '%h\n')

# Exclude some examples
SUBDIRS=${SUBDIRS//"./MAX32672/Display/lvgl-8.0.2/tests"/}
SUBDIRS=${SUBDIRS//"./MAX32572/MAX32572_Demo_FreeRTOS"/}
SUBDIRS=${SUBDIRS//"./MAX32572/MAX32572_Demo_BareMetal"/}
SUBDIRS=${SUBDIRS//"./MAX78000/CNN/mnist-streaming"/}

for dir in ${SUBDIRS}
do
echo "Building ${dir}"
make -C ${dir} clean FORCE_COLOR=1 > /dev/null
make -C ${dir} -j8 --output-sync=target --no-print-directory FORCE_COLOR=1 > /dev/null
echo "---"
done
python .github/workflows/scripts/build.py
60 changes: 60 additions & 0 deletions .github/workflows/build-cordio-platform-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Build & Deploy Cordio Platform Docs

on:
workflow_dispatch:


jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v3
id: get-pr
with:
script: |
const request = {
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.issue.number
}
core.info(`Getting PR #${request.pull_number} from ${request.owner}/${request.repo}`)
try {
const result = await github.pulls.get(request)
return result.data
} catch (err) {
core.setFailed(`Request failed with error ${err}`)
}
- uses: actions/checkout@v3
with:
repository: ${{ fromJSON(steps.get-pr.outputs.result).head.repo.full_name }}
ref: ${{ fromJSON(steps.get-pr.outputs.result).head.ref }}
fetch-depth: 0

- name: Generate Docs (MAX32655)
uses: mattnotmitt/doxygen-action@v1.9.5
with:
working-directory: Libraries/Cordio/docs
doxyfile-path: cordio_platform_doxyfile
enable-latex: true

- name: Build PDF
run: |
echo "Building PDF..."
sudo apt-get install texlive-full
sudo make -C Libraries/Cordio/docs/latex

echo "Copying PDF to Cordio/platform/Documentation"
sudo mv Libraries/Cordio/docs/latex/refman.pdf Libraries/Cordio/docs/latex/Cordio-Platform-Documentation.pdf
sudo mkdir -p Libraries/Cordio/platform/Documentation && sudo cp -r Libraries/Cordio/docs/latex/Cordio-Platform-Documentation.pdf Libraries/Cordio/platform/Documentation/


- name: Push Documentation Files
uses: EndBug/add-and-commit@v9.0.1
with:
add: 'Libraries/Cordio/platform/Documentation/Platform_ref.pdf'
message: 'Update documentation.'
push: true




55 changes: 34 additions & 21 deletions .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
cache: pip

- name: Install mkdocs
run: pip install mkdocs
run: pip install -r Documentation/requirements.txt

- name: Doxygen (MAX32520)
uses: mattnotmitt/doxygen-action@1.9.4
Expand All @@ -33,6 +33,22 @@ jobs:
# Working directory
working-directory: Libraries/PeriphDrivers/Documentation

- name: Doxygen (MAX32570)
uses: mattnotmitt/doxygen-action@1.9.4
with:
# Path to Doxyfile
doxyfile-path: max32570_Doxyfile
# Working directory
working-directory: Libraries/PeriphDrivers/Documentation

- name: Doxygen (MAX32572)
uses: mattnotmitt/doxygen-action@1.9.4
with:
# Path to Doxyfile
doxyfile-path: max32572_Doxyfile
# Working directory
working-directory: Libraries/PeriphDrivers/Documentation

- name: Doxygen (MAX32650)
uses: mattnotmitt/doxygen-action@1.9.4
with:
Expand All @@ -57,6 +73,14 @@ jobs:
# Working directory
working-directory: Libraries/PeriphDrivers/Documentation

- name: Doxygen (MAX32662)
uses: mattnotmitt/doxygen-action@1.9.4
with:
# Path to Doxyfile
doxyfile-path: max32662_Doxyfile
# Working directory
working-directory: Libraries/PeriphDrivers/Documentation

- name: Doxygen (MAX32665)
uses: mattnotmitt/doxygen-action@1.9.4
with:
Expand Down Expand Up @@ -97,6 +121,14 @@ jobs:
# Working directory
working-directory: Libraries/PeriphDrivers/Documentation

- name: Doxygen (MAX32690)
uses: mattnotmitt/doxygen-action@1.9.4
with:
# Path to Doxyfile
doxyfile-path: max32690_Doxyfile
# Working directory
working-directory: Libraries/PeriphDrivers/Documentation

- name: Doxygen (MAX78000)
uses: mattnotmitt/doxygen-action@1.9.4
with:
Expand All @@ -115,26 +147,7 @@ jobs:

- name: Build User Guide
run: | # Build Documentation Folder and run mkdocs
SOURCE=Libraries/PeriphDrivers/Documentation
DEST=Documentation/$SOURCE

echo "Copying Periph Driver APIs..."
mkdir -p $DEST/MAX32520 && cp -r $SOURCE/MAX32520 $DEST/
mkdir -p $DEST/MAX32650 && cp -r $SOURCE/MAX32650 $DEST/
mkdir -p $DEST/MAX32655 && cp -r $SOURCE/MAX32655 $DEST/
mkdir -p $DEST/MAX32660 && cp -r $SOURCE/MAX32660 $DEST/
mkdir -p $DEST/MAX32665 && cp -r $SOURCE/MAX32665 $DEST/
mkdir -p $DEST/MAX32670 && cp -r $SOURCE/MAX32670 $DEST/
mkdir -p $DEST/MAX32672 && cp -r $SOURCE/MAX32672 $DEST/
mkdir -p $DEST/MAX32675 && cp -r $SOURCE/MAX32675 $DEST/
mkdir -p $DEST/MAX32680 && cp -r $SOURCE/MAX32680 $DEST/
mkdir -p $DEST/MAX78000 && cp -r $SOURCE/MAX78000 $DEST/
mkdir -p $DEST/MAX78002 && cp -r $SOURCE/MAX78002 $DEST/

echo "Copying any root markdown files into Documentation..."
cp -r *.md Documentation/

mkdocs build
python3 Documentation/build.py

- name: Publish
uses: JamesIves/github-pages-deploy-action@v4.3.0
Expand Down
Loading