-
Notifications
You must be signed in to change notification settings - Fork 592
70 lines (54 loc) · 1.71 KB
/
build-posix-cmake.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: Build Posix CMake
on:
push:
pull_request:
jobs:
build-posix-cmake:
strategy:
matrix:
os: [macos-latest, ubuntu-latest]
use_namespace: [false, true]
runs-on: ${{ matrix.os }}
env:
CMAKE_ARGS: ${{ matrix.use_namespace && '-DABC_USE_NAMESPACE=xxx' || '' }}
DEMO_ARGS: ${{ matrix.use_namespace && '-DABC_NAMESPACE=xxx' || '' }}
DEMO_GCC: ${{ matrix.use_namespace && 'g++ -x c++' || 'gcc' }}
steps:
- name: Git Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install brew dependencies
run: |
HOMEBREW_NO_AUTO_UPDATE=1 brew install readline ninja
if: ${{ contains(matrix.os, 'macos') }}
- name: Install APT dependencies
run: |
sudo apt install -y libreadline-dev ninja-build
if: ${{ !contains(matrix.os, 'macos') }}
- name: Configure CMake
run: |
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release ${CMAKE_ARGS} -B build
- name: Build CMake
run: |
cmake --build build
- name: Run Unit Tests
run: |
ctest --output-on-failure
- 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 build/abc build/libabc.a staging/
- name: Upload pacakge artifact
uses: actions/upload-artifact@v4
with:
name: package-cmake-${{ matrix.os }}-${{ matrix.use_namespace }}
path: staging/