Skip to content

Unit Tests

Unit Tests #937

Workflow file for this run

name: Unit Tests
on:
schedule:
# 6am UTC is 7am Central European Time (CET) or 8am Central European Summer Time (CEST).
- cron: '0 4 * * *'
push:
branches:
- 'master'
# - 'sync'
pull_request:
branches: [ "master" ]
workflow_call:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request || github.ref }}
cancel-in-progress: true
jobs:
Test_x86:
runs-on: ubuntu-22.04
steps:
- name: Maximize build space
uses: easimon/maximize-build-space@master
with:
root-reserve-mb: 32768
temp-reserve-mb: 1024
remove-dotnet: 'true'
remove-android: 'true'
remove-haskell: 'true'
remove-codeql: 'true'
- uses: actions/checkout@v4
- name: Run Scalar Tests on x86
working-directory: ./Scripts
run: |
./unit_tests.sh -t x86
Test_RISCV:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
config:
- {args: "-t GCC -s Spike"}
- {args: "-t LLVM -s Spike"}
# - {args: "-t GCC -s Spike -p"}
# - {args: "-t GCC -s Spike -v -l 64 -e 64"}
- {args: "-t GCC -s Spike -v -l 128 -e 64"}
- {args: "-t GCC -s Spike -v -l 512 -e 64"}
- {args: "-t GCC -s Spike -v -x -l 128 -e 64"}
- {args: "-t GCC -s Spike -v -x -l 512 -e 64"}
# - {args: "-t LLVM -s Spike -v -l 64 -e 64"} # LLVM 17 does not fully support VLEN=64
- {args: "-t LLVM -s Spike -v -l 128 -e 64"}
- {args: "-t LLVM -s Spike -v -l 512 -e 64"}
- {args: "-t LLVM -s Spike -v -x -l 128 -e 64"}
- {args: "-t LLVM -s Spike -v -x -l 512 -e 64"}
# - {args: "-t GCC -s Spike -v -i -l 64 -e 64"}
- {args: "-t GCC -s Spike -v -i -l 128 -e 64"}
- {args: "-t GCC -s Spike -v -i -l 512 -e 64"}
- {args: "-t GCC -s Spike -v -x -i -l 128 -e 64"}
- {args: "-t GCC -s Spike -v -x -i -l 512 -e 64"}
# - {args: "-t LLVM -s Spike -v -i -l 64 -e 64"} # LLVM 17 does not fully support VLEN=64
- {args: "-t LLVM -s Spike -v -i -l 128 -e 64"}
- {args: "-t LLVM -s Spike -v -i -l 512 -e 64"}
- {args: "-t LLVM -s Spike -v -x -i -l 128 -e 64"}
- {args: "-t LLVM -s Spike -v -x -i -l 512 -e 64"}
steps:
- name: Maximize build space
uses: easimon/maximize-build-space@master
with:
root-reserve-mb: 32768
temp-reserve-mb: 1024
remove-dotnet: 'true'
remove-android: 'true'
remove-haskell: 'true'
remove-codeql: 'true'
- uses: actions/checkout@v4
- name: Get dates
id: dates
run: |
echo "today=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
echo "yesterday=$(date +'%Y-%m-%d' -d yesterday)" >> $GITHUB_OUTPUT
echo "date=$(date +'%Y-%m-%d' -d 'last saturday')" >> $GITHUB_OUTPUT
- name: Download GCC + LLVM Cache
id: cache-GCC
uses: actions/cache/restore@v4
env:
cache-name: cache-gcc-binaries
with:
path: |
./Toolchain
!./Toolchain/*.sh
fail-on-cache-miss: true
key: gcc-binaries-${{ steps.dates.outputs.today }}
restore-keys: |
gcc-binaries-${{ steps.dates.outputs.yesterday }}
gcc-binaries-${{ steps.dates.outputs.date }}
gcc-binaries-
- name: Download Spike Cache
id: cache-Spike
uses: actions/cache/restore@v4
env:
cache-name: cache-spike-binaries
with:
path: ./Sim/Spike/bin
fail-on-cache-miss: true
key: spike-binaries-${{ steps.dates.outputs.today }}
restore-keys: |
spike-binaries-${{ steps.dates.outputs.yesterday }}
spike-binaries-${{ steps.dates.outputs.date }}
spike-binaries-
- name: Check Spike
run: |
ls ./Sim/Spike/
ls ./Sim/Spike/bin
ls ./Sim/Spike/bin/spike
ls ./Sim/Spike/bin/pk_ilp32d
- name: Install Spike Dependencies
run: |
sudo apt-get install libboost-all-dev
sudo apt-get install device-tree-compiler
- name: Run Unit Tests on Spike
# if: success() || failure()
working-directory: ./Scripts
run: |
./unit_tests.sh ${{ matrix.config.args }}
# Test_OVPsim:
# if: false
# strategy:
# max-parallel: 1
# fail-fast: false
# matrix:
# config:
# - {args: "-t GCC -s OVPsim"}
# - {args: "-t LLVM -s OVPsim"}
# - {args: "-t GCC -s OVPsim -p"}
# - {args: "-t GCC -s OVPsim -v -l 64 -e 64"}
# - {args: "-t GCC -s OVPsim -v -l 128 -e 64"}
# - {args: "-t GCC -s OVPsim -v -l 512 -e 64"}
# - {args: "-t LLVM -s OVPsim -v -l 64 -e 64"}
# - {args: "-t LLVM -s OVPsim -v -l 128 -e 64"}
# - {args: "-t LLVM -s OVPsim -v -l 512 -e 64"}
# - {args: "-t GCC -s OVPsim -v -i -l 64 -e 64"}
# - {args: "-t GCC -s OVPsim -v -i -l 128 -e 64"}
# - {args: "-t GCC -s OVPsim -v -i -l 512 -e 64"}
# - {args: "-t LLVM -s OVPsim -v -i -l 64 -e 64"}
# - {args: "-t LLVM -s OVPsim -v -i -l 128 -e 64"}
# - {args: "-t LLVM -s OVPsim -v -i -l 512 -e 64"}
#
# runs-on: ubuntu-22.04
# steps:
# - uses: actions/checkout@v4
#
# - name: Get date of last cache build
# id: date
# run: echo "::set-output name=date::$(date +'%Y-%m-%d' -d "last saturday")"
#
# - name: Download GCC Cache
# id: cache-GCC
# uses: actions/cache/restore@v4
# env:
# cache-name: cache-gcc-binaries
# with:
# path: ./Toolchain
# key: gcc-binaries-${{ steps.date.outputs.date }}
# restore-keys: |
# gcc-binaries-
#
# - name: Run Unit Tests on OVPsim
# working-directory: ./Scripts
# run: |
# ./unit_tests.sh ${{ matrix.config.args }}