totp #44
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
name: totp | |
on: | |
workflow_dispatch: | |
push: | |
branches: [ '**' ] | |
pull_request: | |
branches: [ master ] | |
env: | |
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) | |
BUILD_TYPE: RelWithDebInfo | |
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/[email protected] | |
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/chip/${{matrix.cpu}}/docs | |
wget -q -O ${{github.workspace}}/targets/chip/${{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/chip/${{matrix.cpu}}/docs/${{matrix.cpu}}.svd --generate=header -o ${{github.workspace}}/targets/chip/${{matrix.cpu}}/ > /dev/null || true | |
sed -i '/#include "system_/d' ${{github.workspace}}/targets/chip/${{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 |