Skip to content

Commit

Permalink
Merge 0c205ed into 0cf8f21
Browse files Browse the repository at this point in the history
  • Loading branch information
markuspf committed Mar 28, 2022
2 parents 0cf8f21 + 0c205ed commit 1e56195
Show file tree
Hide file tree
Showing 7 changed files with 117 additions and 159 deletions.
111 changes: 111 additions & 0 deletions .github/workflows/github-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
name: velocypack-test

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

env:
CMAKE_BUILD_PARALLEL_LEVEL: 4
CXX_STANDARD: 20

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
# GCC builds
- {os: ubuntu-latest, compiler: gcc, version: '9',
build_type: Release, hash_type: xxhash }
- {os: ubuntu-latest, compiler: gcc, version: '10',
build_type: Release, hash_type: fasthash }
- {os: ubuntu-latest, compiler: gcc, version: '11',
build_type: Release, hash_type: xxhash }
- {os: ubuntu-latest, compiler: gcc, version: '10',
build_type: Debug, hash_type: xxhash,
flags: '-O0 -fno-inline --coverage', coverage: true}
- {os: ubuntu-latest, compiler: gcc, version: '10',
build_type: Debug, hash_type: xxhash, sanitizer: true,
flags: '-fsanitize=address -fsanitize=leak -fsanitize=undefined -fsanitize-address-use-after-scope -fno-omit-frame-pointer',
ld_flags: '-fsanitize=address -fsanitize=leak -fsanitize=undefined -fsanitize=address-use-after-scope -fno-omit-frame-pointer'}

# Clang builds
- {os: ubuntu-latest, compiler: clang, version: '10',
build_type: Release, hash_type: xxhash }
- {os: ubuntu-latest, compiler: clang, version: '11',
build_type: Release, hash_type: fasthash }
- {os: ubuntu-latest, compiler: clang, version: '12',
build_type: Release, hash_type: xxhash }

# Windows builds
- {os: windows-2019, compiler: msvc,
build_type: Release, hash_type: xxhash }
- {os: windows-latest, compiler: msvc,
build_type: Release, hash_type: xxhash }

# macOS builds
- {os: macos-latest, compiler: clang,
build_type: Release, hash_type: xxhash }

# This seems to trigger a bug, so re-enable it after it is
# fixed
# - {os: macos-latest, compiler: clang,
# build_type: Release, hash_type: xxhash,
# flags: '-O0 -fno-inline --coverage', coverage: true}

fail-fast: false
steps:
- uses: actions/checkout@v2
- name: Setup environment
run: |
echo "SANITIZER=${{ matrix.sanitizer }}" >> ${GITHUB_ENV}
- name: Install gcc
if: startsWith(matrix.os, 'ubuntu-') && matrix.compiler == 'gcc'
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install g++-${{ matrix.version }}
echo "CXX=g++-${{ matrix.version }}" >> ${GITHUB_ENV}
- name: Install clang
if: startsWith(matrix.os, 'ubuntu-') && matrix.compiler == 'clang'
run: |
export CODENAME=`lsb_release -c | sed 's/Codename:\t//'`
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key 2>/dev/null | sudo apt-key add -
sudo add-apt-repository "deb http://apt.llvm.org/${CODENAME}/ llvm-toolchain-${CODENAME}-${{ matrix.version }} main"
sudo apt-get update
sudo apt-get install clang-${{ matrix.version }}
echo "CC=clang-${{ matrix.version }}" >> ${GITHUB_ENV}
echo "CXX=clang++-${{ matrix.version }}" >> ${GITHUB_ENV}
echo "LDFLAGS=-fuse-ld=lld" >> ${GITHUB_ENV}
- name: Initialize MSVC ${{ matrix.version }}
if: startsWith(matrix.os, 'windows-')
uses: ilammy/msvc-dev-cmd@v1
with:
toolset: ${{ matrix.version }}
- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: cmake -B${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DHashType=${{ matrix.hash_type }} -DBuildTests=ON -DBuildLargeTests=OFF -DBuildVelocyPackExamples=ON -DBuildTools=ON -DEnableSSE=OFF -DCMAKE_CXX_STANDARD=${{env.CXX_STANDARD}} -DCMAKE_CXX_FLAGS="${{ matrix.flags }}" -DCMAKE_LINKER_FLAGS="${{ matrix.ld_flags }}"

- name: Build
# Build your program with the given configuration
run: cmake --build ${{github.workspace}}/build --config ${{ matrix.build_type }}

- name: Test
working-directory: ${{github.workspace}}
run: scripts/execute-test.sh

- name: Coverage
if: matrix.coverage == true
run: |
sudo apt-get install lcov
scripts/collect-coverage.sh
- name: Coveralls Upload
if: matrix.coverage == true
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ${{ github.workspace }}/coverage.info
102 changes: 0 additions & 102 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
VelocyPack (VPack) - a fast and compact format for serialization and storage
============================================================================

TravisCI: [![Build Status](https://api.travis-ci.com/arangodb/velocypack.svg?branch=main)](https://travis-ci.com/arangodb/velocypack) AppVeyor: [![Build status](https://ci.appveyor.com/api/projects/status/pkbl4t7vey88bqud?svg=true)](https://ci.appveyor.com/project/jsteemann/velocypack) Coveralls: [![Coverage Status](https://coveralls.io/repos/arangodb/velocypack/badge.svg?branch=main&service=github)](https://coveralls.io/github/arangodb/velocypack?branch=main)
GitHub Action: [![Build](https://github.com/arangodb/velocypack/actions/workflows/github-ci.yml/badge.svg)] Coveralls: [![Coverage Status](https://coveralls.io/repos/arangodb/velocypack/badge.svg?branch=main&service=github)](https://coveralls.io/github/arangodb/velocypack?branch=main)

Motivation
----------
Expand Down
15 changes: 0 additions & 15 deletions appveyor.yml

This file was deleted.

16 changes: 5 additions & 11 deletions scripts/travis-after-success.sh → scripts/collect-coverage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ echo "project directory $project_dir"
echo "build directory $build_dir"
cd ${project_dir} || ferr "can not enter build dir"

if ${CI:-false}; then
gem install coveralls-lcov || ferr "failed to install gem"
fi

CXX=${CXX:='gcc'}
version=${CXX#*-}
if [[ -n $version ]]; then
Expand Down Expand Up @@ -57,10 +53,8 @@ LCOV=(
"${LCOV[@]}" --list coverage.info || ferr "failed lcov"

sed -i "s#${project_dir}/##" coverage.info
# upload coverage info
if ${COVERALLS_TOKEN:-false}; then
coveralls-lcov --repo-token ${COVERALLS_TOKEN} coverage.info || ferr "failed to upload"
else
# should not be required on github
coveralls-lcov coverage.info || ferr "failed to upload"
fi

echo $PWD
ls -lah

echo "Done with lcov"
File renamed without changes.
30 changes: 0 additions & 30 deletions scripts/travis-build.sh

This file was deleted.

0 comments on commit 1e56195

Please sign in to comment.