ci: use github workflow instead of travis and appveyor

This commit is contained in:
Petra Baranski
2023-07-23 06:18:49 +02:00
parent 87ec259c28
commit 823645995e
6 changed files with 69 additions and 58 deletions

61
.github/workflows/run-tests.yml vendored Normal file
View File

@@ -0,0 +1,61 @@
name: run-tests
run-name: test ${{ github.ref }}
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
test-on-ubuntu:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: lukka/get-cmake@latest
with:
cmakeVersion: "~3.25.0" # <--= optional, use most recent 3.25.x version
ninjaVersion: "^1.11.1" # <--= optional, use most recent 1.x version
- name: build
run: |
mkdir tmp
cd tmp
cmake -DMADDY_BUILD_WITH_TESTS=ON ..
make -j4
- name: run tests
run: |
./build/MaddyTests
test-on-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: lukka/get-cmake@latest
with:
cmakeVersion: "~3.25.0" # <--= optional, use most recent 3.25.x version
ninjaVersion: "^1.11.1" # <--= optional, use most recent 1.x version
- name: build
run: |
mkdir tmp
cd tmp
cmake -G "Visual Studio 17 2022" -A x64 -DMADDY_BUILD_WITH_TESTS=ON ..
cmake --build . --config Debug
- name: run tests
run: |
./build/Debug/MaddyTests.exe
test-on-osx:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- uses: lukka/get-cmake@latest
with:
cmakeVersion: "~3.25.0" # <--= optional, use most recent 3.25.x version
ninjaVersion: "^1.11.1" # <--= optional, use most recent 1.x version
- name: build
run: |
mkdir tmp
cd tmp
cmake -DMADDY_BUILD_WITH_TESTS=ON ..
make -j4
- name: run tests
run: |
./build/MaddyTests

View File

@@ -1,32 +0,0 @@
sudo: false
language: cpp
matrix:
include:
- os: linux
dist: xenial
sudo: require
addons:
apt:
sources:
- sourceline: 'ppa:ubuntu-toolchain-r/test'
packages:
- g++-7
env:
- MATRIX_EVAL="CC=gcc-7 && CXX=g++-7"
- os: osx
osx_image: xcode10
compiler: clang
env:
- MATRIX_EVAL="CC=clang && CXX=clang++"
before_install:
# This is necessary to solve https://github.com/travis-ci/travis-ci/issues/9649
- eval "${MATRIX_EVAL}"
script:
- mkdir tmp
- cd tmp
- cmake -DMADDY_ENABLED_TESTS=ON ..
- make -j4
- ../build/MaddyTests

View File

@@ -18,7 +18,9 @@ maddy uses [semver versioning](https://semver.org/).
* ![**ADDED**](https://img.shields.io/badge/-ADDED-%23099) Added contribution guideline
* ![**CHANGED**](https://img.shields.io/badge/-CHANGED-%23e90) updated cmake minimum required version to 3.25
* ![**CHANGED**](https://img.shields.io/badge/-CHANGED-%23e90) gtest is now loaded via cmake and not a git submodule any longer - updated gtest version to 1.13.0
* ![**CHANGED**](https://img.shields.io/badge/-CHANGED-%23e90) tests are only run if the cmake option `MADDY_ENABLED_TESTS` is on, moved test cmake code to the `tests` subfolder
* ![**CHANGED**](https://img.shields.io/badge/-CHANGED-%23e90) tests are only run if the cmake option `MADDY_BUILD_WITH_TESTS` is on, moved test cmake code to the `tests` subfolder
* ![**REMOVED**](https://img.shields.io/badge/-REMOVED-%23900) travis CI and appveyor
* ![**ADDED**](https://img.shields.io/badge/-ADDED-%23099) GitHub workflow
* ?
## version 1.1.2 2020-10-04

View File

@@ -18,9 +18,9 @@ set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR})
# ------------------------------------------------------------------------------
option(MADDY_ENABLED_TESTS "enable building tests" OFF)
option(MADDY_BUILD_WITH_TESTS "enable building tests" OFF)
if(${MADDY_ENABLED_TESTS})
if(${MADDY_BUILD_WITH_TESTS})
enable_testing()
endif()
@@ -35,11 +35,6 @@ if (UNIX)
CMAKE_CXX_FLAGS
"${CMAKE_CXX_FLAGS} -g -std=c++${MADDY_CPP_VERSION} -Wall -Wpedantic -Wextra -Wno-ignored-qualifiers -fno-rtti -fno-exceptions -fsanitize=address -fno-omit-frame-pointer"
)
else()
set(
CMAKE_CXX_FLAGS
"${CMAKE_CXX_FLAGS} -std=c++${MADDY_CPP_VERSION}"
)
endif()
# ------------------------------------------------------------------------------
@@ -66,6 +61,6 @@ target_include_directories(maddy INTERFACE
# ------------------------------------------------------------------------------
if(${MADDY_ENABLED_TESTS})
if(${MADDY_BUILD_WITH_TESTS})
add_subdirectory(tests)
endif()

View File

@@ -15,7 +15,7 @@ It is tested to work on:
* Linux (gcc)
* OSX (clang)
* Windows (Visual Studio 2017, mingw)
* Windows (Visual Studio 17 2022, mingw)
## Dependencies
@@ -65,7 +65,7 @@ git clone https://github.com/progsource/maddy.git
cd maddy
mkdir tmp
cd tmp
cmake -DMADDY_ENABLED_TESTS=ON ..
cmake -DMADDY_BUILD_WITH_TESTS=ON ..
make
make test # or run the executable in ../build/MaddyTests
```

View File

@@ -1,15 +0,0 @@
image: Visual Studio 2017
install:
- cmd: git submodule update --init --recursive
before_build:
- cmd: mkdir tmp
- cmd: cd tmp
- cmd: cmake -G "Visual Studio 15 Win64" -DMADDY_ENABLED_TESTS=ON ..
build:
project: $(APPVEYOR_BUILD_FOLDER)\tmp\$(APPVEYOR_PROJECT_NAME).sln
test_script:
- cmd: ctest -VV -C "Debug"