lnav/.github/workflows/c-cpp.yml

191 lines
6.1 KiB
YAML
Raw Normal View History

2021-02-07 07:29:43 +00:00
name: ci-build
2020-07-01 21:19:32 +00:00
on:
push:
branches: [ master ]
tags: ['*']
2020-07-01 21:19:32 +00:00
pull_request:
branches: [ master ]
jobs:
coverage:
2021-01-30 05:27:53 +00:00
runs-on: self-hosted
2020-07-01 21:19:32 +00:00
steps:
- uses: actions/checkout@v2
2022-01-29 02:18:01 +00:00
# - name: Update apt
# run: sudo apt-get update
2021-01-30 08:13:09 +00:00
# - name: Install packages
# run: sudo apt-get install libncursesw5-dev libpcre++-dev libsqlite3-dev libbz2-dev libcurl4-openssl-dev libreadline-dev zlib1g-dev lcov
2021-01-30 05:36:49 +00:00
# - name: install cpp-coveralls
# run: pip install --user cpp-coveralls
2020-07-01 21:19:32 +00:00
- name: autogen
run: ./autogen.sh
- name: configure
2021-03-23 23:00:17 +00:00
run: ./configure --disable-static --enable-code-coverage --enable-debug CFLAGS=-g3 CXXFLAGS=-g3
2021-01-30 06:20:42 +00:00
- name: make
2022-01-29 02:18:01 +00:00
run: make -j3
2021-01-30 03:19:01 +00:00
- name: make check
run: make check
- name: upload cover
2021-01-30 17:08:30 +00:00
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
2021-02-01 06:53:00 +00:00
TRAVIS_JOB_ID: ${{ github.run_id }}-${{ github.run_number }}
2021-01-31 07:06:39 +00:00
run: >-
2021-01-31 06:24:11 +00:00
coveralls
2021-02-01 06:43:19 +00:00
--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
2021-05-30 22:36:19 +00:00
--exclude src/third-party
2021-02-01 06:43:19 +00:00
--exclude src/ww898
2021-02-01 23:56:37 +00:00
--exclude src/yajl
--exclude test
--exclude src/data_scanner_re.cc
2021-01-31 07:06:39 +00:00
--gcov-options '\-lp'
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Update apt
run: sudo apt-get update
- name: Install packages
run: >-
sudo apt-get install -y
make
automake
autoconf
g++
libpcre3-dev
libncurses-dev
libsqlite3-dev
libbz2-dev
libcurl4-openssl-dev
libreadline-dev
2021-11-05 22:13:16 +00:00
tshark
zlib1g-dev
- name: autogen
run: ./autogen.sh
- name: configure
2021-03-23 23:00:17 +00:00
run: ./configure --disable-static
2021-08-29 13:50:16 +00:00
- name: make
run: make -j4
- name: make distcheck
2021-08-25 18:44:31 +00:00
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@v2
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@v2
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
2022-06-04 14:18:27 +00:00
msys/libidn2-devel
msys/liblzma-devel
msys/libreadline-devel
msys/libsqlite-devel
2022-06-04 15:27:44 +00:00
msys/libunistring-devel
msys/ncurses-devel
msys/pcre-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" \
2022-05-24 06:31:59 +00:00
CPPFLAGS="-I../src -I../../lnav/src -I../../lnav/src/fmtlib -O2 -DNCURSES_STATIC" \
CXXFLAGS="-fPIC" \
CFLAGS="-fPIC" \
2022-06-04 15:42:48 +00:00
LIBS="-larchive -lssh2 -llzma -llz4 -lz -lzstd -lssl -lcrypto -liconv -lunistring -lbrotlicommon" \
--sysconfdir=/etc \
2022-06-04 15:27:44 +00:00
--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@v2
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