Update GitHub actions #5
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
name: CI | |
on: [push, pull_request] | |
jobs: | |
lint: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout Muntjac | |
uses: actions/checkout@v3 | |
- name: Install Verilator | |
run: | | |
curl -Ls https://download.opensuse.org/repositories/home:phiwag:edatools/xUbuntu_20.04/Release.key | sudo apt-key add - | |
sudo sh -c "echo 'deb http://download.opensuse.org/repositories/home:/phiwag:/edatools/xUbuntu_20.04/ /' > /etc/apt/sources.list.d/edatools.list" | |
sudo apt-get update | |
sudo apt-get install verilator-4.200 | |
- name: Install Python dependencies | |
run: pip3 install setuptools wheel | |
- name: Install FuseSoC | |
run: pip3 install -r python-requirements.txt | |
- name: Run lint | |
run: make lint | |
simulator-build: | |
runs-on: ubuntu-20.04 | |
strategy: | |
matrix: | |
include: | |
- name: pipeline | |
sim: muntjac_pipeline | |
- name: core | |
sim: muntjac_core | |
steps: | |
- name: Checkout Muntjac | |
uses: actions/checkout@v3 | |
- name: Install Verilator | |
run: | | |
curl -Ls https://download.opensuse.org/repositories/home:phiwag:edatools/xUbuntu_20.04/Release.key | sudo apt-key add - | |
sudo sh -c "echo 'deb http://download.opensuse.org/repositories/home:/phiwag:/edatools/xUbuntu_20.04/ /' > /etc/apt/sources.list.d/edatools.list" | |
sudo apt-get update | |
sudo apt-get install verilator-4.200 | |
- name: Install Python dependencies | |
run: pip3 install setuptools wheel | |
- name: Install FuseSoC | |
run: pip3 install -r python-requirements.txt | |
- name: Run build | |
run: make sim-${{ matrix.name }} | |
- name: Upload simulator | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ matrix.sim }} | |
path: bin/${{ matrix.sim }} | |
if-no-files-found: error | |
riscv-tests-build: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout Muntjac | |
uses: actions/checkout@v3 | |
- name: Checkout riscv-tests | |
uses: actions/checkout@v3 | |
with: | |
repository: riscv/riscv-tests | |
ref: c4217d88bce9f805a81f42e86ff56ed363931d69 | |
submodules: recursive | |
path: riscv-tests | |
- name: Override with custom link.ld | |
run: | | |
cp flows/link.ld riscv-tests/env/p/link.ld | |
- name: Download compiler toolchain | |
uses: i3h/download-release-asset@v1 | |
with: | |
owner: lowRISC | |
repo: lowrisc-toolchains | |
tag: 20200904-1 | |
file: lowrisc-toolchain-gcc-rv64imac-20200904-1.tar.xz | |
# Also add the tools to PATH for next step. | |
- name: Extract compiler toolchain | |
run: | | |
tar -xf lowrisc-toolchain-gcc-rv64imac-20200904-1.tar.xz | |
echo "`pwd`/lowrisc-toolchain-gcc-rv64imac-20200904-1/bin" >> $GITHUB_PATH | |
# All tests except breakpoint - it is not part of the core specification. | |
- name: Build ISA tests | |
run: | | |
cd riscv-tests/isa | |
make -j$(nproc) | |
rm *.dump | |
rm rv64mi-p-breakpoint | |
tar -cjf ~/riscv-isa-tests.tar.xz * | |
- name: Upload test binaries | |
uses: actions/upload-artifact@v3 | |
with: | |
name: riscv-isa-tests | |
path: ~/riscv-isa-tests.tar.xz | |
if-no-files-found: error | |
riscv-tests-run: | |
runs-on: ubuntu-20.04 | |
needs: [simulator-build, riscv-tests-build] | |
strategy: | |
matrix: | |
include: | |
- name: pipeline | |
sim: muntjac_pipeline | |
- name: core | |
sim: muntjac_core | |
steps: | |
- name: Checkout Muntjac | |
uses: actions/checkout@v3 | |
- name: Get simulator | |
uses: actions/download-artifact@v3 | |
with: | |
name: ${{ matrix.sim }} | |
- name: Get tests | |
uses: actions/download-artifact@v3 | |
with: | |
name: riscv-isa-tests | |
- name: Unpack tests | |
run: | | |
mkdir tests | |
tar -xf riscv-isa-tests.tar.xz -C tests | |
# Create a summary of each test outcome in the JUnit XML format. | |
- name: Run tests | |
run: | | |
chmod +x ${{ matrix.sim }} | |
make -f test/riscv-tests/Makefile results.xml -j$(nproc) TEST_DIR=tests MUNTJAC_SIM=./${{ matrix.sim }} | |
- name: Upload test report | |
uses: actions/upload-artifact@v3 | |
with: | |
name: riscv-tests-${{ matrix.name }} | |
path: results.xml | |
if-no-files-found: error |