-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor CI: add clang, ubsan, asan, macos, windows (#85)
* Add clang build to CI * Refactor CI flow, add clang builds * add asan, ubsan and regression CI flows * make SystemC source code location configurable * add macos build add macos build * replace nproc * add macos ubsan, asan and regression * add windows build * fix cmake install * prettier names
- Loading branch information
Showing
7 changed files
with
312 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: asan | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
ubuntu: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
version: [20.04, 22.04] | ||
platform: [linux/amd64, linux/arm64] | ||
target: [clang-shared-regression-asan] | ||
steps: | ||
- name: Install qemu-user-static | ||
run: | | ||
if [[ "${{ matrix.platform }}" == "linux/arm64" ]]; then | ||
sudo apt-get update && sudo apt-get install -y qemu-user-static | ||
fi | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Build | ||
run: | | ||
docker buildx build --platform ${{ matrix.platform }} -t systemc_test --build-arg UBUNTU_VERSION=${{ matrix.version }} -f docker/ubuntu.dockerfile . | ||
docker run -e SYSTEMC_CI_TARGET=${{ matrix.target }} systemc_test | ||
almalinux: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
version: [8, 9] | ||
platform: [linux/amd64, linux/arm64] | ||
target: [clang-shared-regression-asan] | ||
steps: | ||
- name: Install qemu-user-static | ||
run: | | ||
if [[ "${{ matrix.platform }}" == "linux/arm64" ]]; then | ||
sudo apt-get update && sudo apt-get install -y qemu-user-static | ||
fi | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Build | ||
run: | | ||
docker buildx build --platform ${{ matrix.platform }} -t systemc_test --build-arg ALMA_VERSION=${{ matrix.version }} -f docker/alma.dockerfile . | ||
docker run -e SYSTEMC_CI_TARGET=${{ matrix.target }} systemc_test | ||
macos: | ||
runs-on: macos-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
target: [clang-shared-regression-asan] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Build | ||
run: | | ||
SYSTEMC_CI_TARGET=${{ matrix.target }} SYSTEMC_SRC_PATH=$PWD docker/entrypoint.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
name: regressions | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
ubuntu: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
version: [20.04, 22.04] | ||
platform: [linux/amd64, linux/arm64] | ||
target: [gcc-shared-regression, clang-shared-regression] | ||
steps: | ||
- name: Install qemu-user-static | ||
run: | | ||
if [[ "${{ matrix.platform }}" == "linux/arm64" ]]; then | ||
sudo apt-get update && sudo apt-get install -y qemu-user-static | ||
fi | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Build | ||
run: | | ||
docker buildx build --platform ${{ matrix.platform }} -t systemc_test --build-arg UBUNTU_VERSION=${{ matrix.version }} -f docker/ubuntu.dockerfile . | ||
docker run -e SYSTEMC_CI_TARGET=${{ matrix.target }} systemc_test | ||
almalinux: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
version: [8, 9] | ||
platform: [linux/amd64, linux/arm64] | ||
target: [gcc-shared-regression, clang-shared-regression] | ||
steps: | ||
- name: Install qemu-user-static | ||
run: | | ||
if [[ "${{ matrix.platform }}" == "linux/arm64" ]]; then | ||
sudo apt-get update && sudo apt-get install -y qemu-user-static | ||
fi | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Build | ||
run: | | ||
docker buildx build --platform ${{ matrix.platform }} -t systemc_test --build-arg ALMA_VERSION=${{ matrix.version }} -f docker/alma.dockerfile . | ||
docker run -e SYSTEMC_CI_TARGET=${{ matrix.target }} systemc_test | ||
macos: | ||
runs-on: macos-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
target: [clang-shared-regression] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Build | ||
run: | | ||
SYSTEMC_CI_TARGET=${{ matrix.target }} SYSTEMC_SRC_PATH=$PWD docker/entrypoint.sh | ||
windows: | ||
runs-on: windows-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Build | ||
run: | | ||
cmake -B BUILD/RELEASE/BUILD -DENABLE_REGRESSION=true . | ||
cmake --build BUILD/RELEASE/BUILD --config RELEASE --parallel | ||
cmake --install BUILD/RELEASE/BUILD --config RELEASE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: ubsan | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
ubuntu: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
version: [20.04, 22.04] | ||
platform: [linux/amd64, linux/arm64] | ||
target: [clang-shared-regression-ubsan] | ||
steps: | ||
- name: Install qemu-user-static | ||
run: | | ||
if [[ "${{ matrix.platform }}" == "linux/arm64" ]]; then | ||
sudo apt-get update && sudo apt-get install -y qemu-user-static | ||
fi | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Build | ||
run: | | ||
docker buildx build --platform ${{ matrix.platform }} -t systemc_test --build-arg UBUNTU_VERSION=${{ matrix.version }} -f docker/ubuntu.dockerfile . | ||
docker run -e SYSTEMC_CI_TARGET=${{ matrix.target }} systemc_test | ||
almalinux: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
version: [8, 9] | ||
platform: [linux/amd64, linux/arm64] | ||
target: [clang-shared-regression-ubsan] | ||
steps: | ||
- name: Install qemu-user-static | ||
run: | | ||
if [[ "${{ matrix.platform }}" == "linux/arm64" ]]; then | ||
sudo apt-get update && sudo apt-get install -y qemu-user-static | ||
fi | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Build | ||
run: | | ||
docker buildx build --platform ${{ matrix.platform }} -t systemc_test --build-arg ALMA_VERSION=${{ matrix.version }} -f docker/alma.dockerfile . | ||
docker run -e SYSTEMC_CI_TARGET=${{ matrix.target }} systemc_test | ||
macos: | ||
runs-on: macos-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
target: [clang-shared-regression-ubsan] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Build | ||
run: | | ||
SYSTEMC_CI_TARGET=${{ matrix.target }} SYSTEMC_SRC_PATH=$PWD docker/entrypoint.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
#!/bin/bash | ||
set -euxo pipefail | ||
|
||
if [[ -z "${SYSTEMC_CI_TARGET}" ]]; then | ||
echo "SYSTEMC_CI_TARGET environment variable needs to be set" | ||
exit 1 | ||
fi | ||
|
||
: ${SYSTEMC_SRC_PATH:="/app"} | ||
|
||
# Build with -Werror by default | ||
CXX_FLAGS="-Werror" | ||
|
||
case "$SYSTEMC_CI_TARGET" in | ||
gcc-shared) | ||
CC=gcc | ||
CXX=g++ | ||
BUILD_SHARED_LIBRARY=true | ||
BUILD_REGRESSIONS=false | ||
;; | ||
gcc-static) | ||
CC=gcc | ||
CXX=g++ | ||
BUILD_SHARED_LIBRARY=false | ||
BUILD_REGRESSIONS=false | ||
;; | ||
gcc-shared-regression) | ||
CC=gcc | ||
CXX=g++ | ||
BUILD_SHARED_LIBRARY=true | ||
BUILD_REGRESSIONS=true | ||
;; | ||
clang-shared) | ||
CC=clang | ||
CXX=clang++ | ||
BUILD_SHARED_LIBRARY=true | ||
BUILD_REGRESSIONS=false | ||
;; | ||
clang-static) | ||
CC=clang | ||
CXX=clang++ | ||
BUILD_SHARED_LIBRARY=false | ||
BUILD_REGRESSIONS=false | ||
;; | ||
clang-shared-regression) | ||
CC=clang | ||
CXX=clang++ | ||
BUILD_SHARED_LIBRARY=true | ||
BUILD_REGRESSIONS=true | ||
;; | ||
clang-shared-regression-asan) | ||
CC=clang | ||
CXX=clang++ | ||
BUILD_SHARED_LIBRARY=true | ||
BUILD_REGRESSIONS=true | ||
CXX_FLAGS="$CXX_FLAGS -fsanitize=address" | ||
;; | ||
clang-shared-regression-ubsan) | ||
CC=clang | ||
CXX=clang++ | ||
BUILD_SHARED_LIBRARY=true | ||
BUILD_REGRESSIONS=true | ||
CXX_FLAGS="$CXX_FLAGS -fsanitize=undefined" | ||
;; | ||
*) | ||
echo "Error: Unknown SYSTEMC_CI_TARGET '$SYSTEMC_CI_TARGET'" | ||
exit 1 | ||
;; | ||
esac | ||
|
||
cd $SYSTEMC_SRC_PATH | ||
cmake -B BUILD/RELEASE-${SYSTEMC_CI_TARGET}/BUILD \ | ||
-DCMAKE_INSTALL_PREFIX=${SYSTEMC_SRC_PATH}/BUILD/${SYSTEMC_CI_TARGET} \ | ||
-DCMAKE_CXX_FLAGS="$CXX_FLAGS" \ | ||
-DCMAKE_C_COMPILER=$CC \ | ||
-DCMAKE_CXX_COMPILER=$CXX \ | ||
-DENABLE_REGRESSION=$BUILD_REGRESSIONS \ | ||
-DBUILD_SHARED_LIBS=$BUILD_SHARED_LIBRARY . | ||
cmake --build BUILD/RELEASE-${SYSTEMC_CI_TARGET}/BUILD/ --parallel | ||
cmake --install BUILD/RELEASE-${SYSTEMC_CI_TARGET}/BUILD/ | ||
make -j `getconf _NPROCESSORS_ONLN` -C BUILD/RELEASE-${SYSTEMC_CI_TARGET}/BUILD/ check | ||
|
||
exit 0 |
Oops, something went wrong.