-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
93 additions
and
22 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,16 @@ | ||
name: Build and run Pico template tests | ||
description: Build and run tests for the Pico template | ||
|
||
inputs: | ||
template-path: | ||
description: "Path to the root of the template" | ||
required: true | ||
default: "." | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Build tests | ||
run: ${{inputs.template-path}}/.github/scripts/run-all.sh | ||
shell: bash | ||
|
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,41 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
|
||
run_with_timeout() { | ||
local duration=$1 | ||
shift | ||
local command="$@" | ||
|
||
# Run the command but disable exit on error (because timeout will cause an error) | ||
set +e | ||
timeout "$duration" $command | ||
|
||
# Get the exit status of the command and then re-enable exit on error (after forcing a true return value) | ||
exit_status=$? | ||
true | ||
set -e | ||
|
||
# Check the exit status of the timeout command | ||
if [ $exit_status -eq 124 ]; then | ||
echo "Command timed out (success)." | ||
return 0 | ||
elif [ $exit_status -eq 0 ]; then | ||
echo "Command completed successfully within $duration." | ||
return 0 | ||
else | ||
echo "Command failed." | ||
return 1 | ||
fi | ||
} | ||
|
||
build_test() { | ||
local program=$1 | ||
cmake -Bbuild -DLF_MAIN=$program | ||
cmake --build build -j $(nproc) | ||
rm -rf build | ||
} | ||
|
||
build_test Blink | ||
build_test HelloPico | ||
build_test Timer | ||
|
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,26 @@ | ||
name: "CI" | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
ci: | ||
name: Build examples and run tests | ||
runs-on: ubuntu-24.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Clone reactor-uc runtime | ||
run: git clone https://github.com/lf-lang/reactor-uc.git --recursive | ||
|
||
- name: Install Pico dependencies | ||
uses: ./reactor-uc/.github/actions/pico | ||
|
||
- name: Install LFC dependencies | ||
uses: ./reactor-uc/.github/actions/lingua-franca | ||
|
||
- name: Run tests | ||
uses: ./.github/actions/run-tests |
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