diff options
author | Baruch Sterin <baruchs@gmail.com> | 2022-01-22 22:06:11 +0200 |
---|---|---|
committer | Baruch Sterin <baruchs@gmail.com> | 2022-01-22 22:06:11 +0200 |
commit | 5fc7e6aac5b5ae42feac13ea347c47281e350516 (patch) | |
tree | 4d39bfce2172f48bfd882269cdf6ac3c04c17129 | |
parent | 554a1693ac2bd81169b28227ea718527136f5e7e (diff) | |
download | abc-5fc7e6aac5b5ae42feac13ea347c47281e350516.tar.gz abc-5fc7e6aac5b5ae42feac13ea347c47281e350516.tar.bz2 abc-5fc7e6aac5b5ae42feac13ea347c47281e350516.zip |
Build CMake on GitHub Actions
-rw-r--r-- | .github/disabled-workflows/build-posix.yml (renamed from .github/workflows/build-posix.yml) | 0 | ||||
-rw-r--r-- | .github/disabled-workflows/build-windows.yml (renamed from .github/workflows/build-windows.yml) | 0 | ||||
-rw-r--r-- | .github/workflows/build-posix-cmake.yml | 62 |
3 files changed, 62 insertions, 0 deletions
diff --git a/.github/workflows/build-posix.yml b/.github/disabled-workflows/build-posix.yml index aa97aca2..aa97aca2 100644 --- a/.github/workflows/build-posix.yml +++ b/.github/disabled-workflows/build-posix.yml diff --git a/.github/workflows/build-windows.yml b/.github/disabled-workflows/build-windows.yml index 6312780d..6312780d 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/disabled-workflows/build-windows.yml diff --git a/.github/workflows/build-posix-cmake.yml b/.github/workflows/build-posix-cmake.yml new file mode 100644 index 00000000..86a4d0f9 --- /dev/null +++ b/.github/workflows/build-posix-cmake.yml @@ -0,0 +1,62 @@ +on: [push] + +jobs: + + build-posix: + strategy: + matrix: + os: [macos-latest, ubuntu-latest] + use_namespace: [false, true] + + runs-on: ${{ matrix.os }} + + env: + MAKE_ARGS: ${{ matrix.use_namespace && '-DABC_USE_NAMESPACE=ON' || '' }} + DEMO_ARGS: ${{ matrix.use_namespace && '-DABC_NAMESPACE=xxx' || '' }} + DEMO_GCC: ${{ matrix.use_namespace && 'g++ -x c++' || 'gcc' }} + + steps: + + - name: Git Checkout + uses: actions/checkout@v2 + with: + submodules: recursive + + - name: Install brew dependencies + run: | + HOMEBREW_NO_AUTO_UPDATE=1 brew install readline + if: ${{ contains(matrix.os, 'macos') }} + + - name: Install APT dependencies + run: | + sudo apt install -y libreadline-dev + if: ${{ !contains(matrix.os, 'macos') }} + + - name: Configure CMake + run: | + cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -B build + + - 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" + + - name: Test Library + run: | + ${DEMO_GCC} ${DEMO_ARGS} -Wall -c src/demo.c -o demo.o + g++ -o demo demo.o build/libabc.a -lm -ldl -lreadline -lpthread + ./demo i10.aig + + - name: Stage Executable + run: | + mkdir staging + cp abc libabc.a staging/ + + - name: Upload pacakge artifact + uses: actions/upload-artifact@v1 + with: + name: package + path: staging/ |