-
Notifications
You must be signed in to change notification settings - Fork 594
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
new: dev: demonstrate tox/ci workflow options, cleanup build cfg
* define HAVE_STRUCT_TIMESPEC and _XKEYCHECK_H on msvc * avoid LIBSTDCXX linking (msvc only), pass build config to all steps * add optional lto support; note clang lto requires llvm-config and lld * add llvm source-based coverage build, fix uninitialzed variable * update cmake-posix workflow configure, bin path, emulate in tox * add conda devenv file and workflow => use platform compilers and Ninja * update build instructions in readme file, cleanup tox/ci files Signed-off-by: Stephen L Arnold <[email protected]>
- Loading branch information
Showing
112 changed files
with
1,374 additions
and
902 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 |
---|---|---|
@@ -1,4 +1,6 @@ | ||
on: [push] | ||
on: | ||
workflow_dispatch: | ||
push: | ||
|
||
jobs: | ||
|
||
|
@@ -9,6 +11,9 @@ jobs: | |
use_namespace: [false, true] | ||
|
||
runs-on: ${{ matrix.os }} | ||
defaults: | ||
run: | ||
shell: bash | ||
|
||
env: | ||
CMAKE_ARGS: ${{ matrix.use_namespace && '-DABC_USE_NAMESPACE=xxx' || '' }} | ||
|
@@ -20,7 +25,10 @@ jobs: | |
- name: Git Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
submodules: recursive | ||
fetch-depth: 0 | ||
|
||
- name: Update CMake | ||
uses: jwlawson/[email protected] | ||
|
||
- name: Install brew dependencies | ||
run: | | ||
|
@@ -33,16 +41,20 @@ jobs: | |
if: ${{ !contains(matrix.os, 'macos') }} | ||
|
||
- name: Configure CMake | ||
run: | | ||
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release ${CMAKE_ARGS} -B build | ||
run: > | ||
cmake -S . -B build | ||
-G Ninja | ||
${CMAKE_ARGS} | ||
-DCMAKE_BUILD_TYPE=Release | ||
-DCMAKE_INSTALL_PREFIX=./staging | ||
- name: Build CMake | ||
run: | | ||
cmake --build build | ||
- name: Test Executable | ||
run: | | ||
./build/abc -c "r i10.aig; b; ps; b; rw -l; rw -lz; b; rw -lz; b; ps; cec" | ||
./build/src/base/main/abc -c "r i10.aig; b; ps; b; rw -l; rw -lz; b; rw -lz; b; ps; cec" | ||
- name: Test Library | ||
run: | | ||
|
@@ -52,11 +64,10 @@ jobs: | |
- name: Stage Executable | ||
run: | | ||
mkdir staging | ||
cp build/abc build/libabc.a staging/ | ||
cmake --build build --target install | ||
- name: Upload pacakge artifact | ||
- name: Upload package artifact | ||
uses: actions/upload-artifact@v1 | ||
with: | ||
name: package | ||
name: package-${{ matrix.os }}-${{ matrix.use_namespace }} | ||
path: staging/ |
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
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 |
---|---|---|
|
@@ -6,6 +6,7 @@ on: | |
push: | ||
branches: | ||
- master | ||
- develop | ||
paths-ignore: | ||
- '**.md' | ||
- '**.rst' | ||
|
@@ -22,46 +23,51 @@ jobs: | |
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: [3.8] | ||
python-version: [3.9] | ||
|
||
name: [ | ||
windows-2019-cl, | ||
ubuntu-20.04-gcc, | ||
ubuntu-20.04-clang, | ||
ubuntu-18.04-gcc, | ||
macOS-10.15-gcc, | ||
macOS-10.15-clang, | ||
ubuntu-22.04-clang, | ||
macOS-11-gcc, | ||
macOS-11-clang, | ||
] | ||
|
||
include: | ||
- name: windows-2019-cl | ||
os: windows-2019 | ||
compiler: cl | ||
|
||
- name: ubuntu-20.04-gcc | ||
os: ubuntu-20.04 | ||
compiler: gcc | ||
version: "10" | ||
toxcmd: build | ||
version: "11" | ||
toxcmd: soname,tests | ||
|
||
- name: ubuntu-20.04-clang | ||
os: ubuntu-20.04 | ||
compiler: clang | ||
version: "10" | ||
toxcmd: clang | ||
|
||
- name: ubuntu-18.04-gcc | ||
os: ubuntu-18.04 | ||
compiler: gcc | ||
version: "9" | ||
toxcmd: abc,tests | ||
- name: ubuntu-22.04-clang | ||
os: ubuntu-22.04 | ||
compiler: clang | ||
version: "12" | ||
toxcmd: build | ||
|
||
- name: macOS-10.15-gcc | ||
os: macOS-10.15 | ||
- name: macOS-11-gcc | ||
os: macOS-11 | ||
compiler: gcc | ||
version: "11" | ||
toxcmd: ctest | ||
toxcmd: abc,tests | ||
|
||
- name: macOS-10.15-clang | ||
os: macOS-10.15 | ||
- name: macOS-11-clang | ||
os: macOS-11 | ||
compiler: xcode | ||
version: "12.3" | ||
toxcmd: clang | ||
version: "12.4" | ||
toxcmd: "base Xcode" | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
@@ -72,6 +78,9 @@ jobs: | |
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Update CMake | ||
uses: jwlawson/[email protected] | ||
|
||
- name: Install Tox | ||
run: | | ||
python -m pip install --upgrade pip | ||
|
@@ -82,12 +91,12 @@ jobs: | |
run: | | ||
sudo apt-get -y -qq update | ||
sudo apt-get install -y libreadline-dev ncurses-dev | ||
if [ "${{ matrix.compiler }}" = "gcc" ]; then | ||
if [ "${{ matrix.compiler }}" = gcc ]; then | ||
sudo apt-get install -y g++-${{ matrix.version }} g++-${{ matrix.version }}-multilib | ||
echo "CC=gcc-${{ matrix.version }}" >> $GITHUB_ENV | ||
echo "CXX=g++-${{ matrix.version }}" >> $GITHUB_ENV | ||
else | ||
sudo apt-get install -y clang-${{ matrix.version }} g++-multilib | ||
sudo apt-get install -y clang-${{ matrix.version }} llvm-${{ matrix.version }} lld-${{ matrix.version }} g++-multilib | ||
echo "CC=clang-${{ matrix.version }}" >> $GITHUB_ENV | ||
echo "CXX=clang++-${{ matrix.version }}" >> $GITHUB_ENV | ||
fi | ||
|
@@ -97,27 +106,59 @@ jobs: | |
env: | ||
CC: ${{ env.CC }} | ||
CXX: ${{ env.CXX }} | ||
PREFIX: ../staging | ||
run: | | ||
tox -e ${{ matrix.toxcmd }} | ||
- uses: actions/upload-artifact@v2 | ||
if: matrix.name == 'ubuntu-20.04-clang' | ||
with: | ||
name: src_coverage_data | ||
path: | | ||
build/coverage/html | ||
build/coverage/lcov.info | ||
- name: Install and setup MacOS packages | ||
if: runner.os == 'macOS' | ||
run: | | ||
if [ "${{ matrix.compiler }}" = "gcc" ]; then | ||
if [ "${{ matrix.compiler }}" = gcc ]; then | ||
brew install gcc@${{ matrix.version }} | ||
echo "CC=gcc-${{ matrix.version }}" >> $GITHUB_ENV | ||
echo "CXX=g++-${{ matrix.version }}" >> $GITHUB_ENV | ||
else | ||
ls -ls /Applications/ | ||
sudo xcode-select -switch /Applications/Xcode_${{ matrix.version }}.app | ||
echo "CC=clang-${{ matrix.version }}" >> $GITHUB_ENV | ||
echo "CXX=clang++-${{ matrix.version }}" >> $GITHUB_ENV | ||
fi | ||
- name: Build and test MacOS | ||
if: runner.os == 'macOS' | ||
run: | | ||
if [ "${{ matrix.compiler }}" = gcc ]; then | ||
CC=${{ env.CC }} CXX=${{ env.CXX }} tox -e ${{ matrix.toxcmd }} | ||
else | ||
tox -e ${{ matrix.toxcmd }} | ||
fi | ||
- name: Configure Windows | ||
if: runner.os == 'Windows' | ||
run: > | ||
cmake -S . -B build | ||
-DBUILD_SHARED_LIBS=ON | ||
-DABC_USE_NO_PTHREADS=ON | ||
-DABC_USE_NO_READLINE=ON | ||
-DCMAKE_BUILD_TYPE=Release | ||
-DCMAKE_INSTALL_PREFIX=${{ env.PREFIX }} | ||
env: | ||
CC: ${{ env.CC }} | ||
CXX: ${{ env.CXX }} | ||
CC: cl | ||
CXX: cl | ||
PREFIX: staging | ||
|
||
- name: Build Windows | ||
if: runner.os == 'Windows' | ||
run: cmake --build build --config Release -j 2 --target install | ||
|
||
- name: Test Windows | ||
if: runner.os == 'Windows' | ||
run: | | ||
tox -e ${{ matrix.toxcmd }} | ||
ctest -V -C Release --test-dir build/ | ||
ls -lh staging/ || true |
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,86 @@ | ||
name: CondaDev | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
push: | ||
branches: | ||
- master | ||
- develop | ||
|
||
jobs: | ||
build: | ||
name: abc ${{ matrix.python-version }} ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ['3.9'] | ||
use_namespace: [false, true] | ||
include: | ||
- os: 'ubuntu-22.04' | ||
generator: 'Ninja' | ||
build_type: 'Release' | ||
- os: 'ubuntu-20.04' | ||
generator: 'Ninja' | ||
build_type: 'RelWithDebInfo' | ||
- os: 'macOS-11' | ||
generator: 'Ninja' | ||
build_type: 'Release' | ||
- os: 'windows-2019' | ||
generator: 'Ninja' | ||
build_type: 'Release' | ||
extra_args: '-DABC_USE_NO_PTHREADS=ON -DABC_USE_NO_READLINE=ON' | ||
env: | ||
OS: ${{ matrix.os }} | ||
PYTHON: ${{ matrix.python-version }} | ||
PYTHONIOENCODING: utf-8 | ||
CMAKE_ARGS: ${{ matrix.use_namespace && '-DABC_USE_NAMESPACE=xxx' || '' }} | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Setup base python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.x' | ||
|
||
- name: Cache conda | ||
id: cache | ||
uses: actions/cache@v2 | ||
env: | ||
# Increase this value to reset cache if environment.devenv.yml has not changed | ||
CACHE_NUMBER: 1 | ||
with: | ||
path: ~/conda_pkgs_dir | ||
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('environment.devenv.yml') }} | ||
|
||
- uses: conda-incubator/setup-miniconda@v2 | ||
with: | ||
auto-update-conda: true | ||
python-version: ${{ matrix.python-version }} | ||
channels: conda-forge | ||
channel-priority: strict | ||
use-only-tar-bz2: true | ||
|
||
- name: Configure condadev environment | ||
shell: bash -l {0} | ||
env: | ||
PY_VER: ${{ matrix.python-version }} | ||
run: | | ||
conda config --set always_yes yes --set changeps1 no | ||
conda config --add channels conda-forge | ||
conda install conda-devenv=2.1.1 | ||
conda devenv | ||
- name: Build and test | ||
shell: bash -l {0} | ||
env: | ||
PY_VER: ${{ matrix.python-version }} | ||
run: | | ||
source activate abc-test | ||
ctest --build-generator "${{ matrix.generator }}" \ | ||
--build-and-test . build \ | ||
--build-options ${CMAKE_ARGS} ${{ matrix.extra_args }} \ | ||
-DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ | ||
--test-command ctest --rerun-failed --output-on-failure -V |
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 |
---|---|---|
|
@@ -6,6 +6,7 @@ on: | |
push: | ||
branches: | ||
- master | ||
- develop | ||
|
||
jobs: | ||
msys2-build: | ||
|
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 |
---|---|---|
|
@@ -57,5 +57,4 @@ tags | |
|
||
/arch_flags | ||
|
||
/cmake | ||
/cscope |
Oops, something went wrong.