|
| 1 | +name: Install Patmos and dependencies (Linux only) |
| 2 | +description: Install Patmos and dependencies (Linux only) |
| 3 | +inputs: |
| 4 | + clone-template: |
| 5 | + description: "Clone lf-patmos-template next to reactor-uc" |
| 6 | + required: false |
| 7 | + default: "true" |
| 8 | +runs: |
| 9 | + using: "composite" |
| 10 | + steps: |
| 11 | + - name: Install required packages |
| 12 | + shell: bash |
| 13 | + run: | |
| 14 | + sudo apt-get update |
| 15 | + sudo apt-get install -y git openjdk-11-jdk cmake make g++ texinfo flex bison \ |
| 16 | + subversion libelf-dev graphviz libboost-dev libboost-program-options-dev ruby-full \ |
| 17 | + liblpsolve55-dev zlib1g-dev gtkwave gtkterm scala autoconf libfl2 expect verilator curl chrpath |
| 18 | +
|
| 19 | + - name: Install sbt |
| 20 | + shell: bash |
| 21 | + run: | |
| 22 | + sudo apt-get update |
| 23 | + sudo apt-get install -y apt-transport-https gnupg |
| 24 | + echo "deb https://repo.scala-sbt.org/scalasbt/debian all main" | sudo tee /etc/apt/sources.list.d/sbt.list |
| 25 | + echo "deb https://repo.scala-sbt.org/scalasbt/debian /" | sudo tee /etc/apt/sources.list.d/sbt_old.list |
| 26 | + curl -sL "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2EE0EA64E40A89B84B2DF73499E82A75642AC823" | sudo -H gpg --no-default-keyring --keyring gnupg-ring:/etc/apt/trusted.gpg.d/scalasbt-release.gpg --import |
| 27 | + sudo chmod 644 /etc/apt/trusted.gpg.d/scalasbt-release.gpg |
| 28 | + sudo apt-get update |
| 29 | + sudo apt-get install -y sbt |
| 30 | +
|
| 31 | + - name: Clone and build Patmos |
| 32 | + shell: bash |
| 33 | + run: | |
| 34 | + export PATH=$PATH:$HOME/t-crest/local/bin |
| 35 | + echo "PATH=$PATH:$HOME/t-crest/local/bin" >> "$GITHUB_ENV" |
| 36 | + echo $PATH |
| 37 | + mkdir ~/t-crest |
| 38 | + cd ~/t-crest |
| 39 | + git clone https://github.com/t-crest/patmos-misc.git misc |
| 40 | + ./misc/build.sh -q |
| 41 | +
|
| 42 | + - name: Verify Patmos installation |
| 43 | + shell: bash |
| 44 | + run: | |
| 45 | + patmos-clang --version |
| 46 | + if [ $? -ne 0 ]; then |
| 47 | + echo "Patmos installation failed" |
| 48 | + exit 1 |
| 49 | + fi |
| 50 | +
|
| 51 | + - name: Clone template |
| 52 | + shell: bash |
| 53 | + run: | |
| 54 | + if [ "${{ inputs.clone-template }}" = "true" ]; then |
| 55 | + echo "Cloning lf-patmos-template (reactor-uc branch) as sibling of reactor-uc..." |
| 56 | + # Clone one level up from GITHUB_WORKSPACE (which is reactor-uc/) |
| 57 | + cd "$GITHUB_WORKSPACE/.." |
| 58 | + git clone --depth=1 --branch reactor-uc https://github.com/lf-lang/lf-patmos-template.git lf-patmos-template |
| 59 | + if [ ! -f "$GITHUB_WORKSPACE/../lf-patmos-template/MakefileTemplate" ]; then |
| 60 | + echo "lfc: error: Patmos template not found at: $GITHUB_WORKSPACE/../lf-patmos-template/MakefileTemplate"; |
| 61 | + exit 1; |
| 62 | + fi |
| 63 | + echo "Template cloned successfully at $GITHUB_WORKSPACE/../lf-patmos-template" |
| 64 | + fi |
0 commit comments