-
-
Notifications
You must be signed in to change notification settings - Fork 330
206 lines (202 loc) · 6.8 KB
/
c-cpp.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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
name: ci-build
on:
push:
branches: [ master ]
paths-ignore:
- docs
- README.md
- NEWS.md
pull_request:
types: [opened, synchronize, edited, ready_for_review]
branches: [ master ]
jobs:
coverage:
if: false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Update apt
run: sudo apt-get update
- name: Install packages
run: sudo apt-get install libncursesw5-dev libsqlite3-dev libbz2-dev libcurl4-openssl-dev libreadline-dev zlib1g-dev lcov libunistring-dev
- name: install cpp-coveralls
run: pip install --user cpp-coveralls
- name: autogen
run: ./autogen.sh
- name: configure
run: ./configure --disable-static --enable-code-coverage --enable-debug --prefix=/usr/local CFLAGS=-g3 CXXFLAGS=-g3
- name: make
run: make -j3
- name: make check
run: env TEST_GIT_INSTALL=1 make check || (test -e src/tailer/test-suite.log && cat src/tailer/test-suite.log && false) || (test -e test/test-suite.log && cat test/test-suite.log && false)
- name: upload cover
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
TRAVIS_JOB_ID: ${{ github.run_id }}-${{ github.run_number }}
run: >-
coveralls
--exclude src/doctest.hh
--exclude src/fmtlib
--exclude src/ghc
--exclude src/k_merge_tree.h
--exclude src/mapbox
--exclude src/pugixml
--exclude src/base/result.h
--exclude src/safe
--exclude src/spookyhash
--exclude src/tailer/drive_tailer.cc
--exclude src/third-party
--exclude src/ww898
--exclude src/yajl
--exclude src/yajlpp/drive_json_op.cc
--exclude src/yajlpp/drive_json_ptr_walk.cc
--exclude src/yajlpp/test_yajlpp.cc
--exclude src/yajlpp/test_json_ptr.cc
--exclude test
--exclude src/data_scanner_re.cc
--gcov-options '\-lp'
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Update apt
run: sudo apt-get update
- name: Install packages
run: >-
sudo apt-get install -y
make
automake
autoconf
g++
libpcre2-dev
libncurses-dev
libsqlite3-dev
libbz2-dev
libcurl4-openssl-dev
libreadline-dev
libunistring-dev
pipx
tshark
zlib1g-dev
- name: Install python packages
run: pipx install check-jsonschema
- name: ulimit
run: ulimit -s
- name: autogen
run: ./autogen.sh
- name: configure
run: ./configure --disable-static
- name: make
run: make -j4
- name: make distcheck
run: make distcheck -j4 || (test -e lnav-*/_build/sub/src/tailer/test-suite.log && cat lnav-*/_build/sub/src/tailer/test-suite.log && false) || (test -e lnav-*/_build/sub/test/test-suite.log && cat lnav-*/_build/sub/test/test-suite.log && false)
- name: Upload a Build Artifact
uses: actions/upload-artifact@v4
with:
# Artifact name
name: lnav-tot-linux-64bit.zip
# A file, directory or wildcard pattern that describes what to upload
path: src/lnav
build-windows:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
include:
- { icon: '🟦', sys: MSYS }
name: ${{ matrix.icon }} ${{ matrix.sys }}
defaults:
run:
shell: msys2 {0}
steps:
- name: '🧰 Checkout'
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: '${{ matrix.icon }} Setup MSYS2'
uses: msys2/setup-msys2@v2
with:
msystem: ${{matrix.sys}}
update: true
install: >-
autoconf
automake
gcc
git
make
zip
msys/libarchive-devel
msys/libbz2-devel
msys/libcurl-devel
msys/libidn2-devel
msys/liblzma-devel
msys/libreadline-devel
msys/libsqlite-devel
msys/libunistring-devel
msys/ncurses-devel
msys/pcre2-devel
msys/zlib-devel
- name: '🔧 Generate and configure'
run: |
set -x
./autogen.sh
mkdir -p ../lnav-build
cd ../lnav-build
export PREFIX=$PWD/lnav
../lnav/configure \
--enable-static \
LDFLAGS="-static" \
CPPFLAGS="-I../src -I../../lnav/src -I../../lnav/src/fmtlib -O2 -DNCURSES_STATIC" \
CXXFLAGS="-fPIC" \
CFLAGS="-fPIC" \
LIBS="-larchive -lssh2 -llzma -llz4 -lz -lzstd -lssl -lcrypto -liconv -lunistring -lbrotlicommon -lcrypt32" \
--sysconfdir=/etc \
--prefix=$PREFIX || cat config.log
- name: '🚧 Make (do not use -j)'
run: |
set -x
cd ../lnav-build
make CFLAGS="-c"
strip -s src/lnav.exe
- name: '📦 Package for distribution'
run: |
set -x
cd ../lnav-build
export PREFIX=$PWD/lnav
make install
ldd $PREFIX/bin/lnav.exe | grep /usr | cut -d' ' -f3 | xargs -I {} cp {} $PREFIX/bin/
mkdir -p lib/terminfo/78
cp -r /usr/lib/terminfo/78/xterm-256color lib/terminfo/78/
zip -r ../lnav/lnav-${{ github.ref_name }}-windows-amd64.zip lnav lib
- name: '💉 Basic test'
run: |
set -x
cd ../lnav-build
export PREFIX=$PWD/lnav
$PREFIX/bin/lnav.exe -n ../lnav/test/logfile_multiline.0
- name: '⬆️ Upload a Build Artifact'
uses: actions/upload-artifact@v4
with:
name: lnav-${{ github.ref_name }}-windows-amd64.zip
path: lnav-${{ github.ref_name }}-windows-amd64.zip
if-no-files-found: error
# - name: '🎁 Create Release'
# id: create_release
# uses: actions/create-release@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# tag_name: ${{ github.ref_name }}
# release_name: Release ${{ github.ref_name }}
# draft: false
# prerelease: false
# - name: '⬆️ Upload Release Asset'
# id: upload-release-asset
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
# asset_path: ./lnav-${{ github.ref_name }}-windows-amd64.zip
# asset_name: lnav-${{ github.ref_name }}-windows-amd64.zip
# asset_content_type: application/zip