-
Notifications
You must be signed in to change notification settings - Fork 3
140 lines (121 loc) · 3.63 KB
/
build.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
# https://docs.github.com/en/actions/learn-github-actions/contexts
---
name: dbclib
on:
push:
branches:
- main
pull_request:
page_build:
workflow_dispatch:
env:
IS_RELEASE: ${{ github.event_name == 'push' && github.ref_type == 'tag' && startswith(github.ref_name, 'v') }}
jobs:
build:
runs-on: ${{ matrix.env.os }}
strategy:
fail-fast: false
matrix:
env:
- name: linux
os: ubuntu-latest
ninja_platform: linux
cmake_env: {}
# - name: macos
# os: macos-12
# ninja_platform: mac
# cmake_env:
# CC: clang
# CXX: clang++
# pack: 1
#
# - name: win64
# os: windows-latest
# ninja_platform: win
# msvc_arch: x64
# cmake_env:
# CMAKE_RC_FLAGS: "/C 1252"
# CC: clang
# CXX: clang++
# pack: 1
#
# - name: win32
# os: windows-latest
# ninja_platform: win
# msvc_arch: x86
# cmake_env:
# CMAKE_RC_FLAGS: "/C 1252"
# CC: clang
# CXX: clang++
# CMAKE_C_FLAGS: -m32
# CMAKE_CXX_FLAGS: -m32
# pack: 1
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install Ninja
uses: seanmiddleditch/gha-setup-ninja@v3
with:
version: 1.9.0
platform: ${{ matrix.env.ninja_platform }}
destination: ninja
- name: Setup linux environment
if: matrix.env.ninja_platform == 'linux'
run: |
sudo apt-get update
# flex-old contains FlexLexer.h which is needed by util
# For some reason, flex does not contain this header
sudo apt-get install --yes git cmake libboost-all-dev expat zlib1g libfl-dev
- name: Setup MSVC environment
if: matrix.env.ninja_platform == 'win'
uses: seanmiddleditch/gha-setup-vsdevenv@v3
with:
arch: ${{ matrix.env.msvc_arch }}
- name: Build expat
if: matrix.env.ninja_platform == 'mac'
run: |
# https://macappstore.org/expat/
curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
brew install expat
- name: Install llvm
if: matrix.env.ninja_platform == 'mac'
run: brew install llvm
# https://stackoverflow.com/questions/23749530/brew-install-zlib-devel-on-mac-os-x-mavericks
- name: zlib
if: matrix.env.ninja_platform == 'mac'
run: |
wget https://www.zlib.net/zlib-1.2.12.tar.xz
tar -xvf zlib-1.2.12.tar.xz
cd zlib-1.2.12
./configure
make
make install
- name: Build Information
run: |
echo "ninja version: $(ninja --version)"
cmake --version
- name: Configure Release
env: ${{ matrix.env.cmake_env }}
run: |
mkdir -p build/release
cd build/release
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release ${{ env.CMAKE_FLAGS }} ${{ matrix.env.cmake_flags }} ../..
- name: Build
run: |
cd build/release
ninja
# install for testing
- name: Install
run: |
cd build/release
sudo cmake --install .
# test if cmake finds the dbcLib automatically
- name: TestInstall
run: |
cd test/TestdbclibCMake
mkdir -p build
cd build
cmake -G Ninja ..
ninja
...