|
| 1 | +name: totp |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ master ] |
| 6 | + pull_request: |
| 7 | + branches: [ master ] |
| 8 | + |
| 9 | +env: |
| 10 | + # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) |
| 11 | + BUILD_TYPE: MinSizeRel |
| 12 | + |
| 13 | +jobs: |
| 14 | + build: |
| 15 | + # The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac. |
| 16 | + # You can convert this to a matrix build if you need cross-platform coverage. |
| 17 | + # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix |
| 18 | + runs-on: ubuntu-latest |
| 19 | + |
| 20 | + strategy: |
| 21 | + matrix: |
| 22 | + cpu: [ lpc1756, lpc1759 ] |
| 23 | + |
| 24 | + steps: |
| 25 | + - name: Fetching klib |
| 26 | + uses: actions/checkout@v3 |
| 27 | + with: |
| 28 | + repository: itzandroidtab/klib |
| 29 | + |
| 30 | + - name: removing example project content |
| 31 | + # create a main file that includes all the header files for the current target |
| 32 | + run: | |
| 33 | + rm -rf ${{github.workspace}}/project/* |
| 34 | +
|
| 35 | + - name: Fetching project |
| 36 | + uses: actions/checkout@v3 |
| 37 | + with: |
| 38 | + path: "${{github.workspace}}/project/" |
| 39 | + |
| 40 | + - name: arm-none-eabi-gcc install |
| 41 | + uses: carlosperate/[email protected] |
| 42 | + with: |
| 43 | + release: '12.2.Rel1' |
| 44 | + |
| 45 | + - name: arm-none-eabi-gcc version |
| 46 | + run: arm-none-eabi-gcc --version |
| 47 | + |
| 48 | + - name: getting arm headers |
| 49 | + uses: actions/checkout@v3 |
| 50 | + with: |
| 51 | + repository: ARM-software/CMSIS_5 |
| 52 | + ref: 'develop' |
| 53 | + fetch-depth: '1' |
| 54 | + path: './CMSIS' |
| 55 | + |
| 56 | + - name: moving arm headers |
| 57 | + run: | |
| 58 | + cp ${{github.workspace}}/CMSIS/CMSIS/Core/Include/* ${{github.workspace}}/targets/arm/ |
| 59 | +
|
| 60 | + - name: generating header |
| 61 | + run: | |
| 62 | + mkdir -p ${{github.workspace}}/targets/${{matrix.cpu}}/docs |
| 63 | + wget -q -O ${{github.workspace}}/targets/${{matrix.cpu}}/docs/${{matrix.cpu}}.svd https://raw.githubusercontent.com/itzandroidtab/klib-svd/master/${{matrix.cpu}}.svd |
| 64 | + 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 |
| 65 | + tar -xf ${{github.workspace}}/svdconv.tbz2 |
| 66 | + chmod +x ${{github.workspace}}/svdconv |
| 67 | + |
| 68 | + ${{github.workspace}}/svdconv ${{github.workspace}}/targets/${{matrix.cpu}}/docs/${{matrix.cpu}}.svd --generate=header -o ${{github.workspace}}/targets/${{matrix.cpu}}/ > /dev/null || true |
| 69 | + sed -i '/#include "system_/d' ${{github.workspace}}/targets/${{matrix.cpu}}/${{matrix.cpu}}.h |
| 70 | + |
| 71 | + - name: Configure CMake |
| 72 | + # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. |
| 73 | + # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type |
| 74 | + 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}} |
| 75 | + |
| 76 | + - name: Build |
| 77 | + # Build your program with the given configuration |
| 78 | + run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} |
| 79 | + |
| 80 | + - name: Uploading artifact |
| 81 | + uses: actions/upload-artifact@v3 |
| 82 | + # upload the elf file as a artifact |
| 83 | + with: |
| 84 | + name: ${{matrix.cpu}} |
| 85 | + path: | |
| 86 | + ${{github.workspace}}/build/project/klib.elf |
| 87 | + ${{github.workspace}}/build/project/klib.map |
| 88 | + ${{github.workspace}}/build/project/klib.lss |
| 89 | + ${{github.workspace}}/build/project/klib.memory |
0 commit comments