Skip to content

Commit

Permalink
Extend CI matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
eszpotanski committed Sep 18, 2023
1 parent b3a2d35 commit cb02e9c
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 24 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/build-spike.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ on:
jobs:
verilator:
name: Build Spike
runs-on: ubuntu-latest
runs-on: [self-hosted, Linux, X64, github-custom-runner]
container: centos:8
env:
TOOL_NAME: spike
TOOL_VERSION: d70ea67d
DEBIAN_FRONTEND: "noninteractive"

steps:
Expand Down Expand Up @@ -39,6 +39,12 @@ jobs:
- name: Install prerequisities
if: ${{ steps.cache.outputs.cache-hit != 'true' }}
run: |
sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
sed -i 's/enabled=0/enabled=1/g' /etc/yum.repos.d/CentOS-Linux-PowerTools.repo
yum update -y
yum install -y epel-release
yum install -y git dtc ccache gcc gcc-c++ make
sudo apt -qqy update && sudo apt -qqy --no-install-recommends install \
git build-essential cmake ccache device-tree-compiler
Expand All @@ -51,7 +57,7 @@ jobs:
export CC="ccache gcc"
export CXX="ccache g++"
pushd spike
git checkout ${{ env.TOOL_VERSION }}
git checkout ${TOOL_VERSION:-d70ea67d}
mkdir build
cd build
../configure --prefix=/opt/spike
Expand Down
96 changes: 75 additions & 21 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,25 @@ on:
push:
pull_request:

env:
TOOL_VERSION: d70ea67d

jobs:
build-spike:
uses: ./.github/workflows/build-spike.yml

test-pyflow:
strategy:
fail-fast: false
matrix:
test:
- riscv_arithmetic_basic_test
runs-on: ubuntu-latest
needs: [build-spike]
steps:
- uses: actions/checkout@v4

- name: Install dependencies
run: sudo apt-get -qqy update && sudo apt-get -qqy install gcc-riscv64-linux-gnu device-tree-compiler
run: sudo apt-get -qqy update && sudo apt-get -qqy install gcc-riscv64-linux-gnu git build-essential device-tree-compiler

- name: Setup python
# python dependencies cannot be properly downloaded with new versions of python
Expand All @@ -30,26 +33,16 @@ jobs:
- name: Install python dependencies
run: python3 -m pip install -r requirements.txt

- name: Setup Cache Metadata
id: cache_metadata
- name: Build spike
run: |
date=$(date +"%Y_%m_%d")
time=$(date +"%Y%m%d_%H%M%S_%N")
cache_spike_restore_key=cache_spike_
cache_spike_key=${cache_spike_restore_key}d70ea67d_${date}
echo "cache_spike_restore_key=$cache_spike_restore_key" | tee -a "$GITHUB_ENV"
echo "cache_spike_key=$cache_spike_key" | tee -a "$GITHUB_ENV"
- name: Restore Spike cache
id: cache-spike-restore
uses: actions/cache/restore@v3
with:
path: |
/opt/spike
/opt/spike/.cache
key: ${{ env.cache_spike_key }}
restore-keys: ${{ env.cache_spike_restore_key }}
git clone https://github.com/riscv-software-src/riscv-isa-sim spike
mkdir -p spike/build
cd spike/build
git checkout $TOOL_VERSION
../conigure --prefix=/opt/spike
make -j`nproc`
make install
cd -
- name: Set variables
run: |
Expand Down Expand Up @@ -84,3 +77,64 @@ jobs:
path: |
test/asm_test/*.log
test/*.log
test-riscv:
runs-on: [self-hosted, Linux, X64, github-custom-runner]
needs: [build-spike]
container: centos:8
strategy:
fail-fast: false
matrix:
test:
- riscv_arithemtic_basic_test
- riscv_rand_instr_test
- riscv_jump_stress_test
- riscv_loop_test
- riscv_rand_jump_test
- riscv_mmu_stress_test
- riscv_no_fence_test
- riscv_illegal_instr_test
- riscv_ebreak_test
- riscv_ebreak_debug_mode_test
- riscv_full_interrupt_test
- riscv_unaligned_load_store_test
- riscv_non_compressed_instr_test
- riscv_hint_instr_test
- riscv_pmp_test
env:
GHA_EXTERNAL_DISK: additional-tools
steps:
- uses: actions/checkout@v3

- name: Prepare Environment
run: _secret_environment

- name: Setup Cache Metadata
id: cache_metadata
run: |
date=$(date +"%Y_%m_%d")
time=$(date +"%Y%m%d_%H%M%S_%N")
cache_spike_restore_key=cache_spike_
cache_spike_key=${cache_spike_restore_key}d70ea67d_${date}
echo "cache_spike_restore_key=$cache_spike_restore_key" | tee -a "$GITHUB_ENV"
echo "cache_spike_key=$cache_spike_key" | tee -a "$GITHUB_ENV"
- name: Restore Spike cache
id: cache-spike-restore
uses: actions/cache/restore@v3
with:
path: |
/opt/spike
/opt/spike/.cache
key: ${{ env.cache_spike_key }}
restore-keys: ${{ env.cache_spike_restore_key }}

- name: Generate Tests
run: _secret_riscv
env:
RISCV_TEST: ${{ matrix.test }}

- name: Run Tests
run: /opt/spike/bin/spike --help

0 comments on commit cb02e9c

Please sign in to comment.