Skip to content

Commit

Permalink
[#65238] Build Renode from sources
Browse files Browse the repository at this point in the history
  • Loading branch information
p-woj committed Sep 10, 2024
1 parent bb61596 commit 1d9e021
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 40 deletions.
31 changes: 31 additions & 0 deletions .github/build-renode/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Build Renode
description: Builds Renode from source from the specified repository and revision
inputs:
renode_git_repo:
description: Renode git repository
required: true
default: https://github.com/renode/renode
renode_git_ref:
description: Renode git revision
required: true
default: master
runs:
using: composite
steps:
- run: |
echo Building Renode ${RENODE_GIT_REPO} from ${RENODE_GIT_REPO}
git clone ${RENODE_GIT_REPO} renode
cd renode
git checkout ${RENODE_GIT_REF}
git submodule update --init --recursive
shell: bash
env:
RENODE_GIT_REPO: ${{ inputs.renode_git_repo }}
RENODE_GIT_REF: ${{ inputs.renode_git_ref }}
- run: |
sudo apt-get -qqy update
sudo apt-get -y install --no-install-recommends mono-complete policykit-1 libgtk2.0-dev uml-utilities gtk-sharp2
./build.sh
shell: bash
working-directory: renode
if: ${{ runner.os != 'Windows' }}
34 changes: 10 additions & 24 deletions .github/workflows/dpi-examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ on:
pull_request:
workflow_dispatch:
inputs:
renode_url_linux:
description: URL to a Linux portable Renode package
renode_git_repo:
description: 'Renode git repository'
required: true
type: string
renode_url_windows:
description: URL to a Windows Renode package
default: https://github.com/renode/renode
renode_git_ref:
description: 'Renode git revision'
required: true
type: string
default: master
verilator_git_ref:
description: Reference to a Verilator commit
required: true
Expand All @@ -28,9 +28,7 @@ jobs:
matrix:
config:
- runner: ubuntu-20.04
renode_url: ${{ inputs.renode_url_linux || 'https://builds.renode.io/renode-latest.linux-portable.tar.gz' }}
- runner: windows-latest
renode_url: ${{ inputs.renode_url_windows || 'https://builds.renode.io/renode-latest.zip' }}
runs-on: ${{ matrix.config.runner }}
defaults:
run:
Expand All @@ -41,19 +39,10 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Download Renode
run: curl -sSLO ${{ matrix.config.renode_url }}
- name: Unpack Renode for Linux
if: ${{ runner.os != 'Windows' }}
run: |
mkdir renode
tar xf renode*.tar.gz --strip-components 1 -C renode
- name: Unpack Renode for Windows
if: ${{ runner.os == 'Windows' }}
run: |
unzip renode*.zip
rm renode*.zip
mv renode_* renode
- uses: ./.github/build-renode
with:
renode_git_repo: ${{ inputs.renode_git_repo || 'https://github.com/renode/renode' }}
renode_git_ref: ${{ inputs.renode_git_ref || 'master' }}

- name: Run Renode on Linux
if: ${{ runner.os != 'Windows' }}
Expand Down Expand Up @@ -183,10 +172,8 @@ jobs:
- directory_name: ahb_dma
config:
- runner: ubuntu-20.04
renode_url: ${{ inputs.renode_url_linux || 'https://builds.renode.io/renode-latest.linux-portable.tar.gz' }}
verilator_artifact: ${{ needs.build-verilator-linux.outputs.verilator_artifact }}
- runner: windows-latest
renode_url: ${{ inputs.renode_url_windows || 'https://builds.renode.io/renode-latest.zip' }}
verilator_artifact: ${{ needs.build-verilator-windows.outputs.verilator_artifact }}

uses: ./.github/workflows/run-sample.yml
Expand All @@ -197,5 +184,4 @@ jobs:
custom_robot_args: ${{ matrix.sample.custom_robot_args || '' }}

runner: ${{ matrix.config.runner }}
renode_url: ${{ matrix.config.renode_url }}
verilator_artifact: ${{ matrix.config.verilator_artifact }}
19 changes: 3 additions & 16 deletions .github/workflows/run-sample.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ on:
runner:
required: true
type: string
renode_url:
required: true
type: string
verilator_artifact:
required: true
type: string
Expand Down Expand Up @@ -62,19 +59,9 @@ jobs:
- name: Untar the Verilator artifact
run: tar -xf verilator.tar

- name: Download Renode
run: curl -sSLO ${{ inputs.renode_url }}
- name: Unpack Renode for Linux
if: ${{ runner.os != 'Windows' }}
run: |
mkdir renode
tar xf renode*.tar.gz --strip-components 1 -C renode
- name: Unpack Renode for Windows
if: ${{ runner.os == 'Windows' }}
run: |
unzip renode*.zip
rm renode*.zip
mv renode_* renode
- name: Build Renode
uses: ./.github/build-renode
# TODO with repo/ref

- name: Patch Renode on Windows
if: ${{ runner.os == 'Windows' }}
Expand Down

0 comments on commit 1d9e021

Please sign in to comment.