Skip to content

feat: refine package descriptor support #883

feat: refine package descriptor support

feat: refine package descriptor support #883

Workflow file for this run

# Copyright (c) 2021-2024 [Ribose Inc](https://www.ribose.com).
# All rights reserved.
# This file is a part of tamatebako
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
name: Ubuntu
on:
schedule:
- cron: "0 6 * * 0"
push:
branches: [ main ]
paths-ignore:
- 'docs/**'
- '**.adoc'
- '**.md'
- 'macos-arm64.env'
- 'macos-x86_64.env'
- '.cirrus.yml'
- '.github/workflows/*.yml'
- '!.github/workflows/ubuntu.yml'
pull_request:
paths-ignore:
- 'docs/**'
- '**.adoc'
- '**.md'
- 'macos-arm64.env'
- 'macos-x86_64.env'
- '.cirrus.yml'
- '.github/workflows/*.yml'
- '!.github/workflows/ubuntu.yml'
workflow_dispatch:
concurrency:
group: '${{ github.workflow }}-${{ github.job }}-${{ github.head_ref || github.ref_name }}'
cancel-in-progress: true
env:
CACHE_VER: 5
CODECOV_TOKEN: 3fd391a5-99c6-434f-a07c-22fdf282ae5b
jobs:
build:
name: ${{ matrix.env.os }} [CC ${{ matrix.env.CC }}, ASAN ${{ matrix.env.ASAN }}, COVERAGE ${{ matrix.env.COVERAGE }}, ${{ matrix.env.LOG_LEVEL }} ]
runs-on: ${{ matrix.env.os }}
strategy:
fail-fast: false
matrix:
env:
- { os: ubuntu-20.04, CC: gcc-10, CXX: g++-10, ASAN: 'OFF', COVERAGE: 'OFF', LOG_LEVEL: 'trace' }
- { os: ubuntu-20.04, CC: gcc-10, CXX: g++-10, ASAN: 'OFF', COVERAGE: 'ON', LOG_LEVEL: 'trace' }
- { os: ubuntu-20.04, CC: gcc-10, CXX: g++-10, ASAN: 'OFF', COVERAGE: 'ON', LOG_LEVEL: 'warn' }
- { os: ubuntu-20.04, CC: clang-12, CXX: clang++-12, ASAN: 'OFF', COVERAGE: 'OFF', LOG_LEVEL: 'warn' }
- { os: ubuntu-20.04, CC: clang-12, CXX: clang++-12, ASAN: 'ON', COVERAGE: 'OFF', LOG_LEVEL: 'warn' }
# https://github.com/llvm/llvm-project/issues/56357
# On Ubuntu 22 affects clang 14 (file entry.cpp)
- { os: ubuntu-22.04, CC: clang-15, CXX: clang++-15, ASAN: 'OFF', COVERAGE: 'OFF', LOG_LEVEL: 'warn' }
- { os: ubuntu-22.04, CC: gcc-11, CXX: g++-11, ASAN: 'OFF', COVERAGE: 'OFF', LOG_LEVEL: 'warn' }
env: ${{ matrix.env }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
- name: Setup environment
run: |
cat common.env ubuntu.env >> $GITHUB_ENV
echo "CORES=$(nproc --all)" >> $GITHUB_ENV
echo "MAKEFLAGS=j$(nproc --all)" >> $GITHUB_ENV
- name: Create deps folder
run: mkdir ${{github.workspace}}/${{env.DEPS}}
- name: Process cache
uses: actions/cache@v4
with:
path: ${{github.workspace}}/${{env.DEPS}}
key: ${{ matrix.env.os }}-${{ env.CC }}-${{ hashFiles('**/common.env') }}-${{ env.ASAN }}-${{ env.COVERAGE }}-${{ env.LOG_LEVEL }}-v${{ env.CACHE_VER }}
# Already installed: bison flex pkg-config
- name: Install packages
run: |
sudo apt-get -y update
sudo apt-get -y install \
binutils-dev libevent-dev acl-dev libfmt-dev libjemalloc-dev \
libdouble-conversion-dev libiberty-dev liblz4-dev libssl-dev liblzma-dev \
libunwind-dev libdwarf-dev libelf-dev libgoogle-glog-dev libutfcpp-dev \
libboost-filesystem-dev libboost-program-options-dev libboost-system-dev \
libboost-iostreams-dev libboost-date-time-dev libboost-context-dev \
libboost-regex-dev libboost-thread-dev libbrotli-dev
- name: Configure
run: cmake -B build -DWITH_TESTS=ON -DWITH_ASAN=${{ env.ASAN }} -DWITH_COVERAGE=${{ env.COVERAGE }} -DTESTS_LOG_LEVEL=${{ env.LOG_LEVEL }}
- name: Build
run: cmake --build build --parallel "$CORES"
- name: Run unit tests
run: ctest --test-dir build --output-on-failure --parallel "$CORES"
- name: Checkout shell test framework
if: ${{ env.COVERAGE != 'ON' && env.ASAN != 'ON' }}
uses: actions/checkout@v4
with:
repository: kward/shunit2
path: ${{github.workspace}}/tests/shunit2
fetch-depth: 1
- name: Run additional tests
if: ${{ env.COVERAGE != 'ON' && env.ASAN != 'ON' }}
run: ${{github.workspace}}/tests/scripts/tests.sh
- name: Upload to codecov.io
if: ${{ env.COVERAGE == 'ON' }}
run: |
curl -Os https://uploader.codecov.io/latest/linux/codecov
curl https://uploader.codecov.io/verification.gpg | gpg --no-default-keyring --keyring trustedkeys.gpg --import
curl -Os https://uploader.codecov.io/latest/linux/codecov
curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM
curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM.sig
gpgv codecov.SHA256SUM.sig codecov.SHA256SUM
shasum -a 256 -c codecov.SHA256SUM
find "build" -type f -name '*.gcno' -exec gcov -p {} +
chmod +x codecov
./codecov -t ${{ env.CODECOV_TOKEN }}