CI: Add -m32 build

This commit is contained in:
Geza Lore 2021-06-13 20:38:24 +01:00
parent 24b5215cf9
commit 208f1504fb
4 changed files with 51 additions and 42 deletions

View File

@ -25,43 +25,34 @@ defaults:
jobs: jobs:
build:
Matrix:
runs-on: ubuntu-latest
name: Generate Build matrix
outputs:
matrix: ${{ steps.generate.outputs.matrix }}
steps:
- id: generate
working-directory: ${{ github.workspace }}
run: |
if [ '${{ github.event_name }}' = 'pull_request' ]; then
matrix='[ "ubuntu-20.04" ]'
else
matrix='[ "ubuntu-20.04", "ubuntu-18.04", "ubuntu-16.04" ]'
fi
echo "::set-output name=matrix::$matrix"
Build:
needs: Matrix
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
os: ${{ fromJson(needs.Matrix.outputs.matrix) }} os: [ubuntu-20.04, ubuntu-18.04, ubuntu-16.04]
compiler: compiler:
- { cc: clang, cxx: clang++ } - { cc: clang, cxx: clang++ }
- { cc: gcc, cxx: g++ } - { cc: gcc, cxx: g++ }
m32: [0, 1]
exclude:
# Build pull requests only with ubuntu-20.04 and without m32
- os: ${{ github.event_name == 'pull_request' && 'ubuntu-18.04' || 'do-not-exclude' }}
- os: ${{ github.event_name == 'pull_request' && 'ubuntu-16.04' || 'do-not-exclude' }}
- m32: ${{ github.event_name == 'pull_request' && 1 || 'do-not-exclude' }}
# Build -m32 only on ubuntu-20.04
- {os: ubuntu-18.04, m32: 1}
- {os: ubuntu-16.04, m32: 1}
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
name: Build | ${{ matrix.os }} | ${{ matrix.compiler.cc }} name: Build | ${{ matrix.os }} | ${{ matrix.compiler.cc }} ${{ matrix.m32 && '| -m32' || '' }}
env: env:
CI_BUILD_STAGE_NAME: build CI_BUILD_STAGE_NAME: build
CI_RUNS_ON: ${{ matrix.os }} CI_RUNS_ON: ${{ matrix.os }}
CI_M32: ${{ matrix.m32 }}
CC: ${{ matrix.compiler.cc }} CC: ${{ matrix.compiler.cc }}
CXX: ${{ matrix.compiler.cxx }} CXX: ${{ matrix.compiler.cxx }}
CACHE_BASE_KEY: build-${{ matrix.os }}-${{ matrix.compiler.cc }} CACHE_BASE_KEY: build-${{ matrix.os }}-${{ matrix.compiler.cc }}-m32=${{ matrix.m32 }}
CCACHE_MAXSIZE: 250M # Per build matrix entry (1500M in total) CCACHE_MAXSIZE: 250M # Per build matrix entry (2000M in total)
VERILATOR_ARCHIVE: verilator-${{ github.sha }}-${{ matrix.os }}-${{ matrix.compiler.cc }}.tar.gz VERILATOR_ARCHIVE: verilator-${{ github.sha }}-${{ matrix.os }}-${{ matrix.compiler.cc }}${{ matrix.m32 && '-m32' || '' }}.tar.gz
steps: steps:
- name: Checkout - name: Checkout
@ -96,31 +87,36 @@ jobs:
name: ${{ env.VERILATOR_ARCHIVE }} name: ${{ env.VERILATOR_ARCHIVE }}
Test: test:
needs: [ Matrix, Build ] needs: build
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
os: ${{ fromJson(needs.Matrix.outputs.matrix) }} os: [ubuntu-20.04, ubuntu-18.04, ubuntu-16.04]
compiler: compiler:
- { cc: clang, cxx: clang++ } - { cc: clang, cxx: clang++ }
- { cc: gcc, cxx: g++ } - { cc: gcc, cxx: g++ }
suite: m32: [0, 1]
- dist-vlt-0 suite: [dist-vlt-0, dist-vlt-1, dist-vlt-2, vltmt-0, vltmt-1]
- dist-vlt-1 exclude:
- dist-vlt-2 # Build pull requests only with ubuntu-20.04 and without m32
- vltmt-0 - os: ${{ github.event_name == 'pull_request' && 'ubuntu-18.04' || 'do-not-exclude' }}
- vltmt-1 - os: ${{ github.event_name == 'pull_request' && 'ubuntu-16.04' || 'do-not-exclude' }}
- m32: ${{ github.event_name == 'pull_request' && 1 || 'do-not-exclude' }}
# Build -m32 only on ubuntu-20.04
- {os: ubuntu-18.04, m32: 1}
- {os: ubuntu-16.04, m32: 1}
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
name: Test | ${{ matrix.os }} | ${{ matrix.compiler.cc }} | ${{ matrix.suite }} name: Test | ${{ matrix.os }} | ${{ matrix.compiler.cc }} | ${{ matrix.suite }} ${{ matrix.m32 && '| -m32' || '' }}
env: env:
CI_BUILD_STAGE_NAME: test CI_BUILD_STAGE_NAME: test
CI_RUNS_ON: ${{ matrix.os }} CI_RUNS_ON: ${{ matrix.os }}
CI_M32: ${{ matrix.m32 }}
CC: ${{ matrix.compiler.cc }} CC: ${{ matrix.compiler.cc }}
CXX: ${{ matrix.compiler.cxx }} CXX: ${{ matrix.compiler.cxx }}
CACHE_BASE_KEY: test-${{ matrix.os }}-${{ matrix.compiler.cc }}-${{ matrix.suite }} CACHE_BASE_KEY: test-${{ matrix.os }}-${{ matrix.compiler.cc }}-m32=${{ matrix.m32 }}-${ matrix.suite }}
CCACHE_MAXSIZE: 64M # Per build matrix entry (1920M in total) CCACHE_MAXSIZE: 64M # Per build matrix entry (2160M in total)
VERILATOR_ARCHIVE: verilator-${{ github.sha }}-${{ matrix.os }}-${{ matrix.compiler.cc }}.tar.gz VERILATOR_ARCHIVE: verilator-${{ github.sha }}-${{ matrix.os }}-${{ matrix.compiler.cc }}${{ matrix.m32 && '-m32' || '' }}.tar.gz
steps: steps:
- name: Download tar archive - name: Download tar archive

