Skip to content
Snippets Groups Projects
Commit 1e1a7597 authored by maxgerhardt's avatar maxgerhardt
Browse files

Try and refactor makefile build

parent 20cbb340
No related branches found
No related tags found
No related merge requests found
name: PlatformIO CI name: Build CI
on: [push, pull_request] on: [push, pull_request]
jobs: jobs:
find-examples: # Job that list subdirectories
runs-on: ubuntu-latest
outputs:
dir: ${{ steps.set-dirs.outputs.dir }} # generate output name dir by using inner step output
steps:
- uses: actions/checkout@v3
- id: set-dirs # Give it an id to handle to get step outputs in the outputs key above
run: echo "::set-output name=dir::$(find examples -name Makefile -print0 |xargs -0 -n 1 dirname | jq -R -s -c 'split("\n")[:-1]')"
# Define step output named dir base on ls command transformed to JSON thanks to jq
# Build using native Makefile buildsystem # Build using native Makefile buildsystem
makefile-build: makefile-build:
needs: [find-examples] # Depends on previous job
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
example: ${{fromJson(needs.find-examples.outputs.dir)}}
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Install Dependencies - name: Install Dependencies
run: sudo apt-get update && sudo apt-get install -y build-essential make libnewlib-dev gcc-riscv64-unknown-elf libusb-1.0-0-dev run: sudo apt-get update && sudo apt-get install -y build-essential make libnewlib-dev gcc-riscv64-unknown-elf libusb-1.0-0-dev
- name: Build Blink Example - name: Build ${{ matrix.example }}
run: cd examples/blink && make V=1 -j3 blink.elf && riscv64-unknown-elf-size blink.elf && cd ../.. run: cd ${{ matrix.example }} && make V=1 -j3 $(basename ${{ matrix.example }}.elf) && riscv64-unknown-elf-size $(basename ${{ matrix.example }}.elf)
- name: Build debugprintfdemo Example
run: cd examples/debugprintfdemo && make V=1 -j3 debugprintfdemo.elf && riscv64-unknown-elf-size debugprintfdemo.elf && cd ../..
# currently not compiling: __get_dscratch0() not defined.
#- name: Build sandbox Example
# run: cd examples/sandbox && make V=1 -j3 sandbox.elf && riscv64-unknown-elf-size sandbox.elf && cd ../..
- name: Build uartdemo Example
run: cd examples/uartdemo && make V=1 -j3 uartdemo.elf && riscv64-unknown-elf-size uartdemo.elf && cd ../..
- name: Build ws2812 Example
run: cd examples/ws2812demo && make V=1 -j3 ws2812bdemo.elf && riscv64-unknown-elf-size ws2812bdemo.elf && cd ../..
# Build using PlatformIO # Build using PlatformIO
pio-build: pio-build:
strategy: strategy:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment