Skip to content

Commit e0e4121

Browse files
Have LFC generate a main function that can optionally be included (#159)
* Have LFC generate a main function that can optionally be included in the build * CI * CI * CI * Setup LFC in RIOT container * Switch to riot master * Fix * Install LFC deps in zephyr CI also --------- Co-authored-by: Lasse Rosenow <[email protected]>
1 parent 4545a55 commit e0e4121

File tree

18 files changed

+68
-55
lines changed

18 files changed

+68
-55
lines changed

.github/actions/riot/action.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@ runs:
88
uses: actions/cache@v4
99
with:
1010
path: ${{env.RIOTBASE}}
11-
key: riot-${{env.RIOT_VERSION}}
11+
key: riot-${{env.RIOT_COMMIT_ID}}
1212

1313
- name: Install RIOT
1414
if: steps.cache-riot.outputs.cache-hit != 'true'
1515
run: |
16-
git clone -b ${{env.RIOT_VERSION}}-branch https://github.com/RIOT-OS/RIOT.git ${{env.RIOTBASE}}
16+
git clone https://github.com/RIOT-OS/RIOT.git ${{env.RIOTBASE}}
17+
cd ${{env.RIOTBASE}}
18+
git checkout ${{env.RIOT_COMMIT_ID}}
1719
shell: bash

.github/workflows/riot.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,21 @@ jobs:
1010
container:
1111
image: riot/riotbuild:latest
1212
env:
13-
RIOT_VERSION: "2024.07"
14-
RIOTBASE: "/opt/riot-2024.07"
13+
RIOT_COMMIT_ID: "cb5500b4b7600d95f42a3070abae402be4f63845"
14+
RIOTBASE: "/opt/riot-cb5500b4b7600d95f42a3070abae402be4f63845"
15+
REACTOR_UC_PATH: ${{ github.workspace }}
1516
steps:
1617
- name: Checkout
1718
uses: actions/checkout@v3
1819
with:
1920
submodules: recursive
2021

21-
- name: Install dependencies
22+
- name: Install RIOT dependencies
2223
uses: ./.github/actions/riot
2324

25+
- name: Install LFC dependencies
26+
uses: ./.github/actions/lingua-franca
27+
2428
- name: Build examples
2529
working-directory: ${{ github.workspace }}/examples/riot
2630
run: ./buildAll.sh

.github/workflows/zephyr.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,20 @@ jobs:
77
ci:
88
name: Build examples
99
runs-on: ubuntu-latest
10+
env:
11+
REACTOR_UC_PATH: ${{ github.workspace }}
1012
steps:
1113
- name: Checkout
1214
uses: actions/checkout@v3
1315
with:
1416
submodules: recursive
1517

16-
- name: Install dependencies
18+
- name: Install Zephyr dependencies
1719
uses: ./.github/actions/zephyr
1820

21+
- name: Install LFC dependencies
22+
uses: ./.github/actions/lingua-franca
23+
1924
- name: Build examples
2025
working-directory: ${{ github.workspace }}/examples/zephyr
2126
run: ./buildAll.sh

examples/flexpret/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ project(fp-lf)
1414
include(src-gen/Smoke/CMakeLists.txt)
1515
add_subdirectory(${REACTOR_UC_PATH})
1616

17-
add_executable(fp-smoke main.c ${LFC_GEN_SOURCES})
17+
add_executable(fp-smoke ${LFC_GEN_MAIN} ${LFC_GEN_SOURCES})
1818
target_link_libraries(fp-smoke PUBLIC reactor-uc)
1919
target_include_directories(fp-smoke PRIVATE ${LFC_GEN_INCLUDE_DIRS})
2020

examples/flexpret/main.c

Lines changed: 0 additions & 5 deletions
This file was deleted.

examples/riot/buildAll.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,8 @@ for board in "${BOARDS[@]}"; do
2121
popd
2222
done
2323
done
24+
25+
# Build lf example
26+
pushd hello_lf
27+
run/build.sh
28+
popd

examples/riot/hello_lf/main.c

Lines changed: 0 additions & 5 deletions
This file was deleted.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/env bash
2+
3+
${REACTOR_UC_PATH}/lfc/bin/lfc-dev src/HelloLF.lf
4+
make all

examples/zephyr/buildAll.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,9 @@ for dir in "${FOLDERS[@]}"; do
1616
pushd $dir
1717
$COMMAND
1818
popd
19-
done
19+
done
20+
21+
# Build lf example
22+
pushd hello_lf
23+
run/build.sh
24+
popd

examples/zephyr/hello_lf/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ set(PLATFORM "ZEPHYR" CACHE STRING "Set platform to Zephyr")
66
include(src-gen/HelloLF/CMakeLists.txt)
77
add_subdirectory(${REACTOR_UC_PATH})
88

9-
target_sources(app PRIVATE main.c ${LF_SOURCES})
9+
target_sources(app PRIVATE ${LFC_GEN_MAIN} ${LFC_GEN_SOURCES})
1010
target_link_libraries(app PRIVATE reactor-uc)
11-
target_include_directories(app PRIVATE ${LF_INCLUDE_DIRS})
11+
target_include_directories(app PRIVATE ${LFC_GEN_INCLUDE_DIRS})

0 commit comments

Comments
 (0)