View File

@ -16,6 +16,7 @@ jobs:
CI_OS_NAME: linux CI_OS_NAME: linux
CI_RUNS_ON: ubuntu-20.04 CI_RUNS_ON: ubuntu-20.04
CI_COMMIT: ${{ github.sha }} CI_COMMIT: ${{ github.sha }}
CI_M32: 0
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v2

View File

@ -23,6 +23,12 @@ fatal() {
echo "ERROR: $(basename "$0"): $1" >&2; exit 1; echo "ERROR: $(basename "$0"): $1" >&2; exit 1;
} }
if [ "$CI_M32" = "0" ]; then
unset CI_M32
elif [ "$CI_M32" != "1" ]; then
fatal "\$CI_M32 must be '0' or '1'";
fi
if [ "$CI_OS_NAME" = "linux" ]; then if [ "$CI_OS_NAME" = "linux" ]; then
MAKE=make MAKE=make
elif [ "$CI_OS_NAME" = "osx" ]; then elif [ "$CI_OS_NAME" = "osx" ]; then
@ -55,7 +61,7 @@ if [ "$CI_BUILD_STAGE_NAME" = "build" ]; then
if [ "$COVERAGE" = 1 ]; then if [ "$COVERAGE" = 1 ]; then
yes yes | sudo cpan -fi Parallel::Forker yes yes | sudo cpan -fi Parallel::Forker
fi fi
if [ "$M32" = 1 ]; then if [ "$CI_M32" = 1 ]; then
sudo apt-get install gcc-multilib g++-multilib sudo apt-get install gcc-multilib g++-multilib
fi fi
elif [ "$CI_OS_NAME" = "osx" ]; then elif [ "$CI_OS_NAME" = "osx" ]; then
@ -82,7 +88,7 @@ elif [ "$CI_BUILD_STAGE_NAME" = "test" ]; then
if [ "$CI_RUNS_ON" = "ubuntu-20.04" ]; then if [ "$CI_RUNS_ON" = "ubuntu-20.04" ]; then
sudo apt-get install libsystemc-dev sudo apt-get install libsystemc-dev
fi fi
if [ "$M32" = 1 ]; then if [ "$CI_M32" = 1 ]; then
sudo apt-get install lib32z1-dev gcc-multilib g++-multilib sudo apt-get install lib32z1-dev gcc-multilib g++-multilib
fi fi
elif [ "$CI_OS_NAME" = "osx" ]; then elif [ "$CI_OS_NAME" = "osx" ]; then

View File

@ -21,6 +21,12 @@ fatal() {
echo "ERROR: $(basename "$0"): $1" >&2; exit 1; echo "ERROR: $(basename "$0"): $1" >&2; exit 1;
} }
if [ "$CI_M32" = "0" ]; then
unset CI_M32
elif [ "$CI_M32" != "1" ]; then
fatal "\$CI_M32 must be '0' or '1'";
fi
if [ "$CI_OS_NAME" = "linux" ]; then if [ "$CI_OS_NAME" = "linux" ]; then
export MAKE=make export MAKE=make
NPROC=$(nproc) NPROC=$(nproc)
@ -40,7 +46,7 @@ if [ "$CI_BUILD_STAGE_NAME" = "build" ]; then
if [ "$COVERAGE" != 1 ]; then if [ "$COVERAGE" != 1 ]; then
autoconf autoconf
./configure --enable-longtests --enable-ccwarn ./configure --enable-longtests --enable-ccwarn ${CI_M32:+--enable-m32}
ccache -z ccache -z
"$MAKE" -j "$NPROC" -k "$MAKE" -j "$NPROC" -k
ccache -s ccache -s
@ -82,7 +88,7 @@ elif [ "$CI_BUILD_STAGE_NAME" = "test" ]; then
fi fi
# Run sanitize on Ubuntu 20.04 only # Run sanitize on Ubuntu 20.04 only
[ "$CI_RUNS_ON" = 'ubuntu-20.04' ] && sanitize='--sanitize' || sanitize='' [ "$CI_RUNS_ON" = 'ubuntu-20.04' ] && [ "$CI_M32" = "" ] && sanitize='--sanitize' || sanitize=''
# Run the specified test # Run the specified test
ccache -z ccache -z