From 90dfa2d092e1855b5589d985b5f4d1e3e32ca318 Mon Sep 17 00:00:00 2001 From: Matus Novak Date: Wed, 15 Jul 2020 20:42:14 +0200 Subject: [PATCH] Move to GitHub actions --- .circleci/config.yml | 87 ------------------------ .github/workflows/build.yml | 132 ++++++++++++++++++++++++++++++++++++ .travis.yml | 54 --------------- appveyor.yml | 62 ----------------- 4 files changed, 132 insertions(+), 203 deletions(-) delete mode 100644 .circleci/config.yml create mode 100644 .github/workflows/build.yml delete mode 100644 .travis.yml delete mode 100644 appveyor.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 6e6905d2..00000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,87 +0,0 @@ -version: 2 -jobs: - pages: - docker: - - image: circleci/node:latest - steps: - - checkout - - - run: - name: Submodules - command: - git submodule update --init - - - run: - name: Dependencies - command: | - sudo apt-get install doxygen zip unzip -y - wget https://github.com/gohugoio/hugo/releases/download/v0.59.1/hugo_extended_0.59.1_Linux-64bit.deb - sudo dpkg -i hugo_extended_0.59.1_Linux-64bit.deb - wget https://github.com/matusnovak/doxybook2/releases/download/v1.0.0/doxybook2-linux-amd64-v1.0.0.zip - unzip doxybook2-linux-amd64-v1.0.0.zip - sudo cp bin/doxybook2 /usr/local/bin/doxybook2 - sudo chmod +x /usr/local/bin/doxybook2 - - - run: - name: Generate documentation - command: | - doxygen - doxybook2 \ - --input temp/xml \ - --output docs/content \ - --config docs/.doxybook/config.json \ - --templates docs/.doxybook/templates - rm -rf docs/content/Examples - rm -rf docs/content/Pages - - - run: - name: Build static pages - command: | - cd docs - hugo - cp -rv ./public /tmp/public - - - persist_to_workspace: - root: /tmp - paths: - - public - - deploy: - docker: - - image: circleci/node:latest - steps: - - checkout - - - add_ssh_keys: - fingerprints: - - "72:4f:5d:f5:3f:24:82:ec:28:72:1f:26:91:03:47:68" - - - attach_workspace: - at: /tmp - - - run: - name: Dependencies - command: | - sudo npm install -g gh-pages@2.0.1 - sudo chmod 777 -R /usr/local/lib/node_modules/gh-pages/.cache - - - run: - name: Deploy - command: | - cp -rv /tmp/public ./public - git config --global user.email "$GITHUB_USER_EMAIL" - git config --global user.name "$GITHUB_USER_NAME" - gh-pages --dist ./public - -workflows: - version: 2 - build_and_test: - jobs: - - pages - - deploy: - requires: - - pages - filters: - branches: - only: - - master diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..2b72882c --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,132 @@ +name: build +on: + push: + branches: + - '*' + tags: + - '*' + pull_request: + branches: + - 'master' + +jobs: + build: + name: ${{ matrix.name }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + include: + - name: 'Windows x64' + os: windows-latest + triplet: x64-windows + vcpkg_dir: 'C:\vcpkg' + suffix: 'windows-win32' + generator: 'Visual Studio 16 2019' + arch: '-A x64' + - name: 'Windows x86' + os: windows-latest + triplet: x86-windows + vcpkg_dir: 'C:\vcpkg' + suffix: 'windows-win64' + generator: 'Visual Studio 16 2019' + arch: '-A Win32' + - name: 'Linux x64' + os: ubuntu-latest + triplet: x64-linux + suffix: 'linux-x86_64' + vcpkg_dir: '/usr/local/share/vcpkg' + generator: 'Unix Makefiles' + arch: '' + - name: 'Mac OSX x64' + os: macos-latest + triplet: x64-osx + suffix: 'osx-x86_64' + vcpkg_dir: '/usr/local/share/vcpkg' + generator: 'Unix Makefiles' + arch: '' + + steps: + - name: Checkout + uses: actions/checkout@v1 + with: + submodules: true + + - name: Configure + shell: bash + run: | + mkdir build + mkdir install + if [ "$RUNNER_OS" == "Windows" ]; then + cmake \ + -B ./build \ + -G "${{ matrix.generator }}" ${{ matrix.arch }} \ + -DCMAKE_BUILD_TYPE=Debug \ + -DWRENBIND17_BUILD_TESTS=ON \ + . + else + if [ "$RUNNER_OS" == "Linux" ]; then + export CC=/usr/bin/gcc-9 + export CXX=/usr/bin/g++-9 + fi + cmake \ + -B ./build \ + -G "${{ matrix.generator }}" \ + -DCMAKE_BUILD_TYPE=Debug \ + -DWRENBIND17_BUILD_TESTS=ON \ + . + fi + + - name: Compile + shell: bash + run: | + if [ "$RUNNER_OS" == "Windows" ]; then + cmake --build ./build --target ALL_BUILD --config Debug + else + cmake --build ./build --target all --config Debug + fi + + - name: Tests + shell: bash + run: cd build && ctest -C Debug --verbose + + - name: Valgrind + if: ${{ matrix.os == 'ubuntu-latest' }} + shell: bash + run: | + valgrind --suppressions=./wren.supp ./build/WrenBind17_tests + + - name: Coverage + if: ${{ matrix.os == 'ubuntu-latest' }} + shell: bash + run: | + lcov --directory ./build --capture --output-file coverage.info; + lcov --remove coverage.info '/usr/*' "${HOME}"'/.cache/*' '*tests*' '*catch2*' '*vm*' --output-file coverage.info; + lcov --list coverage.info; + bash <(curl -s https://codecov.io/bash) -f coverage.info || echo "Codecov did not collect coverage reports"; + + - name: Create Changelog + id: create_changelog + if: startsWith(github.ref, 'refs/tags/v') + shell: bash + run: | + last_tag=$(git describe --tags --abbrev=0 @^ || true) + if [ -z "$last_tag" ]; then + git log --oneline --format="%C(auto) %h %s" > changelog.txt + else + git log --oneline --format="%C(auto) %h %s" ${last_tag}..@ > changelog.txt + fi + cat changelog.txt + + - name: Release + uses: ncipollo/release-action@v1 + if: startsWith(github.ref, 'refs/tags/v') + with: + allowUpdates: true + artifactContentType: application/zip + bodyFile: changelog.txt + draft: false + omitBodyDuringUpdate: true + omitNameDuringUpdate: true + prerelease: false + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 760aeb5c..00000000 --- a/.travis.yml +++ /dev/null @@ -1,54 +0,0 @@ -matrix: - include: - - os: linux - language: cpp - dist: xenial - addons: - apt: - packages: - - cmake - - lcov - - curl - - valgrind - - - os: osx - language: cpp - osx_image: xcode10.2 - addons: - apt: - packages: - - cmake - -before_install: - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then - sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test; - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 6B05F25D762E3157; - sudo apt-get update; - sudo apt-get install -y gcc-7 g++-7; - export CC=gcc-7; - export CXX=g++-7; - fi - -script: - - git submodule update --init - - mkdir build - - cd build - - cmake -G "Unix Makefiles" -DWRENBIND17_BUILD_TESTS=ON -DCMAKE_BUILD_TYPE=Debug .. || travis_terminate 1 - - cmake --build . || travis_terminate 1 - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then - valgrind --suppressions=../wren.supp ./WrenBind17_tests || travis_terminate 1; - fi - - ctest --verbose || travis_terminate 1 - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then - lcov --directory . --capture --output-file coverage.info; - lcov --remove coverage.info '/usr/*' "${HOME}"'/.cache/*' '*tests*' '*catch2*' '*vm*' --output-file coverage.info; - lcov --list coverage.info; - bash <(curl -s https://codecov.io/bash) -f coverage.info || echo "Codecov did not collect coverage reports"; - fi - -notifications: - email: - recipients: - - matusnov@gmail.com - on_success: always - on_failure: always diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 7d6967d0..00000000 --- a/appveyor.yml +++ /dev/null @@ -1,62 +0,0 @@ -version: '{build}' - -#---------------------------------# -# general configuration # -#---------------------------------# -branches: - except: - - gh-pages - -#---------------------------------# -# environment configuration # -#---------------------------------# -platform: Any CPU -environment: - matrix: - - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 - COMPILER: mingw - TOOLSET: w64-mingw32 - ARCH: x86_64 - GENERATOR: '"MinGW Makefiles"' - MINGW_DIR_BIN: C:\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin - CMAKE_C_COMPILER: C:/mingw-w64/x86_64-8.1.0-posix-seh-rt_v6-rev0/mingw64/bin/gcc.exe - CMAKE_CXX_COMPILER: C:/mingw-w64/x86_64-8.1.0-posix-seh-rt_v6-rev0/mingw64/bin/g++.exe - - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 - COMPILER: msvc - MINGW_DIR_BIN: '' - TOOLSET: vc15 - ARCH: win32 - GENERATOR: '"Visual Studio 15 2017"' - - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 - COMPILER: msvc - MINGW_DIR_BIN: '' - TOOLSET: vc15 - ARCH: win64 - GENERATOR: '"Visual Studio 15 2017 Win64"' - -#---------------------------------# -# steps # -#---------------------------------# -install: - - cmd: git submodule update --init - - cmd: mkdir build - - cmd: set PATH=%PATH:C:\Program Files\Git\usr\bin;=% - - cmd: set PATH=%MINGW_DIR_BIN%;%PATH% - - cmd: cd build & cmake .. -G %GENERATOR% -DWRENBIND17_BUILD_TESTS=ON -DCMAKE_BUILD_TYPE=MinSizeRel || exit 1 & cd .. - -build_script: - - cmd: cd build & cmake --build . --config "MinSizeRel" || exit 1 & cd .. - -test_script: - - cmd: cd build & ctest --verbose -C "MinSizeRel" || exit 1 & cd .. - -#---------------------------------# -# notifications # -#---------------------------------# -notifications: - - provider: Email - to: - - matusnov@gmail.com - on_build_success: true - on_build_failure: true - \ No newline at end of file