Travis: Use workspaces and per job persistent ccache (#2399)
Change the Travis builds to use workspaces and persistent ccache
We proceed in 2 stages (as before, but using workspaces for
persistence):
1. In the 'build' stage, we clone the repo, build it and
save the whole checkout ($TRAVIS_BUILD_DIR) as a workspace
2. In the 'test' stage, rather than cloning the repo, multiple jobs
pull down the same workspace we built to run the tests from
This enables:
- Reuse of the build in multiple test jobs (this is what we used the Travis
cache for before)
- Each job having a separate persistent Travis cache, which now only
contains the ccache. This means all jobs, including 'build' and 'test'
jobs can make maximum use of ccache across runs. This drastically cuts
down build times when the ccache hits, which is very often the case for
'test' jobs. Also, the separate caches only store the objects build by
the particular job that owns the cache, so we can keep the per job
ccache small.
If the commit message contains '[travis ccache clear]', the ccache will
be cleared at the beginning of the build. This can be used to test build
complete within the 50 minute timeout imposed by Travis, even without a
persistent ccache.
2020-06-03 22:10:13 +02:00
|
|
|
#!/usr/bin/env bash
|
2020-12-04 16:30:46 +01:00
|
|
|
# DESCRIPTION: Verilator: CI dependency install script
|
Travis: Use workspaces and per job persistent ccache (#2399)
Change the Travis builds to use workspaces and persistent ccache
We proceed in 2 stages (as before, but using workspaces for
persistence):
1. In the 'build' stage, we clone the repo, build it and
save the whole checkout ($TRAVIS_BUILD_DIR) as a workspace
2. In the 'test' stage, rather than cloning the repo, multiple jobs
pull down the same workspace we built to run the tests from
This enables:
- Reuse of the build in multiple test jobs (this is what we used the Travis
cache for before)
- Each job having a separate persistent Travis cache, which now only
contains the ccache. This means all jobs, including 'build' and 'test'
jobs can make maximum use of ccache across runs. This drastically cuts
down build times when the ccache hits, which is very often the case for
'test' jobs. Also, the separate caches only store the objects build by
the particular job that owns the cache, so we can keep the per job
ccache small.
If the commit message contains '[travis ccache clear]', the ccache will
be cleared at the beginning of the build. This can be used to test build
complete within the 50 minute timeout imposed by Travis, even without a
persistent ccache.
2020-06-03 22:10:13 +02:00
|
|
|
#
|
CI: Decouple build and test into separate scripts, simplify workflows (#7871)
- 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.
2026-07-05 16:46:30 +02:00
|
|
|
# SPDX-FileCopyrightText: 2026 Wilson Snyder
|
Travis: Use workspaces and per job persistent ccache (#2399)
Change the Travis builds to use workspaces and persistent ccache
We proceed in 2 stages (as before, but using workspaces for
persistence):
1. In the 'build' stage, we clone the repo, build it and
save the whole checkout ($TRAVIS_BUILD_DIR) as a workspace
2. In the 'test' stage, rather than cloning the repo, multiple jobs
pull down the same workspace we built to run the tests from
This enables:
- Reuse of the build in multiple test jobs (this is what we used the Travis
cache for before)
- Each job having a separate persistent Travis cache, which now only
contains the ccache. This means all jobs, including 'build' and 'test'
jobs can make maximum use of ccache across runs. This drastically cuts
down build times when the ccache hits, which is very often the case for
'test' jobs. Also, the separate caches only store the objects build by
the particular job that owns the cache, so we can keep the per job
ccache small.
If the commit message contains '[travis ccache clear]', the ccache will
be cleared at the beginning of the build. This can be used to test build
complete within the 50 minute timeout imposed by Travis, even without a
persistent ccache.
2020-06-03 22:10:13 +02:00
|
|
|
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
|
|
|
|
|
|
|
|
|
################################################################################
|
|
|
|
|
# This script runs in the 'install' phase of all jobs, in all stages. We try to
|
|
|
|
|
# minimize the time spent in this by selectively installing only the components
|
|
|
|
|
# required by the particular build stage.
|
|
|
|
|
################################################################################
|
|
|
|
|
|
CI: Decouple build and test into separate scripts, simplify workflows (#7871)
- 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.
2026-07-05 16:46:30 +02:00
|
|
|
# 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
|
|
|
|
|
|
Travis: Use workspaces and per job persistent ccache (#2399)
Change the Travis builds to use workspaces and persistent ccache
We proceed in 2 stages (as before, but using workspaces for
persistence):
1. In the 'build' stage, we clone the repo, build it and
save the whole checkout ($TRAVIS_BUILD_DIR) as a workspace
2. In the 'test' stage, rather than cloning the repo, multiple jobs
pull down the same workspace we built to run the tests from
This enables:
- Reuse of the build in multiple test jobs (this is what we used the Travis
cache for before)
- Each job having a separate persistent Travis cache, which now only
contains the ccache. This means all jobs, including 'build' and 'test'
jobs can make maximum use of ccache across runs. This drastically cuts
down build times when the ccache hits, which is very often the case for
'test' jobs. Also, the separate caches only store the objects build by
the particular job that owns the cache, so we can keep the per job
ccache small.
If the commit message contains '[travis ccache clear]', the ccache will
be cleared at the beginning of the build. This can be used to test build
complete within the 50 minute timeout imposed by Travis, even without a
persistent ccache.
2020-06-03 22:10:13 +02:00
|
|
|
set -e
|
|
|
|
|
set -x
|
|
|
|
|
|
2020-12-23 18:53:05 +01:00
|
|
|
cd $(dirname "$0")/..
|
|
|
|
|
|
CI: Decouple build and test into separate scripts, simplify workflows (#7871)
- 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.
2026-07-05 16:46:30 +02:00
|
|
|
source "$(dirname "$0")/ci-common.bash"
|
|
|
|
|
|
|
|
|
|
################################################################################
|
|
|
|
|
# Parse arguments
|
|
|
|
|
|
|
|
|
|
# Which stage to install dependencies for: 'build' or 'test'
|
|
|
|
|
STAGE="$1"
|
|
|
|
|
|
|
|
|
|
################################################################################
|
|
|
|
|
# Install dependencies
|
|
|
|
|
|
2022-09-08 04:49:09 +02:00
|
|
|
# Avoid occasional cpan failures "Issued certificate has expired."
|
|
|
|
|
export PERL_LWP_SSL_VERIFY_HOSTNAME=0
|
2022-09-08 17:06:44 +02:00
|
|
|
echo "check_certificate = off" >> ~/.wgetrc
|
2022-09-08 04:49:09 +02:00
|
|
|
|
CI: Decouple build and test into separate scripts, simplify workflows (#7871)
- 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.
2026-07-05 16:46:30 +02:00
|
|
|
if [ "$HOST_OS" = "linux" ]; then
|
2025-09-07 00:48:39 +02:00
|
|
|
# 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/man/*" | sudo tee -a /etc/dpkg/dpkg.cfg.d/01_nodoc
|
|
|
|
|
echo "path-exclude /usr/share/info/*" | sudo tee -a /etc/dpkg/dpkg.cfg.d/01_nodoc
|
2026-07-06 12:43:55 +02:00
|
|
|
elif [ "$HOST_OS" = "macOS" ]; then
|
|
|
|
|
# The macos runner image ships an untrusted third-party tap we don't use;
|
|
|
|
|
# untap it so brew stops emitting a tap-trust warning. Force + '|| true' since
|
|
|
|
|
# untap fails if a formula was installed from it, which is harmless here.
|
|
|
|
|
brew untap --force aws/tap || true
|
2025-09-07 00:48:39 +02:00
|
|
|
fi
|
|
|
|
|
|
2026-04-21 19:53:53 +02:00
|
|
|
install-wavediff() {
|
|
|
|
|
source ci/docker/buildenv/wavetools.conf
|
|
|
|
|
local _base_url="https://github.com/hudson-trading/wavetools/releases/download/${WAVETOOLS_VERSION}"
|
|
|
|
|
local _platform
|
CI: Decouple build and test into separate scripts, simplify workflows (#7871)
- 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.
2026-07-05 16:46:30 +02:00
|
|
|
if [ "$HOST_OS" = "linux" ]; then
|
2026-04-21 19:53:53 +02:00
|
|
|
_platform="linux-x86_64"
|
CI: Decouple build and test into separate scripts, simplify workflows (#7871)
- 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.
2026-07-05 16:46:30 +02:00
|
|
|
elif [ "$HOST_OS" = "macOS" ]; then
|
2026-04-21 19:53:53 +02:00
|
|
|
_platform="macos-arm64"
|
|
|
|
|
else
|
CI: Decouple build and test into separate scripts, simplify workflows (#7871)
- 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.
2026-07-05 16:46:30 +02:00
|
|
|
echo "WARNING: No wavetools binary available for HOST_OS=$HOST_OS, skipping"
|
2026-04-21 19:53:53 +02:00
|
|
|
return 0
|
|
|
|
|
fi
|
|
|
|
|
local _tmpdir
|
|
|
|
|
_tmpdir=$(mktemp -d)
|
|
|
|
|
local _archive="wavetools-${WAVETOOLS_VERSION}-${_platform}"
|
CI: Decouple build and test into separate scripts, simplify workflows (#7871)
- 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.
2026-07-05 16:46:30 +02:00
|
|
|
wget -q -O "${_tmpdir}/${_archive}.tar.gz" "${_base_url}/${_archive}.tar.gz"
|
|
|
|
|
tar -xzf "${_tmpdir}/${_archive}.tar.gz" -C "${_tmpdir}"
|
2026-04-21 19:53:53 +02:00
|
|
|
sudo cp "${_tmpdir}/${_archive}/wavediff" /usr/local/bin/wavediff
|
|
|
|
|
rm -rf "${_tmpdir}"
|
Travis: Use workspaces and per job persistent ccache (#2399)
Change the Travis builds to use workspaces and persistent ccache
We proceed in 2 stages (as before, but using workspaces for
persistence):
1. In the 'build' stage, we clone the repo, build it and
save the whole checkout ($TRAVIS_BUILD_DIR) as a workspace
2. In the 'test' stage, rather than cloning the repo, multiple jobs
pull down the same workspace we built to run the tests from
This enables:
- Reuse of the build in multiple test jobs (this is what we used the Travis
cache for before)
- Each job having a separate persistent Travis cache, which now only
contains the ccache. This means all jobs, including 'build' and 'test'
jobs can make maximum use of ccache across runs. This drastically cuts
down build times when the ccache hits, which is very often the case for
'test' jobs. Also, the separate caches only store the objects build by
the particular job that owns the cache, so we can keep the per job
ccache small.
If the commit message contains '[travis ccache clear]', the ccache will
be cleared at the beginning of the build. This can be used to test build
complete within the 50 minute timeout imposed by Travis, even without a
persistent ccache.
2020-06-03 22:10:13 +02:00
|
|
|
}
|
|
|
|
|
|
CI: Decouple build and test into separate scripts, simplify workflows (#7871)
- 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.
2026-07-05 16:46:30 +02:00
|
|
|
if [ "$STAGE" = "build" ]; then
|
Travis: Use workspaces and per job persistent ccache (#2399)
Change the Travis builds to use workspaces and persistent ccache
We proceed in 2 stages (as before, but using workspaces for
persistence):
1. In the 'build' stage, we clone the repo, build it and
save the whole checkout ($TRAVIS_BUILD_DIR) as a workspace
2. In the 'test' stage, rather than cloning the repo, multiple jobs
pull down the same workspace we built to run the tests from
This enables:
- Reuse of the build in multiple test jobs (this is what we used the Travis
cache for before)
- Each job having a separate persistent Travis cache, which now only
contains the ccache. This means all jobs, including 'build' and 'test'
jobs can make maximum use of ccache across runs. This drastically cuts
down build times when the ccache hits, which is very often the case for
'test' jobs. Also, the separate caches only store the objects build by
the particular job that owns the cache, so we can keep the per job
ccache small.
If the commit message contains '[travis ccache clear]', the ccache will
be cleared at the beginning of the build. This can be used to test build
complete within the 50 minute timeout imposed by Travis, even without a
persistent ccache.
2020-06-03 22:10:13 +02:00
|
|
|
##############################################################################
|
|
|
|
|
# Dependencies of jobs in the 'build' stage, i.e.: packages required to
|
|
|
|
|
# build Verilator
|
|
|
|
|
|
CI: Decouple build and test into separate scripts, simplify workflows (#7871)
- 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.
2026-07-05 16:46:30 +02:00
|
|
|
if [ "$HOST_OS" = "linux" ]; then
|
|
|
|
|
if [ "$DISTRO_ID" = "ubuntu" ]; then
|
|
|
|
|
PACKAGES=(
|
|
|
|
|
bear
|
|
|
|
|
ccache
|
|
|
|
|
help2man
|
|
|
|
|
libfl-dev
|
|
|
|
|
libsystemc-dev
|
|
|
|
|
mold
|
|
|
|
|
)
|
|
|
|
|
# libunwind conflict on 22.04, can live without libjemalloc there
|
|
|
|
|
if [ "$DISTRO_VERSION" != "22.04" ]; then
|
|
|
|
|
PACKAGES+=(libjemalloc-dev)
|
2026-03-30 23:38:52 +02:00
|
|
|
fi
|
CI: Decouple build and test into separate scripts, simplify workflows (#7871)
- 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.
2026-07-05 16:46:30 +02:00
|
|
|
sudo apt-get update ||
|
|
|
|
|
sudo apt-get update
|
|
|
|
|
sudo apt-get install --yes "${PACKAGES[@]}" ||
|
|
|
|
|
sudo apt-get install --yes "${PACKAGES[@]}"
|
2020-12-11 02:22:00 +01:00
|
|
|
fi
|
CI: Decouple build and test into separate scripts, simplify workflows (#7871)
- 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.
2026-07-05 16:46:30 +02:00
|
|
|
elif [ "$HOST_OS" = "macOS" ]; then
|
|
|
|
|
PACKAGES=(
|
|
|
|
|
autoconf
|
|
|
|
|
bison
|
|
|
|
|
ccache
|
|
|
|
|
flex
|
|
|
|
|
gperftools
|
|
|
|
|
help2man
|
|
|
|
|
perl
|
|
|
|
|
)
|
2026-01-25 16:27:52 +01:00
|
|
|
brew update ||
|
2020-06-22 11:13:54 +02:00
|
|
|
brew update
|
CI: Decouple build and test into separate scripts, simplify workflows (#7871)
- 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.
2026-07-05 16:46:30 +02:00
|
|
|
brew install "${PACKAGES[@]}" ||
|
|
|
|
|
brew install "${PACKAGES[@]}"
|
Travis: Use workspaces and per job persistent ccache (#2399)
Change the Travis builds to use workspaces and persistent ccache
We proceed in 2 stages (as before, but using workspaces for
persistence):
1. In the 'build' stage, we clone the repo, build it and
save the whole checkout ($TRAVIS_BUILD_DIR) as a workspace
2. In the 'test' stage, rather than cloning the repo, multiple jobs
pull down the same workspace we built to run the tests from
This enables:
- Reuse of the build in multiple test jobs (this is what we used the Travis
cache for before)
- Each job having a separate persistent Travis cache, which now only
contains the ccache. This means all jobs, including 'build' and 'test'
jobs can make maximum use of ccache across runs. This drastically cuts
down build times when the ccache hits, which is very often the case for
'test' jobs. Also, the separate caches only store the objects build by
the particular job that owns the cache, so we can keep the per job
ccache small.
If the commit message contains '[travis ccache clear]', the ccache will
be cleared at the beginning of the build. This can be used to test build
complete within the 50 minute timeout imposed by Travis, even without a
persistent ccache.
2020-06-03 22:10:13 +02:00
|
|
|
else
|
CI: Decouple build and test into separate scripts, simplify workflows (#7871)
- 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.
2026-07-05 16:46:30 +02:00
|
|
|
fatal "Unknown HOST_OS: '$HOST_OS'"
|
Travis: Use workspaces and per job persistent ccache (#2399)
Change the Travis builds to use workspaces and persistent ccache
We proceed in 2 stages (as before, but using workspaces for
persistence):
1. In the 'build' stage, we clone the repo, build it and
save the whole checkout ($TRAVIS_BUILD_DIR) as a workspace
2. In the 'test' stage, rather than cloning the repo, multiple jobs
pull down the same workspace we built to run the tests from
This enables:
- Reuse of the build in multiple test jobs (this is what we used the Travis
cache for before)
- Each job having a separate persistent Travis cache, which now only
contains the ccache. This means all jobs, including 'build' and 'test'
jobs can make maximum use of ccache across runs. This drastically cuts
down build times when the ccache hits, which is very often the case for
'test' jobs. Also, the separate caches only store the objects build by
the particular job that owns the cache, so we can keep the per job
ccache small.
If the commit message contains '[travis ccache clear]', the ccache will
be cleared at the beginning of the build. This can be used to test build
complete within the 50 minute timeout imposed by Travis, even without a
persistent ccache.
2020-06-03 22:10:13 +02:00
|
|
|
fi
|
CI: Decouple build and test into separate scripts, simplify workflows (#7871)
- 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.
2026-07-05 16:46:30 +02:00
|
|
|
elif [ "$STAGE" = "test" ]; then
|
Travis: Use workspaces and per job persistent ccache (#2399)
Change the Travis builds to use workspaces and persistent ccache
We proceed in 2 stages (as before, but using workspaces for
persistence):
1. In the 'build' stage, we clone the repo, build it and
save the whole checkout ($TRAVIS_BUILD_DIR) as a workspace
2. In the 'test' stage, rather than cloning the repo, multiple jobs
pull down the same workspace we built to run the tests from
This enables:
- Reuse of the build in multiple test jobs (this is what we used the Travis
cache for before)
- Each job having a separate persistent Travis cache, which now only
contains the ccache. This means all jobs, including 'build' and 'test'
jobs can make maximum use of ccache across runs. This drastically cuts
down build times when the ccache hits, which is very often the case for
'test' jobs. Also, the separate caches only store the objects build by
the particular job that owns the cache, so we can keep the per job
ccache small.
If the commit message contains '[travis ccache clear]', the ccache will
be cleared at the beginning of the build. This can be used to test build
complete within the 50 minute timeout imposed by Travis, even without a
persistent ccache.
2020-06-03 22:10:13 +02:00
|
|
|
##############################################################################
|
|
|
|
|
# Dependencies of jobs in the 'test' stage, i.e.: packages required to
|
|
|
|
|
# run the tests
|
|
|
|
|
|
CI: Decouple build and test into separate scripts, simplify workflows (#7871)
- 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.
2026-07-05 16:46:30 +02:00
|
|
|
if [ "$HOST_OS" = "linux" ]; then
|
|
|
|
|
if [ "$DISTRO_ID" = "ubuntu" ]; then
|
|
|
|
|
PACKAGES=(
|
|
|
|
|
ccache
|
|
|
|
|
gdb
|
|
|
|
|
jq
|
|
|
|
|
lcov
|
|
|
|
|
libfl-dev
|
|
|
|
|
libsystemc-dev
|
|
|
|
|
mold
|
|
|
|
|
python3-clang
|
|
|
|
|
z3
|
|
|
|
|
)
|
|
|
|
|
sudo apt-get update ||
|
|
|
|
|
sudo apt-get update
|
|
|
|
|
sudo apt-get install --yes "${PACKAGES[@]}" ||
|
|
|
|
|
sudo apt-get install --yes "${PACKAGES[@]}"
|
Travis: Use workspaces and per job persistent ccache (#2399)
Change the Travis builds to use workspaces and persistent ccache
We proceed in 2 stages (as before, but using workspaces for
persistence):
1. In the 'build' stage, we clone the repo, build it and
save the whole checkout ($TRAVIS_BUILD_DIR) as a workspace
2. In the 'test' stage, rather than cloning the repo, multiple jobs
pull down the same workspace we built to run the tests from
This enables:
- Reuse of the build in multiple test jobs (this is what we used the Travis
cache for before)
- Each job having a separate persistent Travis cache, which now only
contains the ccache. This means all jobs, including 'build' and 'test'
jobs can make maximum use of ccache across runs. This drastically cuts
down build times when the ccache hits, which is very often the case for
'test' jobs. Also, the separate caches only store the objects build by
the particular job that owns the cache, so we can keep the per job
ccache small.
If the commit message contains '[travis ccache clear]', the ccache will
be cleared at the beginning of the build. This can be used to test build
complete within the 50 minute timeout imposed by Travis, even without a
persistent ccache.
2020-06-03 22:10:13 +02:00
|
|
|
fi
|
CI: Decouple build and test into separate scripts, simplify workflows (#7871)
- 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.
2026-07-05 16:46:30 +02:00
|
|
|
elif [ "$HOST_OS" = "macOS" ]; then
|
|
|
|
|
PACKAGES=(
|
|
|
|
|
ccache
|
|
|
|
|
jq
|
|
|
|
|
perl
|
|
|
|
|
z3
|
|
|
|
|
)
|
|
|
|
|
brew update ||
|
2020-06-22 11:13:54 +02:00
|
|
|
brew update
|
CI: Decouple build and test into separate scripts, simplify workflows (#7871)
- 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.
2026-07-05 16:46:30 +02:00
|
|
|
brew install "${PACKAGES[@]}" ||
|
|
|
|
|
brew install "${PACKAGES[@]}"
|
Travis: Use workspaces and per job persistent ccache (#2399)
Change the Travis builds to use workspaces and persistent ccache
We proceed in 2 stages (as before, but using workspaces for
persistence):
1. In the 'build' stage, we clone the repo, build it and
save the whole checkout ($TRAVIS_BUILD_DIR) as a workspace
2. In the 'test' stage, rather than cloning the repo, multiple jobs
pull down the same workspace we built to run the tests from
This enables:
- Reuse of the build in multiple test jobs (this is what we used the Travis
cache for before)
- Each job having a separate persistent Travis cache, which now only
contains the ccache. This means all jobs, including 'build' and 'test'
jobs can make maximum use of ccache across runs. This drastically cuts
down build times when the ccache hits, which is very often the case for
'test' jobs. Also, the separate caches only store the objects build by
the particular job that owns the cache, so we can keep the per job
ccache small.
If the commit message contains '[travis ccache clear]', the ccache will
be cleared at the beginning of the build. This can be used to test build
complete within the 50 minute timeout imposed by Travis, even without a
persistent ccache.
2020-06-03 22:10:13 +02:00
|
|
|
else
|
CI: Decouple build and test into separate scripts, simplify workflows (#7871)
- 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.
2026-07-05 16:46:30 +02:00
|
|
|
fatal "Unknown HOST_OS: '$HOST_OS'"
|
Travis: Use workspaces and per job persistent ccache (#2399)
Change the Travis builds to use workspaces and persistent ccache
We proceed in 2 stages (as before, but using workspaces for
persistence):
1. In the 'build' stage, we clone the repo, build it and
save the whole checkout ($TRAVIS_BUILD_DIR) as a workspace
2. In the 'test' stage, rather than cloning the repo, multiple jobs
pull down the same workspace we built to run the tests from
This enables:
- Reuse of the build in multiple test jobs (this is what we used the Travis
cache for before)
- Each job having a separate persistent Travis cache, which now only
contains the ccache. This means all jobs, including 'build' and 'test'
jobs can make maximum use of ccache across runs. This drastically cuts
down build times when the ccache hits, which is very often the case for
'test' jobs. Also, the separate caches only store the objects build by
the particular job that owns the cache, so we can keep the per job
ccache small.
If the commit message contains '[travis ccache clear]', the ccache will
be cleared at the beginning of the build. This can be used to test build
complete within the 50 minute timeout imposed by Travis, even without a
persistent ccache.
2020-06-03 22:10:13 +02:00
|
|
|
fi
|
2020-08-02 14:47:09 +02:00
|
|
|
# Common installs
|
2026-04-21 19:53:53 +02:00
|
|
|
install-wavediff
|
2024-03-16 02:06:21 +01:00
|
|
|
# Workaround -fsanitize=address crash
|
|
|
|
|
sudo sysctl -w vm.mmap_rnd_bits=28
|
2026-07-06 12:27:58 +02:00
|
|
|
elif [ "$STAGE" = "lint-py" ]; then
|
|
|
|
|
# nodist/clang_check_attributes.
|
|
|
|
|
if [ "$HOST_OS" = "linux" ] && [ "$DISTRO_ID" = "ubuntu" ]; then
|
|
|
|
|
PACKAGES=(
|
|
|
|
|
python3-clang # Not run, but importers are linted
|
|
|
|
|
)
|
|
|
|
|
sudo apt-get update ||
|
|
|
|
|
sudo apt-get update
|
|
|
|
|
sudo apt-get install --yes "${PACKAGES[@]}" ||
|
|
|
|
|
sudo apt-get install --yes "${PACKAGES[@]}"
|
|
|
|
|
fi
|
Travis: Use workspaces and per job persistent ccache (#2399)
Change the Travis builds to use workspaces and persistent ccache
We proceed in 2 stages (as before, but using workspaces for
persistence):
1. In the 'build' stage, we clone the repo, build it and
save the whole checkout ($TRAVIS_BUILD_DIR) as a workspace
2. In the 'test' stage, rather than cloning the repo, multiple jobs
pull down the same workspace we built to run the tests from
This enables:
- Reuse of the build in multiple test jobs (this is what we used the Travis
cache for before)
- Each job having a separate persistent Travis cache, which now only
contains the ccache. This means all jobs, including 'build' and 'test'
jobs can make maximum use of ccache across runs. This drastically cuts
down build times when the ccache hits, which is very often the case for
'test' jobs. Also, the separate caches only store the objects build by
the particular job that owns the cache, so we can keep the per job
ccache small.
If the commit message contains '[travis ccache clear]', the ccache will
be cleared at the beginning of the build. This can be used to test build
complete within the 50 minute timeout imposed by Travis, even without a
persistent ccache.
2020-06-03 22:10:13 +02:00
|
|
|
else
|
|
|
|
|
##############################################################################
|
|
|
|
|
# Unknown build stage
|
2026-07-06 12:27:58 +02:00
|
|
|
fatal "Unknown stage '$STAGE' (expected 'build', 'test' or 'lint-py')"
|
Travis: Use workspaces and per job persistent ccache (#2399)
Change the Travis builds to use workspaces and persistent ccache
We proceed in 2 stages (as before, but using workspaces for
persistence):
1. In the 'build' stage, we clone the repo, build it and
save the whole checkout ($TRAVIS_BUILD_DIR) as a workspace
2. In the 'test' stage, rather than cloning the repo, multiple jobs
pull down the same workspace we built to run the tests from
This enables:
- Reuse of the build in multiple test jobs (this is what we used the Travis
cache for before)
- Each job having a separate persistent Travis cache, which now only
contains the ccache. This means all jobs, including 'build' and 'test'
jobs can make maximum use of ccache across runs. This drastically cuts
down build times when the ccache hits, which is very often the case for
'test' jobs. Also, the separate caches only store the objects build by
the particular job that owns the cache, so we can keep the per job
ccache small.
If the commit message contains '[travis ccache clear]', the ccache will
be cleared at the beginning of the build. This can be used to test build
complete within the 50 minute timeout imposed by Travis, even without a
persistent ccache.
2020-06-03 22:10:13 +02:00
|
|
|
fi
|
CI: Decouple build and test into separate scripts, simplify workflows (#7871)
- 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.
2026-07-05 16:46:30 +02:00
|
|
|
|
|
|
|
|
# Report where the tools we may have installed live (ok if some are missing)
|
2026-07-05 19:52:55 +02:00
|
|
|
set +x
|
|
|
|
|
echo "Tools:"
|
CI: Decouple build and test into separate scripts, simplify workflows (#7871)
- 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.
2026-07-05 16:46:30 +02:00
|
|
|
for bin in autoconf bear bison ccache flex gdb help2man jq lcov mold perl wavediff z3; do
|
2026-07-05 19:52:55 +02:00
|
|
|
echo -n " $bin: "
|
|
|
|
|
which "$bin" || echo "Not found"
|
CI: Decouple build and test into separate scripts, simplify workflows (#7871)
- 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.
2026-07-05 16:46:30 +02:00
|
|
|
done
|