CI: Decouple build and test into separate scripts, simplify workflows
- Split the monolithic ci-script.bash into ci-build.bash and ci-test.bash, with shared setup in ci-common.bash. - Pass job parameters as explicit command-line options rather than environment variables (--compiler, --prefix, --suite, --asan, --gcov, --reloc, --ccwarn). - Detect the host OS and distribution at runtime (uname, /etc/os-release) instead of the legacy Travis-era CI_OS_NAME, CI_RUNS_ON and CI_BUILD_STAGE_NAME variables. - Remove dead code: FreeBSD support, Windows wavediff install, the unused CI_COMMIT variable, and various redundant operations. - Inline the single-entry build-job matrices. - Rename osx to macOS - Refuse to run these ci scripts outside GitHub Actions to protect developer checkouts.
This commit is contained in:
parent
198cce29ba
commit
33a0f59f3c
|
|
@ -29,127 +29,79 @@ concurrency:
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
build-2604-gcc:
|
build-2604-gcc:
|
||||||
name: Build | ${{ matrix.os }} | ${{ matrix.cc }}${{ matrix.asan && ' | asan' || '' }}
|
name: Build | ubuntu-26.04 | gcc
|
||||||
uses: ./.github/workflows/reusable-build.yml
|
uses: ./.github/workflows/reusable-build.yml
|
||||||
with:
|
with:
|
||||||
sha: ${{ github.sha }}
|
sha: ${{ github.sha }}
|
||||||
os: ${{ matrix.os }}
|
os: ubuntu-26.04
|
||||||
os-name: linux
|
cc: gcc
|
||||||
cc: ${{ matrix.cc }}
|
dev-asan: 0
|
||||||
dev-asan: ${{ matrix.asan }}
|
|
||||||
dev-gcov: 0
|
dev-gcov: 0
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- {os: ubuntu-26.04, cc: gcc, asan: 0}
|
|
||||||
|
|
||||||
build-2604-clang:
|
build-2604-clang:
|
||||||
name: Build | ${{ matrix.os }} | ${{ matrix.cc }}${{ matrix.asan && ' | asan' || '' }}
|
name: Build | ubuntu-26.04 | clang
|
||||||
uses: ./.github/workflows/reusable-build.yml
|
uses: ./.github/workflows/reusable-build.yml
|
||||||
with:
|
with:
|
||||||
sha: ${{ github.sha }}
|
sha: ${{ github.sha }}
|
||||||
os: ${{ matrix.os }}
|
os: ubuntu-26.04
|
||||||
os-name: linux
|
cc: clang
|
||||||
cc: ${{ matrix.cc }}
|
dev-asan: 1
|
||||||
dev-asan: ${{ matrix.asan }}
|
|
||||||
dev-gcov: 0
|
dev-gcov: 0
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- {os: ubuntu-26.04, cc: clang, asan: 1}
|
|
||||||
|
|
||||||
build-2404-gcc:
|
build-2404-gcc:
|
||||||
name: Build | ${{ matrix.os }} | ${{ matrix.cc }}${{ matrix.asan && ' | asan' || '' }}
|
name: Build | ubuntu-24.04 | gcc
|
||||||
uses: ./.github/workflows/reusable-build.yml
|
uses: ./.github/workflows/reusable-build.yml
|
||||||
with:
|
with:
|
||||||
sha: ${{ github.sha }}
|
sha: ${{ github.sha }}
|
||||||
os: ${{ matrix.os }}
|
os: ubuntu-24.04
|
||||||
os-name: linux
|
cc: gcc
|
||||||
cc: ${{ matrix.cc }}
|
dev-asan: 0
|
||||||
dev-asan: ${{ matrix.asan }}
|
|
||||||
dev-gcov: 0
|
dev-gcov: 0
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- {os: ubuntu-24.04, cc: gcc, asan: 0}
|
|
||||||
|
|
||||||
build-2404-clang:
|
build-2404-clang:
|
||||||
name: Build | ${{ matrix.os }} | ${{ matrix.cc }}${{ matrix.asan && ' | asan' || '' }}
|
name: Build | ubuntu-24.04 | clang
|
||||||
uses: ./.github/workflows/reusable-build.yml
|
uses: ./.github/workflows/reusable-build.yml
|
||||||
with:
|
with:
|
||||||
sha: ${{ github.sha }}
|
sha: ${{ github.sha }}
|
||||||
os: ${{ matrix.os }}
|
os: ubuntu-24.04
|
||||||
os-name: linux
|
cc: clang
|
||||||
cc: ${{ matrix.cc }}
|
dev-asan: 0
|
||||||
dev-asan: ${{ matrix.asan }}
|
|
||||||
dev-gcov: 0
|
dev-gcov: 0
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- {os: ubuntu-24.04, cc: clang, asan: 0}
|
|
||||||
|
|
||||||
build-2204-gcc:
|
build-2204-gcc:
|
||||||
name: Build | ${{ matrix.os }} | ${{ matrix.cc }}${{ matrix.asan && ' | asan' || '' }}
|
name: Build | ubuntu-22.04 | gcc
|
||||||
uses: ./.github/workflows/reusable-build.yml
|
uses: ./.github/workflows/reusable-build.yml
|
||||||
with:
|
with:
|
||||||
sha: ${{ github.sha }}
|
sha: ${{ github.sha }}
|
||||||
os: ${{ matrix.os }}
|
os: ubuntu-22.04
|
||||||
os-name: linux
|
cc: gcc
|
||||||
cc: ${{ matrix.cc }}
|
dev-asan: 0
|
||||||
dev-asan: ${{ matrix.asan }}
|
|
||||||
dev-gcov: 0
|
dev-gcov: 0
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- {os: ubuntu-22.04, cc: gcc, asan: 0}
|
|
||||||
|
|
||||||
build-osx-gcc:
|
build-macos-15-gcc:
|
||||||
name: Build | ${{ matrix.os }} | ${{ matrix.cc }}${{ matrix.asan && ' | asan' || '' }}
|
name: Build | macos-15 | gcc
|
||||||
uses: ./.github/workflows/reusable-build.yml
|
uses: ./.github/workflows/reusable-build.yml
|
||||||
with:
|
with:
|
||||||
sha: ${{ github.sha }}
|
sha: ${{ github.sha }}
|
||||||
os: ${{ matrix.os }}
|
os: macos-15
|
||||||
os-name: osx
|
cc: gcc
|
||||||
cc: ${{ matrix.cc }}
|
dev-asan: 0
|
||||||
dev-asan: ${{ matrix.asan }}
|
|
||||||
dev-gcov: 0
|
dev-gcov: 0
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- {os: macos-15, cc: gcc, asan: 0}
|
|
||||||
|
|
||||||
build-osx-clang:
|
build-macos-15-clang:
|
||||||
name: Build | ${{ matrix.os }} | ${{ matrix.cc }}${{ matrix.asan && ' | asan' || '' }}
|
name: Build | macos-15 | clang
|
||||||
uses: ./.github/workflows/reusable-build.yml
|
uses: ./.github/workflows/reusable-build.yml
|
||||||
with:
|
with:
|
||||||
sha: ${{ github.sha }}
|
sha: ${{ github.sha }}
|
||||||
os: ${{ matrix.os }}
|
os: macos-15
|
||||||
os-name: osx
|
cc: clang
|
||||||
cc: ${{ matrix.cc }}
|
dev-asan: 0
|
||||||
dev-asan: ${{ matrix.asan }}
|
|
||||||
dev-gcov: 0
|
dev-gcov: 0
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- {os: macos-15, cc: clang, asan: 0}
|
|
||||||
|
|
||||||
build-windows:
|
build-windows:
|
||||||
name: Build | ${{ matrix.os }} | ${{ matrix.cc }}
|
name: Build | windows-2025-vs2026 | msvc
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: windows-2025-vs2026
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- {os: windows-2025-vs2026, cc: msvc}
|
|
||||||
env:
|
env:
|
||||||
CI_OS_NAME: win
|
|
||||||
CCACHE_COMPRESS: 1
|
CCACHE_COMPRESS: 1
|
||||||
CCACHE_DIR: ${{ github.workspace }}/.ccache
|
CCACHE_DIR: ${{ github.workspace }}/.ccache
|
||||||
CCACHE_LIMIT_MULTIPLE: 0.95
|
CCACHE_LIMIT_MULTIPLE: 0.95
|
||||||
|
|
@ -177,7 +129,7 @@ jobs:
|
||||||
name: verilator-win.zip
|
name: verilator-win.zip
|
||||||
|
|
||||||
test-2604-gcc:
|
test-2604-gcc:
|
||||||
name: Test | ${{ matrix.os }} | ${{ matrix.cc }} | ${{ matrix.reloc && 'reloc | ' || '' }} ${{ matrix.suite }}
|
name: Test | ${{ matrix.os }} | ${{ matrix.cc }} | ${{ matrix.suite }}
|
||||||
needs: build-2604-gcc
|
needs: build-2604-gcc
|
||||||
uses: ./.github/workflows/reusable-test.yml
|
uses: ./.github/workflows/reusable-test.yml
|
||||||
with:
|
with:
|
||||||
|
|
@ -201,7 +153,7 @@ jobs:
|
||||||
- {os: ubuntu-26.04, cc: gcc, reloc: 0, suite: vltmt-2}
|
- {os: ubuntu-26.04, cc: gcc, reloc: 0, suite: vltmt-2}
|
||||||
|
|
||||||
test-2604-clang:
|
test-2604-clang:
|
||||||
name: Test | ${{ matrix.os }} | ${{ matrix.cc }} | ${{ matrix.reloc && 'reloc | ' || '' }} ${{ matrix.suite }}
|
name: Test | ${{ matrix.os }} | ${{ matrix.cc }} | ${{ matrix.suite }}
|
||||||
needs: build-2604-clang
|
needs: build-2604-clang
|
||||||
uses: ./.github/workflows/reusable-test.yml
|
uses: ./.github/workflows/reusable-test.yml
|
||||||
with:
|
with:
|
||||||
|
|
@ -225,7 +177,7 @@ jobs:
|
||||||
- {os: ubuntu-26.04, cc: clang, reloc: 0, suite: vltmt-2}
|
- {os: ubuntu-26.04, cc: clang, reloc: 0, suite: vltmt-2}
|
||||||
|
|
||||||
test-2404-gcc:
|
test-2404-gcc:
|
||||||
name: Test | ${{ matrix.os }} | ${{ matrix.cc }} | ${{ matrix.reloc && 'reloc | ' || '' }} ${{ matrix.suite }}
|
name: Test | ${{ matrix.os }} | ${{ matrix.cc }} | ${{ matrix.suite }}
|
||||||
needs: build-2404-gcc
|
needs: build-2404-gcc
|
||||||
uses: ./.github/workflows/reusable-test.yml
|
uses: ./.github/workflows/reusable-test.yml
|
||||||
with:
|
with:
|
||||||
|
|
@ -249,7 +201,7 @@ jobs:
|
||||||
- {os: ubuntu-24.04, cc: gcc, reloc: 0, suite: vltmt-2}
|
- {os: ubuntu-24.04, cc: gcc, reloc: 0, suite: vltmt-2}
|
||||||
|
|
||||||
test-2404-clang:
|
test-2404-clang:
|
||||||
name: Test | ${{ matrix.os }} | ${{ matrix.cc }} | ${{ matrix.reloc && 'reloc | ' || '' }} ${{ matrix.suite }}
|
name: Test | ${{ matrix.os }} | ${{ matrix.cc }} | ${{ matrix.suite }}
|
||||||
needs: build-2404-clang
|
needs: build-2404-clang
|
||||||
uses: ./.github/workflows/reusable-test.yml
|
uses: ./.github/workflows/reusable-test.yml
|
||||||
with:
|
with:
|
||||||
|
|
@ -273,7 +225,7 @@ jobs:
|
||||||
- {os: ubuntu-24.04, cc: clang, reloc: 1, suite: vltmt-2}
|
- {os: ubuntu-24.04, cc: clang, reloc: 1, suite: vltmt-2}
|
||||||
|
|
||||||
test-2204-gcc:
|
test-2204-gcc:
|
||||||
name: Test | ${{ matrix.os }} | ${{ matrix.cc }} | ${{ matrix.reloc && 'reloc | ' || '' }} ${{ matrix.suite }}
|
name: Test | ${{ matrix.os }} | ${{ matrix.cc }} | ${{ matrix.suite }}
|
||||||
needs: build-2204-gcc
|
needs: build-2204-gcc
|
||||||
uses: ./.github/workflows/reusable-test.yml
|
uses: ./.github/workflows/reusable-test.yml
|
||||||
with:
|
with:
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,6 @@ jobs:
|
||||||
# between the root of the pull request and the target branch
|
# between the root of the pull request and the target branch
|
||||||
sha: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
|
sha: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
|
||||||
os: ubuntu-24.04
|
os: ubuntu-24.04
|
||||||
os-name: linux
|
|
||||||
cc: gcc
|
cc: gcc
|
||||||
dev-asan: 0
|
dev-asan: 0
|
||||||
dev-gcov: 1
|
dev-gcov: 1
|
||||||
|
|
|
||||||
|
|
@ -15,18 +15,12 @@ jobs:
|
||||||
format:
|
format:
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
name: Ubuntu 24.04 | format
|
name: Ubuntu 24.04 | format
|
||||||
env:
|
|
||||||
CI_OS_NAME: linux
|
|
||||||
CI_RUNS_ON: ubuntu-24.04
|
|
||||||
CI_COMMIT: ${{ github.sha }}
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
|
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- name: Install packages for build
|
- name: Install packages for build
|
||||||
env:
|
|
||||||
CI_BUILD_STAGE_NAME: build
|
|
||||||
run: |
|
run: |
|
||||||
sudo apt install clang-format-18 || \
|
sudo apt install clang-format-18 || \
|
||||||
sudo apt install clang-format-18
|
sudo apt install clang-format-18
|
||||||
|
|
|
||||||
|
|
@ -17,9 +17,6 @@ on:
|
||||||
cc: # 'clang' or 'gcc'
|
cc: # 'clang' or 'gcc'
|
||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
os-name: # 'linux' or 'osx'
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
dev-asan:
|
dev-asan:
|
||||||
required: true
|
required: true
|
||||||
type: number
|
type: number
|
||||||
|
|
@ -32,12 +29,9 @@ on:
|
||||||
value: ${{ jobs.build.outputs.archive }}
|
value: ${{ jobs.build.outputs.archive }}
|
||||||
|
|
||||||
env:
|
env:
|
||||||
CI_OS_NAME: ${{ inputs.os-name }}
|
|
||||||
CCACHE_COMPRESS: 1
|
CCACHE_COMPRESS: 1
|
||||||
CCACHE_DIR: ${{ github.workspace }}/.ccache
|
CCACHE_DIR: ${{ github.workspace }}/.ccache
|
||||||
CCACHE_LIMIT_MULTIPLE: 0.95
|
CCACHE_LIMIT_MULTIPLE: 0.95
|
||||||
INSTALL_DIR: ${{ github.workspace }}/install
|
|
||||||
RELOC_DIR: ${{ github.workspace }}/relloc
|
|
||||||
|
|
||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
|
|
@ -52,11 +46,6 @@ jobs:
|
||||||
outputs:
|
outputs:
|
||||||
archive: ${{ steps.create-archive.outputs.archive }}
|
archive: ${{ steps.create-archive.outputs.archive }}
|
||||||
env:
|
env:
|
||||||
CI_BUILD_STAGE_NAME: build
|
|
||||||
CI_DEV_ASAN: ${{ inputs.dev-asan }}
|
|
||||||
CI_DEV_GCOV: ${{ inputs.dev-gcov }}
|
|
||||||
CI_RUNS_ON: ${{ inputs.os }}
|
|
||||||
CXX: ${{ inputs.cc == 'clang' && 'clang++' || 'g++' }}
|
|
||||||
CACHE_BASE_KEY: build-${{ inputs.os }}-${{ inputs.cc }}
|
CACHE_BASE_KEY: build-${{ inputs.os }}-${{ inputs.cc }}
|
||||||
CCACHE_MAXSIZE: 1000M # Per build matrix entry (* 5 = 5000M in total)
|
CCACHE_MAXSIZE: 1000M # Per build matrix entry (* 5 = 5000M in total)
|
||||||
steps:
|
steps:
|
||||||
|
|
@ -78,10 +67,16 @@ jobs:
|
||||||
${{ env.CACHE_KEY }}-
|
${{ env.CACHE_KEY }}-
|
||||||
|
|
||||||
- name: Install packages for build
|
- name: Install packages for build
|
||||||
run: ./ci/ci-install.bash
|
run: ./ci/ci-install.bash build
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: ./ci/ci-script.bash
|
run: |
|
||||||
|
./ci/ci-build.bash \
|
||||||
|
--prefix ${{ github.workspace }}/install \
|
||||||
|
--compiler ${{ inputs.cc }} \
|
||||||
|
--ccwarn \
|
||||||
|
${{ inputs.dev-asan && '--asan' || '' }} \
|
||||||
|
${{ inputs.dev-gcov && '--gcov' || '' }}
|
||||||
|
|
||||||
- name: Create repository archive
|
- name: Create repository archive
|
||||||
id: create-archive
|
id: create-archive
|
||||||
|
|
|
||||||
|
|
@ -8,9 +8,6 @@ on:
|
||||||
workflow_call:
|
workflow_call:
|
||||||
|
|
||||||
env:
|
env:
|
||||||
CI_OS_NAME: linux
|
|
||||||
CI_BUILD_STAGE_NAME: build
|
|
||||||
CI_RUNS_ON: ubuntu-22.04
|
|
||||||
CCACHE_COMPRESS: 1
|
CCACHE_COMPRESS: 1
|
||||||
CCACHE_DIR: ${{ github.workspace }}/.ccache
|
CCACHE_DIR: ${{ github.workspace }}/.ccache
|
||||||
CCACHE_LIMIT_MULTIPLE: 0.95
|
CCACHE_LIMIT_MULTIPLE: 0.95
|
||||||
|
|
@ -32,7 +29,7 @@ jobs:
|
||||||
path: repo
|
path: repo
|
||||||
|
|
||||||
- name: Install packages for build
|
- name: Install packages for build
|
||||||
run: ./ci/ci-install.bash
|
run: ./ci/ci-install.bash build
|
||||||
|
|
||||||
- name: Configure
|
- name: Configure
|
||||||
run: |
|
run: |
|
||||||
|
|
|
||||||
|
|
@ -28,12 +28,9 @@ on:
|
||||||
type: number
|
type: number
|
||||||
|
|
||||||
env:
|
env:
|
||||||
CI_OS_NAME: linux
|
|
||||||
CCACHE_COMPRESS: 1
|
CCACHE_COMPRESS: 1
|
||||||
CCACHE_DIR: ${{ github.workspace }}/.ccache
|
CCACHE_DIR: ${{ github.workspace }}/.ccache
|
||||||
CCACHE_LIMIT_MULTIPLE: 0.95
|
CCACHE_LIMIT_MULTIPLE: 0.95
|
||||||
INSTALL_DIR: ${{ github.workspace }}/install
|
|
||||||
RELOC_DIR: ${{ github.workspace }}/relloc
|
|
||||||
|
|
||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
|
|
@ -46,9 +43,6 @@ jobs:
|
||||||
runs-on: ${{ inputs.os }}
|
runs-on: ${{ inputs.os }}
|
||||||
name: Test
|
name: Test
|
||||||
env:
|
env:
|
||||||
CI_BUILD_STAGE_NAME: test
|
|
||||||
CI_RUNS_ON: ${{ inputs.os }}
|
|
||||||
CI_RELOC: ${{inputs.reloc }}
|
|
||||||
CXX: ${{ inputs.cc == 'clang' && 'clang++' || 'g++' }}
|
CXX: ${{ inputs.cc == 'clang' && 'clang++' || 'g++' }}
|
||||||
CACHE_BASE_KEY: test-${{ inputs.os }}-${{ inputs.cc }}-${{inputs.reloc }}-${{ inputs.suite }}
|
CACHE_BASE_KEY: test-${{ inputs.os }}-${{ inputs.cc }}-${{inputs.reloc }}-${{ inputs.suite }}
|
||||||
CCACHE_MAXSIZE: 100M # Per build per suite (* 5 * 5 = 2500M in total)
|
CCACHE_MAXSIZE: 100M # Per build per suite (* 5 * 5 = 2500M in total)
|
||||||
|
|
@ -78,17 +72,17 @@ jobs:
|
||||||
|
|
||||||
- name: Install test dependencies
|
- name: Install test dependencies
|
||||||
run: |
|
run: |
|
||||||
./ci/ci-install.bash
|
./ci/ci-install.bash test
|
||||||
make venv
|
make venv
|
||||||
|
|
||||||
- name: Test
|
- name: Test
|
||||||
id: run-test
|
id: run-test
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
env:
|
|
||||||
TESTS: ${{ inputs.suite }}
|
|
||||||
run: |
|
run: |
|
||||||
source .venv/bin/activate
|
source .venv/bin/activate
|
||||||
./ci/ci-script.bash
|
./ci/ci-test.bash \
|
||||||
|
--suite ${{ inputs.suite }} \
|
||||||
|
${{ inputs.reloc && format('--reloc {0}/reloc', github.workspace) || '' }}
|
||||||
|
|
||||||
- name: Combine code coverage data
|
- name: Combine code coverage data
|
||||||
if: ${{ inputs.dev-gcov }}
|
if: ${{ inputs.dev-gcov }}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,82 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
# DESCRIPTION: Verilator: CI build job script
|
||||||
|
#
|
||||||
|
# SPDX-FileCopyrightText: 2026 Wilson Snyder
|
||||||
|
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Executed in the 'build' stage.
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
# Destructive to the checkout (reconfigures and rebuilds); never run locally
|
||||||
|
if [ "$GITHUB_ACTIONS" != "true" ]; then
|
||||||
|
echo "ERROR: $(basename "$0") must only be run in GitHub Actions CI" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
set -e
|
||||||
|
set -x
|
||||||
|
|
||||||
|
source "$(dirname "$0")/ci-common.bash"
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Parse arguments
|
||||||
|
|
||||||
|
OPT_ASAN=0
|
||||||
|
OPT_CCWARN=0
|
||||||
|
OPT_GCOV=0
|
||||||
|
OPT_COMPILER=
|
||||||
|
OPT_PREFIX=
|
||||||
|
while [ $# -gt 0 ]; do
|
||||||
|
case "$1" in
|
||||||
|
--asan) OPT_ASAN=1 ;;
|
||||||
|
--ccwarn) OPT_CCWARN=1 ;;
|
||||||
|
--compiler)
|
||||||
|
[ $# -ge 2 ] || fatal "--compiler requires an argument"
|
||||||
|
OPT_COMPILER="$2"
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
--gcov) OPT_GCOV=1 ;;
|
||||||
|
--prefix)
|
||||||
|
[ $# -ge 2 ] || fatal "--prefix requires an argument"
|
||||||
|
OPT_PREFIX="$2"
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
*) fatal "Unknown option: '$1'" ;;
|
||||||
|
esac
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
|
||||||
|
[ -n "$OPT_COMPILER" ] || fatal "--compiler is required"
|
||||||
|
[ -n "$OPT_PREFIX" ] || fatal "--prefix is required"
|
||||||
|
|
||||||
|
# Map the compiler name to the executable name configure CXX expects
|
||||||
|
case "$OPT_COMPILER" in
|
||||||
|
clang) CXX=clang++ ;;
|
||||||
|
gcc) CXX=g++ ;;
|
||||||
|
*) fatal "Unknown compiler: '$OPT_COMPILER'" ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Configure
|
||||||
|
|
||||||
|
CONFIGURE_ARGS="--prefix=$OPT_PREFIX --enable-longtests"
|
||||||
|
if [ "$OPT_CCWARN" = 1 ]; then
|
||||||
|
CONFIGURE_ARGS="$CONFIGURE_ARGS --enable-ccwarn"
|
||||||
|
fi
|
||||||
|
if [ "$OPT_ASAN" = 1 ]; then
|
||||||
|
CONFIGURE_ARGS="$CONFIGURE_ARGS --enable-dev-asan"
|
||||||
|
CXX="$CXX -DVL_LEAK_CHECKS"
|
||||||
|
fi
|
||||||
|
if [ "$OPT_GCOV" = 1 ]; then
|
||||||
|
CONFIGURE_ARGS="$CONFIGURE_ARGS --enable-dev-gcov"
|
||||||
|
fi
|
||||||
|
autoconf
|
||||||
|
./configure $CONFIGURE_ARGS CXX="$CXX"
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Build
|
||||||
|
|
||||||
|
ccache -z
|
||||||
|
"$MAKE" -j "$NPROC" -k
|
||||||
|
ccache -svv
|
||||||
|
|
@ -0,0 +1,37 @@
|
||||||
|
# DESCRIPTION: Verilator: CI common definitions, sourced by the stage scripts
|
||||||
|
#
|
||||||
|
# SPDX-FileCopyrightText: 2026 Wilson Snyder
|
||||||
|
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Common definitions sourced by the CI stage scripts; not executed directly.
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
fatal() {
|
||||||
|
echo "ERROR: $(basename "$0"): $1" >&2; exit 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "$(uname -s)" in
|
||||||
|
Linux)
|
||||||
|
HOST_OS=linux
|
||||||
|
MAKE=make
|
||||||
|
NPROC=$(nproc)
|
||||||
|
# Distro id/version; subshell keeps os-release out of our namespace
|
||||||
|
if [ -r /etc/os-release ]; then
|
||||||
|
DISTRO_ID=$(. /etc/os-release; echo "$ID")
|
||||||
|
DISTRO_VERSION=$(. /etc/os-release; echo "$VERSION_ID")
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
Darwin)
|
||||||
|
HOST_OS=macOS
|
||||||
|
MAKE=make
|
||||||
|
NPROC=$(sysctl -n hw.logicalcpu)
|
||||||
|
# Disable ccache, doesn't always work in GitHub Actions
|
||||||
|
export OBJCACHE=
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
fatal "Unknown host OS: '$(uname -s)'"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
export MAKE
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# DESCRIPTION: Verilator: CI dependency install script
|
# DESCRIPTION: Verilator: CI dependency install script
|
||||||
#
|
#
|
||||||
# SPDX-FileCopyrightText: 2020 Geza Lore
|
# SPDX-FileCopyrightText: 2026 Wilson Snyder
|
||||||
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
@ -10,30 +10,33 @@
|
||||||
# required by the particular build stage.
|
# required by the particular build stage.
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
|
# Installs system packages with sudo; never run locally
|
||||||
|
if [ "$GITHUB_ACTIONS" != "true" ]; then
|
||||||
|
echo "ERROR: $(basename "$0") must only be run in GitHub Actions CI" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
set -x
|
set -x
|
||||||
|
|
||||||
cd $(dirname "$0")/..
|
cd $(dirname "$0")/..
|
||||||
|
|
||||||
|
source "$(dirname "$0")/ci-common.bash"
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Parse arguments
|
||||||
|
|
||||||
|
# Which stage to install dependencies for: 'build' or 'test'
|
||||||
|
STAGE="$1"
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Install dependencies
|
||||||
|
|
||||||
# Avoid occasional cpan failures "Issued certificate has expired."
|
# Avoid occasional cpan failures "Issued certificate has expired."
|
||||||
export PERL_LWP_SSL_VERIFY_HOSTNAME=0
|
export PERL_LWP_SSL_VERIFY_HOSTNAME=0
|
||||||
echo "check_certificate = off" >> ~/.wgetrc
|
echo "check_certificate = off" >> ~/.wgetrc
|
||||||
|
|
||||||
fatal() {
|
if [ "$HOST_OS" = "linux" ]; then
|
||||||
echo "ERROR: $(basename "$0"): $1" >&2; exit 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if [ "$CI_OS_NAME" = "linux" ]; then
|
|
||||||
MAKE=make
|
|
||||||
elif [ "$CI_OS_NAME" = "osx" ]; then
|
|
||||||
MAKE=make
|
|
||||||
elif [ "$CI_OS_NAME" = "freebsd" ]; then
|
|
||||||
MAKE=gmake
|
|
||||||
else
|
|
||||||
fatal "Unknown CI_OS_NAME: '$CI_OS_NAME'"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$CI_OS_NAME" = "linux" ]; then
|
|
||||||
# Avoid slow "processing triggers for man db"
|
# Avoid slow "processing triggers for man db"
|
||||||
echo "path-exclude /usr/share/doc/*" | sudo tee -a /etc/dpkg/dpkg.cfg.d/01_nodoc
|
echo "path-exclude /usr/share/doc/*" | sudo tee -a /etc/dpkg/dpkg.cfg.d/01_nodoc
|
||||||
echo "path-exclude /usr/share/man/*" | sudo tee -a /etc/dpkg/dpkg.cfg.d/01_nodoc
|
echo "path-exclude /usr/share/man/*" | sudo tee -a /etc/dpkg/dpkg.cfg.d/01_nodoc
|
||||||
|
|
@ -44,100 +47,100 @@ install-wavediff() {
|
||||||
source ci/docker/buildenv/wavetools.conf
|
source ci/docker/buildenv/wavetools.conf
|
||||||
local _base_url="https://github.com/hudson-trading/wavetools/releases/download/${WAVETOOLS_VERSION}"
|
local _base_url="https://github.com/hudson-trading/wavetools/releases/download/${WAVETOOLS_VERSION}"
|
||||||
local _platform
|
local _platform
|
||||||
if [ "$CI_OS_NAME" = "linux" ]; then
|
if [ "$HOST_OS" = "linux" ]; then
|
||||||
_platform="linux-x86_64"
|
_platform="linux-x86_64"
|
||||||
elif [ "$CI_OS_NAME" = "osx" ]; then
|
elif [ "$HOST_OS" = "macOS" ]; then
|
||||||
_platform="macos-arm64"
|
_platform="macos-arm64"
|
||||||
elif [ "$CI_OS_NAME" = "windows" ]; then
|
|
||||||
_platform="windows-x86_64"
|
|
||||||
else
|
else
|
||||||
echo "WARNING: No wavetools binary available for CI_OS_NAME=$CI_OS_NAME, skipping"
|
echo "WARNING: No wavetools binary available for HOST_OS=$HOST_OS, skipping"
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
local _tmpdir
|
local _tmpdir
|
||||||
_tmpdir=$(mktemp -d)
|
_tmpdir=$(mktemp -d)
|
||||||
local _archive="wavetools-${WAVETOOLS_VERSION}-${_platform}"
|
local _archive="wavetools-${WAVETOOLS_VERSION}-${_platform}"
|
||||||
if [ "$CI_OS_NAME" = "windows" ]; then
|
wget -q -O "${_tmpdir}/${_archive}.tar.gz" "${_base_url}/${_archive}.tar.gz"
|
||||||
wget -q -O "${_tmpdir}/${_archive}.zip" "${_base_url}/${_archive}.zip"
|
tar -xzf "${_tmpdir}/${_archive}.tar.gz" -C "${_tmpdir}"
|
||||||
unzip -o "${_tmpdir}/${_archive}.zip" -d "${_tmpdir}"
|
|
||||||
else
|
|
||||||
wget -q -O "${_tmpdir}/${_archive}.tar.gz" "${_base_url}/${_archive}.tar.gz"
|
|
||||||
tar -xzf "${_tmpdir}/${_archive}.tar.gz" -C "${_tmpdir}"
|
|
||||||
fi
|
|
||||||
sudo cp "${_tmpdir}/${_archive}/wavediff" /usr/local/bin/wavediff
|
sudo cp "${_tmpdir}/${_archive}/wavediff" /usr/local/bin/wavediff
|
||||||
rm -rf "${_tmpdir}"
|
rm -rf "${_tmpdir}"
|
||||||
}
|
}
|
||||||
|
|
||||||
if [ "$CI_BUILD_STAGE_NAME" = "build" ]; then
|
if [ "$STAGE" = "build" ]; then
|
||||||
##############################################################################
|
##############################################################################
|
||||||
# Dependencies of jobs in the 'build' stage, i.e.: packages required to
|
# Dependencies of jobs in the 'build' stage, i.e.: packages required to
|
||||||
# build Verilator
|
# build Verilator
|
||||||
|
|
||||||
if [ "$CI_OS_NAME" = "linux" ]; then
|
if [ "$HOST_OS" = "linux" ]; then
|
||||||
sudo apt-get update ||
|
if [ "$DISTRO_ID" = "ubuntu" ]; then
|
||||||
sudo apt-get update
|
PACKAGES=(
|
||||||
sudo apt-get install --yes ccache help2man libfl-dev ||
|
bear
|
||||||
sudo apt-get install --yes ccache help2man libfl-dev
|
ccache
|
||||||
if [[ ! "$CI_RUNS_ON" =~ "ubuntu-22.04" ]]; then
|
help2man
|
||||||
# Some conflict of libunwind verison on 22.04, can live without it for now
|
libfl-dev
|
||||||
sudo apt-get install --yes libjemalloc-dev ||
|
libsystemc-dev
|
||||||
sudo apt-get install --yes libjemalloc-dev
|
mold
|
||||||
fi
|
)
|
||||||
if [[ "$CI_RUNS_ON" =~ "ubuntu-22.04" ]] || [[ "$CI_RUNS_ON" =~ "ubuntu-24.04" ]] || [[ "$CI_RUNS_ON" =~ "ubuntu-26.04" ]]; then
|
# libunwind conflict on 22.04, can live without libjemalloc there
|
||||||
if [[ ! "$CI_RUNS_ON" =~ "-riscv" ]]; then
|
if [ "$DISTRO_VERSION" != "22.04" ]; then
|
||||||
sudo apt-get install --yes libsystemc libsystemc-dev ||
|
PACKAGES+=(libjemalloc-dev)
|
||||||
sudo apt-get install --yes libsystemc libsystemc-dev
|
|
||||||
fi
|
fi
|
||||||
|
sudo apt-get update ||
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install --yes "${PACKAGES[@]}" ||
|
||||||
|
sudo apt-get install --yes "${PACKAGES[@]}"
|
||||||
fi
|
fi
|
||||||
if [[ "$CI_RUNS_ON" =~ "ubuntu-22.04" ]] || [[ "$CI_RUNS_ON" =~ "ubuntu-24.04" ]] || [[ "$CI_RUNS_ON" =~ "ubuntu-26.04" ]]; then
|
elif [ "$HOST_OS" = "macOS" ]; then
|
||||||
sudo apt-get install --yes bear mold ||
|
PACKAGES=(
|
||||||
sudo apt-get install --yes bear mold
|
autoconf
|
||||||
fi
|
bison
|
||||||
elif [ "$CI_OS_NAME" = "osx" ]; then
|
ccache
|
||||||
|
flex
|
||||||
|
gperftools
|
||||||
|
help2man
|
||||||
|
perl
|
||||||
|
)
|
||||||
brew update ||
|
brew update ||
|
||||||
brew update
|
brew update
|
||||||
brew install ccache perl gperftools autoconf bison flex help2man ||
|
brew install "${PACKAGES[@]}" ||
|
||||||
brew install ccache perl gperftools autoconf bison flex help2man
|
brew install "${PACKAGES[@]}"
|
||||||
elif [ "$CI_OS_NAME" = "freebsd" ]; then
|
|
||||||
sudo pkg install -y autoconf bison ccache gmake perl5
|
|
||||||
else
|
else
|
||||||
fatal "Unknown CI_OS_NAME: '$CI_OS_NAME'"
|
fatal "Unknown HOST_OS: '$HOST_OS'"
|
||||||
fi
|
fi
|
||||||
|
elif [ "$STAGE" = "test" ]; then
|
||||||
if [ -n "$CCACHE_DIR" ]; then
|
|
||||||
mkdir -p "$CCACHE_DIR"
|
|
||||||
fi
|
|
||||||
elif [ "$CI_BUILD_STAGE_NAME" = "test" ]; then
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
# Dependencies of jobs in the 'test' stage, i.e.: packages required to
|
# Dependencies of jobs in the 'test' stage, i.e.: packages required to
|
||||||
# run the tests
|
# run the tests
|
||||||
|
|
||||||
if [ "$CI_OS_NAME" = "linux" ]; then
|
if [ "$HOST_OS" = "linux" ]; then
|
||||||
sudo apt-get update ||
|
if [ "$DISTRO_ID" = "ubuntu" ]; then
|
||||||
sudo apt-get update
|
PACKAGES=(
|
||||||
# libfl-dev needed for internal coverage's test runs
|
ccache
|
||||||
sudo apt-get install --yes gdb gtkwave lcov libfl-dev ccache jq z3 ||
|
gdb
|
||||||
sudo apt-get install --yes gdb gtkwave lcov libfl-dev ccache jq z3
|
jq
|
||||||
# Required for test_regress/t/t_dist_attributes.py
|
lcov
|
||||||
if [[ "$CI_RUNS_ON" =~ "ubuntu-22.04" ]] || [[ "$CI_RUNS_ON" =~ "ubuntu-24.04" ]] || [[ "$CI_RUNS_ON" =~ "ubuntu-26.04" ]]; then
|
libfl-dev
|
||||||
sudo apt-get install --yes python3-clang mold ||
|
libsystemc-dev
|
||||||
sudo apt-get install --yes python3-clang mold
|
mold
|
||||||
|
python3-clang
|
||||||
|
z3
|
||||||
|
)
|
||||||
|
sudo apt-get update ||
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install --yes "${PACKAGES[@]}" ||
|
||||||
|
sudo apt-get install --yes "${PACKAGES[@]}"
|
||||||
fi
|
fi
|
||||||
if [[ "$CI_RUNS_ON" =~ "ubuntu-22.04" ]] || [[ "$CI_RUNS_ON" =~ "ubuntu-24.04" ]] || [[ "$CI_RUNS_ON" =~ "ubuntu-26.04" ]]; then
|
elif [ "$HOST_OS" = "macOS" ]; then
|
||||||
if [[ ! "$CI_RUNS_ON" =~ "-riscv" ]]; then
|
PACKAGES=(
|
||||||
sudo apt-get install --yes libsystemc libsystemc-dev ||
|
ccache
|
||||||
sudo apt-get install --yes libsystemc libsystemc-dev
|
jq
|
||||||
fi
|
perl
|
||||||
fi
|
z3
|
||||||
elif [ "$CI_OS_NAME" = "osx" ]; then
|
)
|
||||||
|
brew update ||
|
||||||
brew update
|
brew update
|
||||||
# brew cask install gtkwave # fst2vcd hangs at launch, so don't bother
|
brew install "${PACKAGES[@]}" ||
|
||||||
brew install ccache perl jq z3
|
brew install "${PACKAGES[@]}"
|
||||||
elif [ "$CI_OS_NAME" = "freebsd" ]; then
|
|
||||||
# fst2vcd fails with "Could not open '<input file>', exiting."
|
|
||||||
sudo pkg install -y ccache gmake perl5 python3 jq z3
|
|
||||||
else
|
else
|
||||||
fatal "Unknown CI_OS_NAME: '$CI_OS_NAME'"
|
fatal "Unknown HOST_OS: '$HOST_OS'"
|
||||||
fi
|
fi
|
||||||
# Common installs
|
# Common installs
|
||||||
install-wavediff
|
install-wavediff
|
||||||
|
|
@ -146,5 +149,11 @@ elif [ "$CI_BUILD_STAGE_NAME" = "test" ]; then
|
||||||
else
|
else
|
||||||
##############################################################################
|
##############################################################################
|
||||||
# Unknown build stage
|
# Unknown build stage
|
||||||
fatal "Unknown CI_BUILD_STAGE_NAME: '$CI_BUILD_STAGE_NAME'"
|
fatal "Unknown stage '$STAGE' (expected 'build' or 'test')"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Report where the tools we may have installed live (ok if some are missing)
|
||||||
|
for bin in autoconf bear bison ccache flex gdb help2man jq lcov mold perl wavediff z3; do
|
||||||
|
echo -n "$bin "
|
||||||
|
which "$bin" || true
|
||||||
|
done
|
||||||
|
|
|
||||||
|
|
@ -1,208 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
# DESCRIPTION: Verilator: CI main job script
|
|
||||||
#
|
|
||||||
# SPDX-FileCopyrightText: 2020 Geza Lore
|
|
||||||
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
|
||||||
|
|
||||||
################################################################################
|
|
||||||
# This is the main script executed in the 'script' phase by all jobs. We use a
|
|
||||||
# single script to keep the CI setting simple. We pass job parameters via
|
|
||||||
# environment variables using 'env' keys.
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
set -e
|
|
||||||
set -x
|
|
||||||
|
|
||||||
fatal() {
|
|
||||||
echo "ERROR: $(basename "$0"): $1" >&2; exit 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if [ "$CI_OS_NAME" = "linux" ]; then
|
|
||||||
export MAKE=make
|
|
||||||
NPROC=$(nproc)
|
|
||||||
elif [ "$CI_OS_NAME" = "osx" ]; then
|
|
||||||
export MAKE=make
|
|
||||||
NPROC=$(sysctl -n hw.logicalcpu)
|
|
||||||
# Disable ccache, doesn't always work in GitHub Actions
|
|
||||||
export OBJCACHE=
|
|
||||||
elif [ "$CI_OS_NAME" = "freebsd" ]; then
|
|
||||||
export MAKE=gmake
|
|
||||||
NPROC=$(sysctl -n hw.ncpu)
|
|
||||||
else
|
|
||||||
fatal "Unknown CI_OS_NAME: '$CI_OS_NAME'"
|
|
||||||
fi
|
|
||||||
NPROC=$(expr $NPROC '+' 1)
|
|
||||||
|
|
||||||
if [ "$CI_BUILD_STAGE_NAME" = "build" ]; then
|
|
||||||
##############################################################################
|
|
||||||
# Build verilator
|
|
||||||
|
|
||||||
autoconf
|
|
||||||
CONFIGURE_ARGS="--enable-longtests --enable-ccwarn"
|
|
||||||
if [ "$CI_DEV_ASAN" = 1 ]; then
|
|
||||||
CONFIGURE_ARGS="$CONFIGURE_ARGS --enable-dev-asan"
|
|
||||||
CXX="$CXX -DVL_LEAK_CHECKS"
|
|
||||||
fi
|
|
||||||
if [ "$CI_DEV_GCOV" = 1 ]; then
|
|
||||||
CONFIGURE_ARGS="$CONFIGURE_ARGS --enable-dev-gcov"
|
|
||||||
fi
|
|
||||||
./configure $CONFIGURE_ARGS --prefix="$INSTALL_DIR"
|
|
||||||
ccache -z
|
|
||||||
"$MAKE" -j "$NPROC" -k
|
|
||||||
# 22.04: ccache -s -v
|
|
||||||
ccache -s
|
|
||||||
if [ "$CI_OS_NAME" = "osx" ]; then
|
|
||||||
file bin/verilator_bin
|
|
||||||
file bin/verilator_bin_dbg
|
|
||||||
md5 bin/verilator_bin
|
|
||||||
md5 bin/verilator_bin_dbg
|
|
||||||
stat bin/verilator_bin
|
|
||||||
stat bin/verilator_bin_dbg
|
|
||||||
fi
|
|
||||||
elif [ "$CI_BUILD_STAGE_NAME" = "test" ]; then
|
|
||||||
##############################################################################
|
|
||||||
# Run tests
|
|
||||||
|
|
||||||
export VERILATOR_TEST_NO_CONTRIBUTORS=1 # Separate workflow check
|
|
||||||
export VERILATOR_TEST_NO_LINT_PY=1 # Separate workflow check
|
|
||||||
|
|
||||||
if [ "$CI_OS_NAME" = "osx" ]; then
|
|
||||||
export VERILATOR_TEST_NO_GDB=1 # Pain to get GDB to work on OS X
|
|
||||||
# TODO below may no longer be required as configure checks for -pg
|
|
||||||
export VERILATOR_TEST_NO_GPROF=1 # Apple Clang has no -pg
|
|
||||||
# export PATH="/Applications/gtkwave.app/Contents/Resources/bin:$PATH" # fst2vcd
|
|
||||||
file bin/verilator_bin
|
|
||||||
file bin/verilator_bin_dbg
|
|
||||||
md5 bin/verilator_bin
|
|
||||||
md5 bin/verilator_bin_dbg
|
|
||||||
stat bin/verilator_bin
|
|
||||||
stat bin/verilator_bin_dbg
|
|
||||||
# For some reason, the dbg exe is corrupted by this point ('file' reports
|
|
||||||
# it as data rather than a Mach-O). Unclear if this is an OS X issue or
|
|
||||||
# CI's. Remove the file and re-link...
|
|
||||||
rm bin/verilator_bin_dbg
|
|
||||||
"$MAKE" -j "$NPROC" -k
|
|
||||||
elif [ "$CI_OS_NAME" = "freebsd" ]; then
|
|
||||||
export VERILATOR_TEST_NO_GDB=1 # Disable for now, ideally should run
|
|
||||||
# TODO below may no longer be required as configure checks for -pg
|
|
||||||
export VERILATOR_TEST_NO_GPROF=1 # gprof is a bit different on FreeBSD, disable
|
|
||||||
fi
|
|
||||||
|
|
||||||
TEST_REGRESS=test_regress
|
|
||||||
if [ "$CI_RELOC" == 1 ]; then
|
|
||||||
# Testing that the installation is relocatable.
|
|
||||||
"$MAKE" install
|
|
||||||
mkdir -p "$RELOC_DIR"
|
|
||||||
mv "$INSTALL_DIR" "$RELOC_DIR/relocated-install"
|
|
||||||
export VERILATOR_ROOT="$RELOC_DIR/relocated-install/share/verilator"
|
|
||||||
TEST_REGRESS="$RELOC_DIR/test_regress"
|
|
||||||
mv test_regress "$TEST_REGRESS"
|
|
||||||
NODIST="$RELOC_DIR/nodist"
|
|
||||||
mv nodist "$NODIST"
|
|
||||||
# Feeling brave?
|
|
||||||
find . -delete
|
|
||||||
ls -la .
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Run the specified test
|
|
||||||
ccache -z
|
|
||||||
case $TESTS in
|
|
||||||
dist-vlt-0)
|
|
||||||
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--dist --vlt --driver-clean" DRIVER_HASHSET=--hashset=0/4
|
|
||||||
;;
|
|
||||||
dist-vlt-1)
|
|
||||||
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--dist --vlt --driver-clean" DRIVER_HASHSET=--hashset=1/4
|
|
||||||
;;
|
|
||||||
dist-vlt-2)
|
|
||||||
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--dist --vlt --driver-clean" DRIVER_HASHSET=--hashset=2/4
|
|
||||||
;;
|
|
||||||
dist-vlt-3)
|
|
||||||
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--dist --vlt --driver-clean" DRIVER_HASHSET=--hashset=3/4
|
|
||||||
;;
|
|
||||||
vltmt-0)
|
|
||||||
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vltmt --driver-clean" DRIVER_HASHSET=--hashset=0/3
|
|
||||||
;;
|
|
||||||
vltmt-1)
|
|
||||||
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vltmt --driver-clean" DRIVER_HASHSET=--hashset=1/3
|
|
||||||
;;
|
|
||||||
vltmt-2)
|
|
||||||
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vltmt --driver-clean" DRIVER_HASHSET=--hashset=2/3
|
|
||||||
;;
|
|
||||||
coverage-dist)
|
|
||||||
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--dist"
|
|
||||||
;;
|
|
||||||
coverage-vlt-0)
|
|
||||||
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vlt" DRIVER_HASHSET=--hashset=0/10
|
|
||||||
;;
|
|
||||||
coverage-vlt-1)
|
|
||||||
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vlt" DRIVER_HASHSET=--hashset=1/10
|
|
||||||
;;
|
|
||||||
coverage-vlt-2)
|
|
||||||
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vlt" DRIVER_HASHSET=--hashset=2/10
|
|
||||||
;;
|
|
||||||
coverage-vlt-3)
|
|
||||||
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vlt" DRIVER_HASHSET=--hashset=3/10
|
|
||||||
;;
|
|
||||||
coverage-vlt-4)
|
|
||||||
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vlt" DRIVER_HASHSET=--hashset=4/10
|
|
||||||
;;
|
|
||||||
coverage-vlt-5)
|
|
||||||
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vlt" DRIVER_HASHSET=--hashset=5/10
|
|
||||||
;;
|
|
||||||
coverage-vlt-6)
|
|
||||||
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vlt" DRIVER_HASHSET=--hashset=6/10
|
|
||||||
;;
|
|
||||||
coverage-vlt-7)
|
|
||||||
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vlt" DRIVER_HASHSET=--hashset=7/10
|
|
||||||
;;
|
|
||||||
coverage-vlt-8)
|
|
||||||
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vlt" DRIVER_HASHSET=--hashset=8/10
|
|
||||||
;;
|
|
||||||
coverage-vlt-9)
|
|
||||||
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vlt" DRIVER_HASHSET=--hashset=9/10
|
|
||||||
;;
|
|
||||||
coverage-vltmt-0)
|
|
||||||
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vltmt" DRIVER_HASHSET=--hashset=0/10
|
|
||||||
;;
|
|
||||||
coverage-vltmt-1)
|
|
||||||
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vltmt" DRIVER_HASHSET=--hashset=1/10
|
|
||||||
;;
|
|
||||||
coverage-vltmt-2)
|
|
||||||
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vltmt" DRIVER_HASHSET=--hashset=2/10
|
|
||||||
;;
|
|
||||||
coverage-vltmt-3)
|
|
||||||
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vltmt" DRIVER_HASHSET=--hashset=3/10
|
|
||||||
;;
|
|
||||||
coverage-vltmt-4)
|
|
||||||
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vltmt" DRIVER_HASHSET=--hashset=4/10
|
|
||||||
;;
|
|
||||||
coverage-vltmt-5)
|
|
||||||
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vltmt" DRIVER_HASHSET=--hashset=5/10
|
|
||||||
;;
|
|
||||||
coverage-vltmt-6)
|
|
||||||
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vltmt" DRIVER_HASHSET=--hashset=6/10
|
|
||||||
;;
|
|
||||||
coverage-vltmt-7)
|
|
||||||
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vltmt" DRIVER_HASHSET=--hashset=7/10
|
|
||||||
;;
|
|
||||||
coverage-vltmt-8)
|
|
||||||
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vltmt" DRIVER_HASHSET=--hashset=8/10
|
|
||||||
;;
|
|
||||||
coverage-vltmt-9)
|
|
||||||
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vltmt" DRIVER_HASHSET=--hashset=9/10
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
fatal "Unknown TESTS: $TESTS"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# To see load average (1 minute, 5 minute, 15 minute)
|
|
||||||
uptime
|
|
||||||
# 22.04: ccache -s -v
|
|
||||||
ccache -s
|
|
||||||
|
|
||||||
else
|
|
||||||
##############################################################################
|
|
||||||
# Unknown build stage
|
|
||||||
fatal "Unknown CI_BUILD_STAGE_NAME: '$CI_BUILD_STAGE_NAME'"
|
|
||||||
fi
|
|
||||||
|
|
@ -0,0 +1,166 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
# DESCRIPTION: Verilator: CI test job script
|
||||||
|
#
|
||||||
|
# SPDX-FileCopyrightText: 2026 Wilson Snyder
|
||||||
|
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Executed in the 'test' stage.
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
# Destructive to the checkout (runs 'find . -delete'); never run locally
|
||||||
|
if [ "$GITHUB_ACTIONS" != "true" ]; then
|
||||||
|
echo "ERROR: $(basename "$0") must only be run in GitHub Actions CI" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
set -e
|
||||||
|
set -x
|
||||||
|
|
||||||
|
source "$(dirname "$0")/ci-common.bash"
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Parse arguments
|
||||||
|
|
||||||
|
OPT_RELOC=
|
||||||
|
OPT_SUITE=
|
||||||
|
while [ $# -gt 0 ]; do
|
||||||
|
case "$1" in
|
||||||
|
--reloc)
|
||||||
|
[ $# -ge 2 ] || fatal "--reloc requires an argument"
|
||||||
|
OPT_RELOC="$2"
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
--suite)
|
||||||
|
[ $# -ge 2 ] || fatal "--suite requires an argument"
|
||||||
|
OPT_SUITE="$2"
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
*) fatal "Unknown option: '$1'" ;;
|
||||||
|
esac
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
|
||||||
|
[ -n "$OPT_SUITE" ] || fatal "--suite is required"
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Run tests
|
||||||
|
|
||||||
|
export VERILATOR_TEST_NO_CONTRIBUTORS=1 # Separate workflow check
|
||||||
|
export VERILATOR_TEST_NO_LINT_PY=1 # Separate workflow check
|
||||||
|
|
||||||
|
if [ "$HOST_OS" = "macOS" ]; then
|
||||||
|
export VERILATOR_TEST_NO_GDB=1 # No working GDB on macOS
|
||||||
|
fi
|
||||||
|
|
||||||
|
TEST_REGRESS=test_regress
|
||||||
|
if [ -n "$OPT_RELOC" ]; then
|
||||||
|
# Testing that the installation is relocatable.
|
||||||
|
"$MAKE" install
|
||||||
|
# Install prefix, as configured into the Makefile at build time
|
||||||
|
INSTALL_DIR=$(sed -n 's/^prefix = //p' Makefile)
|
||||||
|
mkdir -p "$OPT_RELOC"
|
||||||
|
mv "$INSTALL_DIR" "$OPT_RELOC/relocated-install"
|
||||||
|
export VERILATOR_ROOT="$OPT_RELOC/relocated-install/share/verilator"
|
||||||
|
TEST_REGRESS="$OPT_RELOC/test_regress"
|
||||||
|
mv test_regress "$TEST_REGRESS"
|
||||||
|
NODIST="$OPT_RELOC/nodist"
|
||||||
|
mv nodist "$NODIST"
|
||||||
|
# Delete everything else
|
||||||
|
find . -delete
|
||||||
|
ls -la .
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Run the specified suite
|
||||||
|
ccache -z
|
||||||
|
case $OPT_SUITE in
|
||||||
|
dist-vlt-0)
|
||||||
|
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--dist --vlt --driver-clean" DRIVER_HASHSET=--hashset=0/4
|
||||||
|
;;
|
||||||
|
dist-vlt-1)
|
||||||
|
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--dist --vlt --driver-clean" DRIVER_HASHSET=--hashset=1/4
|
||||||
|
;;
|
||||||
|
dist-vlt-2)
|
||||||
|
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--dist --vlt --driver-clean" DRIVER_HASHSET=--hashset=2/4
|
||||||
|
;;
|
||||||
|
dist-vlt-3)
|
||||||
|
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--dist --vlt --driver-clean" DRIVER_HASHSET=--hashset=3/4
|
||||||
|
;;
|
||||||
|
vltmt-0)
|
||||||
|
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vltmt --driver-clean" DRIVER_HASHSET=--hashset=0/3
|
||||||
|
;;
|
||||||
|
vltmt-1)
|
||||||
|
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vltmt --driver-clean" DRIVER_HASHSET=--hashset=1/3
|
||||||
|
;;
|
||||||
|
vltmt-2)
|
||||||
|
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vltmt --driver-clean" DRIVER_HASHSET=--hashset=2/3
|
||||||
|
;;
|
||||||
|
coverage-dist)
|
||||||
|
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--dist"
|
||||||
|
;;
|
||||||
|
coverage-vlt-0)
|
||||||
|
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vlt" DRIVER_HASHSET=--hashset=0/10
|
||||||
|
;;
|
||||||
|
coverage-vlt-1)
|
||||||
|
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vlt" DRIVER_HASHSET=--hashset=1/10
|
||||||
|
;;
|
||||||
|
coverage-vlt-2)
|
||||||
|
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vlt" DRIVER_HASHSET=--hashset=2/10
|
||||||
|
;;
|
||||||
|
coverage-vlt-3)
|
||||||
|
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vlt" DRIVER_HASHSET=--hashset=3/10
|
||||||
|
;;
|
||||||
|
coverage-vlt-4)
|
||||||
|
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vlt" DRIVER_HASHSET=--hashset=4/10
|
||||||
|
;;
|
||||||
|
coverage-vlt-5)
|
||||||
|
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vlt" DRIVER_HASHSET=--hashset=5/10
|
||||||
|
;;
|
||||||
|
coverage-vlt-6)
|
||||||
|
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vlt" DRIVER_HASHSET=--hashset=6/10
|
||||||
|
;;
|
||||||
|
coverage-vlt-7)
|
||||||
|
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vlt" DRIVER_HASHSET=--hashset=7/10
|
||||||
|
;;
|
||||||
|
coverage-vlt-8)
|
||||||
|
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vlt" DRIVER_HASHSET=--hashset=8/10
|
||||||
|
;;
|
||||||
|
coverage-vlt-9)
|
||||||
|
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vlt" DRIVER_HASHSET=--hashset=9/10
|
||||||
|
;;
|
||||||
|
coverage-vltmt-0)
|
||||||
|
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vltmt" DRIVER_HASHSET=--hashset=0/10
|
||||||
|
;;
|
||||||
|
coverage-vltmt-1)
|
||||||
|
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vltmt" DRIVER_HASHSET=--hashset=1/10
|
||||||
|
;;
|
||||||
|
coverage-vltmt-2)
|
||||||
|
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vltmt" DRIVER_HASHSET=--hashset=2/10
|
||||||
|
;;
|
||||||
|
coverage-vltmt-3)
|
||||||
|
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vltmt" DRIVER_HASHSET=--hashset=3/10
|
||||||
|
;;
|
||||||
|
coverage-vltmt-4)
|
||||||
|
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vltmt" DRIVER_HASHSET=--hashset=4/10
|
||||||
|
;;
|
||||||
|
coverage-vltmt-5)
|
||||||
|
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vltmt" DRIVER_HASHSET=--hashset=5/10
|
||||||
|
;;
|
||||||
|
coverage-vltmt-6)
|
||||||
|
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vltmt" DRIVER_HASHSET=--hashset=6/10
|
||||||
|
;;
|
||||||
|
coverage-vltmt-7)
|
||||||
|
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vltmt" DRIVER_HASHSET=--hashset=7/10
|
||||||
|
;;
|
||||||
|
coverage-vltmt-8)
|
||||||
|
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vltmt" DRIVER_HASHSET=--hashset=8/10
|
||||||
|
;;
|
||||||
|
coverage-vltmt-9)
|
||||||
|
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vltmt" DRIVER_HASHSET=--hashset=9/10
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
fatal "Unknown suite: $OPT_SUITE"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
ccache -svv
|
||||||
|
uptime # To see load average
|
||||||
Loading…
Reference in New Issue