From a9b0b4576aebfe38f1e483b495389951a477499a Mon Sep 17 00:00:00 2001 From: Martin Mitas Date: Tue, 12 Dec 2023 19:44:04 +0100 Subject: [PATCH] Migrate CI from Travis and Appveyor to Github Workflows. --- .github/workflows/ci-build.yml | 49 ++++++++++++++++++++++++++++++++++ .travis.yml | 36 ------------------------- README.md | 5 ---- appveyor.yml | 29 -------------------- 4 files changed, 49 insertions(+), 70 deletions(-) create mode 100644 .github/workflows/ci-build.yml delete mode 100644 .travis.yml delete mode 100644 appveyor.yml diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml new file mode 100644 index 00000000..5c542282 --- /dev/null +++ b/.github/workflows/ci-build.yml @@ -0,0 +1,49 @@ +name: Build and Test + +on: + - pull_request + - push + +jobs: + linux: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Configure + # We enforce -Wdeclaration-after-statement because Qt project needs to + # build MD4C with Integrity compiler which chokes whenever a declaration + # is not at the beginning of a block. + run: CFLAGS='--coverage -g -O0 -Wall -Wdeclaration-after-statement -Werror' cmake -DCMAKE_BUILD_TYPE=Debug -G 'Unix Makefiles' . + - name: Build + run: make VERBOSE=1 + - name: Test + run: ./scripts/run-tests.sh + - name: Code Coverage Report + if: ${{ github.event_name == 'push' }} + continue-on-error: true + run: | + sudo apt-get install -y lcov + lcov --directory . --capture --output-file coverage.info + lcov --remove coverage.info '/usr/*' --output-file coverage.info + lcov --list coverage.info + bash <(curl -s https://codecov.io/bash) + + windows-32: + runs-on: windows-latest + steps: + - uses: actions/checkout@v4 + - uses: microsoft/setup-msbuild@v1.3.1 + - name: Configure + run: cmake -DCMAKE_BUILD_TYPE=Release -G "Visual Studio 17 2022" -A Win32 . + - name: Build + run: msbuild.exe md4c.sln.sln /p:Configuration=Release /p:Platform=Win32 + + windows-64: + runs-on: windows-latest + steps: + - uses: actions/checkout@v4 + - uses: microsoft/setup-msbuild@v1.3.1 + - name: Configure + run: cmake -DCMAKE_BUILD_TYPE=Release -G "Visual Studio 17 2022" -A x64 . + - name: Build + run: msbuild.exe md4c.sln /p:Configuration=Release /p:Platform=x64 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 66ba337f..00000000 --- a/.travis.yml +++ /dev/null @@ -1,36 +0,0 @@ -# YAML definition for travis-ci.com continuous integration. -# See https://docs.travis-ci.com/user/languages/c -arch: - - amd64 - - ppc64le -language: c -dist: bionic - -compiler: - - gcc - -addons: - apt: - packages: - - python3 # for running tests - - lcov # for generating code coverage report - -before_script: - - mkdir build - - cd build - # We enforce -Wdeclaration-after-statement because Qt project needs to - # build MD4C with Integrity compiler which chokes whenever a declaration - # is not at the beginning of a block. - - CFLAGS='--coverage -g -O0 -Wall -Wdeclaration-after-statement -Werror' cmake -DCMAKE_BUILD_TYPE=Debug -G 'Unix Makefiles' .. - -script: - - make VERBOSE=1 - -after_success: - - ../scripts/run-tests.sh - # Creating report - - lcov --directory . --capture --output-file coverage.info # capture coverage info - - lcov --remove coverage.info '/usr/*' --output-file coverage.info # filter out system - - lcov --list coverage.info # debug info - # Uploading report to CodeCov - - bash <(curl -s https://codecov.io/bash) || echo "Codecov did not collect coverage reports" diff --git a/README.md b/README.md index 9abe987e..2782423a 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,3 @@ -[![Linux Build Status (travis-ci.com)](https://img.shields.io/travis/mity/md4c/master.svg?logo=linux&label=linux%20build)](https://travis-ci.com/mity/md4c) -[![Windows Build Status (appveyor.com)](https://img.shields.io/appveyor/ci/mity/md4c/master.svg?logo=windows&label=windows%20build)](https://ci.appveyor.com/project/mity/md4c/branch/master) -[![Code Coverage Status (codecov.io)](https://img.shields.io/codecov/c/github/mity/md4c/master.svg?logo=codecov&label=code%20coverage)](https://codecov.io/github/mity/md4c) -[![Coverity Scan Status](https://img.shields.io/coverity/scan/mity-md4c.svg?label=coverity%20scan)](https://scan.coverity.com/projects/mity-md4c) - # MD4C Readme diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index d4bcaff5..00000000 --- a/appveyor.yml +++ /dev/null @@ -1,29 +0,0 @@ -# YAML definition for Appveyor.com continuous integration. -# See http://www.appveyor.com/docs/appveyor-yml - -version: '{branch}-{build}' - -before_build: - - 'cmake --version' - - 'if "%PLATFORM%"=="x64" cmake -G "Visual Studio 12 Win64" .' - - 'if not "%PLATFORM%"=="x64" cmake -G "Visual Studio 12" .' - -build: - project: md4c.sln - verbosity: detailed - -skip_tags: true - -os: - - Windows Server 2012 R2 - -configuration: - - Debug - - Release - -platform: - - x64 # 64-bit build - - win32 # 32-bit build - -artifacts: - - path: $(configuration)/md2html/md2html.exe