blob: ac725c02a660a0983adfe63f5a8b4a0740fab464 [file] [log] [blame]
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: log4cxx
on: [push, pull_request]
jobs:
job:
name: ${{ matrix.os }}-${{ matrix.cxx }}-build-and-test
runs-on: ${{ matrix.os }}
timeout-minutes: 38
strategy:
fail-fast: false
matrix:
name: [ubuntu18-gcc, ubuntu18-clang, osx, windows-2019]
include:
- name: windows-2019
os: windows-2019
cxx: cl.exe
cc: cl.exe
- name: ubuntu18-gcc
os: ubuntu-18.04
cxx: g++
cc: gcc
- name: ubuntu18-clang
os: ubuntu-18.04
cxx: clang++
cc: clang
- name: osx
os: macos-latest
cxx: clang++
cc: clang
steps:
- uses: actions/checkout@v2
with:
path: main
- name: 'Configure Dependencies - Ubuntu'
if: matrix.name == 'ubuntu18-gcc' || matrix.name == 'ubuntu18-clang'
run: |
sudo apt-get update
sudo apt-get install -y libapr1-dev libaprutil1-dev
# note: sqlext.h exists on github VM, purge for now as we don't link correctly...
sudo apt-get purge unixodbc-dev
- name: 'Restore Prebuilt Dependencies - Windows'
id: restore-vcpkg-cache
if: matrix.name == 'windows-2019' || matrix.name == 'windows-2016'
uses: actions/cache@v2
with:
path: vcpkg
key: ${{ runner.os }}-${{ matrix.name }}-cache
- name: 'Checkout VCPKG - Windows'
if: (matrix.name == 'windows-2019' || matrix.name == 'windows-2016') && steps.restore-vcpkg-cache.outputs.cache-hit != 'true'
uses: actions/checkout@v2
with:
repository: microsoft/vcpkg
path: vcpkg
ref: ec6fe06e8da05a8157dc8581fa96b36b571c1bd5
- name: 'Configure Dependencies - Windows'
if: (matrix.name == 'windows-2019' || matrix.name == 'windows-2016') && steps.restore-vcpkg-cache.outputs.cache-hit != 'true'
id: runvcpkg
shell: pwsh
run: |
cd vcpkg
./bootstrap-vcpkg.bat
./vcpkg install apr apr-util --triplet=x64-windows
- name: 'run cmake - win'
if: (matrix.name == 'windows-2019' || matrix.name == 'windows-2016')
shell: pwsh
run: |
$THISDIR=Get-Location
cd main
mkdir build
cd build
cmake -DLOG4CXX_TEST_PROGRAM_PATH=C:\msys64\usr\bin "-DCMAKE_TOOLCHAIN_FILE=$THISDIR/vcpkg/scripts/buildsystems/vcpkg.cmake" -DCMAKE_CXX_COMPILER=${{ matrix.cxx }} -DCMAKE_C_COMPILER=${{ matrix.cc }} ..
cmake --build .
- name: 'run cmake - *nix'
if: matrix.name != 'windows-2019'
run: |
cd main
mkdir build
cd build
cmake -DCMAKE_CXX_COMPILER=${{ matrix.cxx }} -DCMAKE_C_COMPILER=${{ matrix.cc }} ..
cmake --build .
- name: run unit tests
shell: pwsh
run: |
cd main
cd build
ctest -C Debug --output-on-failure -V