Skip to content

SpinalHDL Test Suite #32

SpinalHDL Test Suite

SpinalHDL Test Suite #32

Workflow file for this run

name: 'SpinalHDL Test Suite'
on:
workflow_run:
workflows: ['build']
types: [completed]
workflow_dispatch:
inputs:
run_id:
description: 'ID of the build workflow run to download artifacts from'
required: true
type: string
jobs:
build-env:
if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }}
runs-on: windows-2022
strategy:
max-parallel: 1
fail-fast: false
matrix:
scalaVersion: [2.11, 2.12, 2.13]
spinalVersion: [1.13.0]
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set Run ID
id: set_run_id
shell: bash
run: |
if [ "${{ github.event_name }}" == "workflow_run" ]; then
echo "run_id=${{ github.event.workflow_run.id }}" >> $GITHUB_OUTPUT
echo "Using workflow_run ID: ${{ github.event.workflow_run.id }}"
elif [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
echo "run_id=${{ github.event.inputs.run_id }}" >> $GITHUB_OUTPUT
echo "Using manual input run_id: ${{ github.event.inputs.run_id }}"
else
echo "Unsupported event type: ${{ github.event_name }}"
exit 1
fi
- name: Download Build Artifacts
uses: actions/download-artifact@v4
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
name: installer-${{ matrix.scalaVersion }}-${{ matrix.spinalVersion }}
path: ./artifacts
run-id: ${{ steps.set_run_id.outputs.run_id }}
- name: Extract Installer Checksum
id: extract_checksum
shell: bash
run: |
installer_name="msys2-x86_64-${{ matrix.scalaVersion }}-${{ matrix.spinalVersion }}.exe"
if [ -f "./artifacts/msys2-checksums.txt" ]; then
checksum=$(grep "$installer_name" ./artifacts/msys2-checksums.txt | awk '{print $1}')
echo "checksum=$checksum" >> $GITHUB_OUTPUT
echo "Found checksum: $checksum"
else
echo "Checksum file not found, skipping checksum validation"
echo "checksum=" >> $GITHUB_OUTPUT
fi
- name: Set installer path
id: set_installer_path
shell: bash
run: |
installer_path="./artifacts/msys2-x86_64-${{ matrix.scalaVersion }}-${{ matrix.spinalVersion }}.exe"
echo "installer-path=$installer_path" >> $GITHUB_OUTPUT
- name: Run custom installer
run: |
"${{ steps.set_installer_path.outputs.installer-path }}" in --confirm-command --accept-messages --root C:\msys64
- name: Setup MSYS2 environment
uses: msys2/setup-msys2@v2
with:
release: false
update: true
msystem: MINGW64
- name: Allow bashrc run on non-interactive env.
shell: msys2 {0}
run: sed -i '/^\[\[ "\$-" != \*i\* \]\] && return$/d' ~/.bashrc
- name: Clone SpinalHDL
shell: msys2 {0}
run: |
git clone --depth 1 -b dev https://github.com/Readon/SpinalHDL.git
cd SpinalHDL
git submodule update --init --recursive
- name: Run sbt compile
shell: msys2 {0}
working-directory: SpinalHDL
run: |
sbt ++${{ matrix.scalaVersion }} compile
sbt ++${{ matrix.scalaVersion }} Test/compile
- name: Run sbt test
shell: msys2 {0}
working-directory: SpinalHDL
run: |
export WAVES_DIR="${PWD}/cocotbWorkspace"
sbt ++${{ matrix.scalaVersion }} idslplugin/test
sbt ++${{ matrix.scalaVersion }} idslpayload/test
sbt ++${{ matrix.scalaVersion }} 'tester/testOnly spinal.core.* -- -l spinal.tester.psl'
sbt ++${{ matrix.scalaVersion }} sim/test
sbt ++${{ matrix.scalaVersion }} 'tester/testOnly spinal.tester.* -- -l spinal.tester.psl'
sbt ++${{ matrix.scalaVersion }} 'tester/testOnly spinal.lib.* -- -l spinal.tester.psl'