-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added github actions + readme update
- Loading branch information
1 parent
4ea07b2
commit 9734ac8
Showing
2 changed files
with
92 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
name: totp | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
env: | ||
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) | ||
BUILD_TYPE: MinSizeRel | ||
|
||
jobs: | ||
build: | ||
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac. | ||
# You can convert this to a matrix build if you need cross-platform coverage. | ||
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
cpu: [ lpc1756, lpc1759 ] | ||
|
||
steps: | ||
- name: Fetching klib | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: itzandroidtab/klib | ||
|
||
- name: removing example project content | ||
# create a main file that includes all the header files for the current target | ||
run: | | ||
rm -rf ${{github.workspace}}/project/* | ||
- name: Fetching project | ||
uses: actions/checkout@v3 | ||
with: | ||
path: "${{github.workspace}}/project/" | ||
|
||
- name: arm-none-eabi-gcc install | ||
uses: carlosperate/arm-none-eabi-gcc-action@v1.6.0 | ||
with: | ||
release: '12.2.Rel1' | ||
|
||
- name: arm-none-eabi-gcc version | ||
run: arm-none-eabi-gcc --version | ||
|
||
- name: getting arm headers | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: ARM-software/CMSIS_5 | ||
ref: 'develop' | ||
fetch-depth: '1' | ||
path: './CMSIS' | ||
|
||
- name: moving arm headers | ||
run: | | ||
cp ${{github.workspace}}/CMSIS/CMSIS/Core/Include/* ${{github.workspace}}/targets/arm/ | ||
- name: generating header | ||
run: | | ||
mkdir -p ${{github.workspace}}/targets/${{matrix.cpu}}/docs | ||
wget -q -O ${{github.workspace}}/targets/${{matrix.cpu}}/docs/${{matrix.cpu}}.svd https://raw.githubusercontent.com/itzandroidtab/klib-svd/master/${{matrix.cpu}}.svd | ||
wget -q -O ${{github.workspace}}/svdconv.tbz2 https://github.com/Open-CMSIS-Pack/devtools/releases/download/tools%2Fsvdconv%2F3.3.44/svdconv-3.3.44-linux64-amd64.tbz2 | ||
tar -xf ${{github.workspace}}/svdconv.tbz2 | ||
chmod +x ${{github.workspace}}/svdconv | ||
${{github.workspace}}/svdconv ${{github.workspace}}/targets/${{matrix.cpu}}/docs/${{matrix.cpu}}.svd --generate=header -o ${{github.workspace}}/targets/${{matrix.cpu}}/ > /dev/null || true | ||
sed -i '/#include "system_/d' ${{github.workspace}}/targets/${{matrix.cpu}}/${{matrix.cpu}}.h | ||
- name: Configure CMake | ||
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. | ||
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type | ||
run: CC=arm-none-eabi-gcc CXX=arm-none-eabi-g++ cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DTARGET_CPU=${{matrix.cpu}} | ||
|
||
- name: Build | ||
# Build your program with the given configuration | ||
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} | ||
|
||
- name: Uploading artifact | ||
uses: actions/upload-artifact@v3 | ||
# upload the elf file as a artifact | ||
with: | ||
name: ${{matrix.cpu}} | ||
path: | | ||
${{github.workspace}}/build/project/klib.elf | ||
${{github.workspace}}/build/project/klib.map | ||
${{github.workspace}}/build/project/klib.lss | ||
${{github.workspace}}/build/project/klib.memory |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters