Skip to content

Commit

Permalink
Patmos test added to the github workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
EhsanKhodadad committed Aug 5, 2024
1 parent 4341e39 commit 153af0b
Show file tree
Hide file tree
Showing 5 changed files with 83 additions and 2 deletions.
17 changes: 17 additions & 0 deletions .github/actions/setup-patmos/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Install Patmos and dependencies (Linux only)
description: Install Patmos and dependencies (Linux only)
runs:
using: "composite"
steps:
- name: Setup
run: |
# Clone the Patmos repository
mkdir ~/t-crest
cd ~/t-crest
git clone https://github.com/t-crest/patmos-misc.git misc
./misc/build.sh
# Save location in PATH
export PATH=$PATH:$HOME/t-crest/misc
shell: bash

4 changes: 4 additions & 0 deletions .github/workflows/c-embedded.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,7 @@ jobs:
# Run the C FlexPRET integration tests.
flexpret:
uses: ./.github/workflows/c-flexpret-tests.yml

# Run the C Patmos integration tests.
patmos:
uses: ./.github/workflows/c-patmos-tests.yml
53 changes: 53 additions & 0 deletions .github/workflows/c-patmos-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: C Patmos tests

on:
workflow_call:
inputs:
compiler-ref:
required: false
type: string
runtime-ref:
required: false
type: string
use-cpp:
required: false
type: boolean
default: false
scheduler:
required: false
type: string
all-platforms:
required: false
default: true
type: boolean

jobs:
Patmos-tests:
runs-on: ubuntu-latest
steps:
- name: Check out lingua-franca repository
uses: actions/checkout@v3
with:
repository: lf-lang/lingua-franca
submodules: true
ref: ${{ inputs.compiler-ref }}
fetch-depth: 0
- name: Prepare build environment
uses: ./.github/actions/prepare-build-env
- name: Setup and build Patmos
uses: ./.github/actions/setup-patmos
- name: Check out specific ref of reactor-c
uses: actions/checkout@v3
with:
repository: lf-lang/reactor-c
path: core/src/main/resources/lib/c/reactor-c
ref: ${{ inputs.runtime-ref }}
if: ${{ inputs.runtime-ref }}
- name: Run Patmos smoke tests
run: |
rm -rf test/C/src-gen
- name: Report to CodeCov
uses: ./.github/actions/report-code-coverage
with:
files: core/build/reports/jacoco/integrationTestCodeCoverageReport/integrationTestCodeCoverageReport.xml
if: ${{ github.repository == 'lf-lang/lingua-franca' }}
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,14 @@ CodeBuilder generateCMakeCode(
cMakeCode.pr("set(FP_FLASH_DEVICE " + selectedFlashDevice.value() + ")");
cMakeCode.newLine();
} // No FP_FLASH_DEVICE will automatically become /dev/ttyUSB0

break;
case PATMOS:
cMakeCode.newLine();
cMakeCode.pr("# Find and set Patmos compiler");
cMakeCode.pr("find_program(CLANG_EXECUTABLE NAMES patmos-clang clang DOC \"Path to the clang front-end.\")");
cMakeCode.pr("set(CMAKE_C_COMPILER ${CLANG_EXECUTABLE})");
cMakeCode.pr("project(" + executableName + " LANGUAGES C)");
cMakeCode.newLine();
break;
default:
cMakeCode.pr("project(" + executableName + " LANGUAGES C)");
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/resources/lib/cpp/reactor-cpp

0 comments on commit 153af0b

Please sign in to comment.