From 2acafa2f88a88a590fc023b670dfaf83243e33f6 Mon Sep 17 00:00:00 2001 From: Dan Baston Date: Thu, 27 Oct 2022 10:45:42 -0400 Subject: [PATCH] CI: Migrate MacOS and cppcheck to GitHub, remove Azure pipelines (#712) --- .azure-pipelines.yml | 319 --------------------------------------- .github/workflows/ci.yml | 277 ++++++++++++++++++++++++--------- README.md | 4 +- 3 files changed, 207 insertions(+), 393 deletions(-) delete mode 100644 .azure-pipelines.yml diff --git a/.azure-pipelines.yml b/.azure-pipelines.yml deleted file mode 100644 index 5dde9a9c63..0000000000 --- a/.azure-pipelines.yml +++ /dev/null @@ -1,319 +0,0 @@ -# Azure Pipelines for GEOS -# All builds are based on the CMake configuration. -# -# Author: Mateusz Loskot - -# trigger: -# branches: -# include: -# - master -# - bugfix/* -# - feature/* -# - fix/* -# - pr/* - -pr: - branches: - include: - - main - -variables: - - name: BUILD_TYPE - value: Release - - name: MAKEFLAGS - value: -j2 - -stages: - -- stage: Test - jobs: - - - job: 'Linux' - strategy: - matrix: - GCC 12: - CXXSTD: 11, 20 - CXX: g++-12 - PACKAGES: g++-12 - VM_IMAGE: ubuntu-22.04 - VM_NAME: jammie - GCC 11: - CXXSTD: 11, 20 - CXX: g++-11 - PACKAGES: g++-11 - VM_IMAGE: ubuntu-20.04 - VM_NAME: focal - GCC 10: - CXXSTD: 11, 17 - CXX: g++-10 - PACKAGES: g++-10 - VM_IMAGE: ubuntu-20.04 - VM_NAME: focal - GCC 9: - CXXSTD: 11, 14 - CXX: g++-9 - PACKAGES: g++-9 - VM_IMAGE: ubuntu-20.04 - VM_NAME: focal - GCC 8: - CXXSTD: 11 - CXX: g++-8 - PACKAGES: g++-8 - VM_IMAGE: ubuntu-20.04 - VM_NAME: focal - GCC 7: - CXXSTD: 11 - CXX: g++-7 - PACKAGES: g++-7 - VM_IMAGE: ubuntu-20.04 - VM_NAME: focal - GCC 6: - CXXSTD: 11 - CXX: g++-6 - PACKAGES: g++-6 - VM_IMAGE: ubuntu-18.04 - VM_NAME: focal - GCC 5: - CXXSTD: 11 - CXX: g++-5 - PACKAGES: g++-5 - VM_IMAGE: ubuntu-18.04 - VM_NAME: focal - GCC 4.8: - CXXSTD: 11 - CXX: g++-4.8 - PACKAGES: g++-4.8 - VM_IMAGE: ubuntu-18.04 - VM_NAME: focal - Clang 12: - CXXSTD: 11, 20 - CXX: clang++-12 - PACKAGES: clang-12 - LLVM_REPO: llvm-toolchain-focal-12 - VM_IMAGE: ubuntu-20.04 - VM_NAME: focal - Clang 11: - CXXSTD: 11, 17 - CXX: clang++-11 - PACKAGES: clang-11 - LLVM_REPO: llvm-toolchain-focal-11 - VM_IMAGE: ubuntu-20.04 - VM_NAME: focal - Clang 10: - CXXSTD: 11, 14 - CXX: clang++-10 - PACKAGES: clang-10 - LLVM_REPO: llvm-toolchain-focal-10 - VM_IMAGE: ubuntu-20.04 - VM_NAME: focal - Clang 9: - CXXSTD: 11 - CXX: clang++-9 - PACKAGES: clang-9 - LLVM_REPO: llvm-toolchain-focal-9 - VM_IMAGE: ubuntu-20.04 - VM_NAME: focal - Clang 8: - CXXSTD: 11 - CXX: clang++-8 - PACKAGES: clang-8 - LLVM_REPO: llvm-toolchain-bionic-8 - VM_IMAGE: ubuntu-18.04 - VM_NAME: bionic - Clang 7: - CXXSTD: 11 - CXX: clang++-7 - PACKAGES: clang-7 - LLVM_REPO: llvm-toolchain-bionic-7 - VM_IMAGE: ubuntu-18.04 - VM_NAME: bionic - # Clang 6: - # CXXSTD: 11 - # CXX: clang++-6.0 - # PACKAGES: clang-6.0 - # LLVM_REPO: llvm-toolchain-bionic-6.0 - # VM_IMAGE: ubuntu-18.04 - # VM_NAME: bionic - # Clang 5: - # CXXSTD: 11 - # PACKAGES: clang-5.0 - # CXX: clang++-5.0 - # LLVM_REPO: llvm-toolchain-bionic-5.0 - # VM_IMAGE: ubuntu-18.04 - # VM_NAME: bionic - pool: - vmImage: $(VM_IMAGE) - steps: - - script: | - set -e - uname -a - sudo -E apt-add-repository -y "ppa:ubuntu-toolchain-r/test" - if test -n "${LLVM_REPO}" ; then - wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - - sudo -E apt-add-repository "deb http://apt.llvm.org/${VM_NAME}/ ${LLVM_REPO} main" - fi - sudo -E apt-get update - sudo -E apt-get -yq --no-install-suggests --no-install-recommends install cmake ${PACKAGES} - displayName: 'Install' - - script: | - set -e - mkdir build.cxx11 - cd build.cxx11 - cmake --version - cmake -DCMAKE_CXX_STANDARD=11 -DCMAKE_BUILD_TYPE=$BUILD_TYPE .. - cmake --build . --config $BUILD_TYPE - ctest -V --output-on-failure -C $BUILD_TYPE - displayName: 'Build C++11' - condition: contains(variables['CXXSTD'], '11') - - script: | - set -e - mkdir build.cxx14 - cd build.cxx14 - cmake --version - cmake -DCMAKE_CXX_STANDARD=14 -DCMAKE_BUILD_TYPE=$BUILD_TYPE .. - cmake --build . --config $BUILD_TYPE - ctest -V --output-on-failure -C $BUILD_TYPE - displayName: 'Build C++14' - condition: contains(variables['CXXSTD'], '14') - - script: | - set -e - mkdir build.cxx17 - cd build.cxx17 - cmake --version - cmake -DCMAKE_CXX_STANDARD=17 -DCMAKE_BUILD_TYPE=$BUILD_TYPE .. - cmake --build . --config $BUILD_TYPE - ctest -V --output-on-failure -C $BUILD_TYPE - displayName: 'Build C++17' - condition: contains(variables['CXXSTD'], '17') - - script: | - set -e - mkdir build.cxx20 - cd build.cxx20 - cmake --version - cmake -DCMAKE_CXX_STANDARD=20 -DCMAKE_BUILD_TYPE=$BUILD_TYPE .. - cmake --build . --config $BUILD_TYPE - ctest -V --output-on-failure -C $BUILD_TYPE - displayName: 'Build C++20' - condition: contains(variables['CXXSTD'], '20') - - - job: 'Windows' - strategy: - matrix: - # VS 2022 C++20: - # TOOLSET: msvc-14.3 - # CXXSTD: 20 - # VM_IMAGE: 'windows-2022' - VS 2019 C++20 x64: - TOOLSET: msvc-14.2 - CXXSTD: 20 - VM_IMAGE: 'windows-2019' - ARCH: x64 - VS 2019 C++20 ARM64: - TOOLSET: msvc-14.2 - CXXSTD: 20 - VM_IMAGE: 'windows-2019' - ARCH: ARM64 - - pool: - vmImage: $(VM_IMAGE) - steps: - - powershell: | - Write-Host "Installing CMake 3.14.7" - Invoke-WebRequest https://cmake.org/files/v3.14/cmake-3.14.7-win64-x64.zip -OutFile C:\cmake-3.14.7-win64-x64.zip - Expand-Archive C:\cmake-3.14.7-win64-x64.zip -DestinationPath C:\ - Rename-Item -Path C:\cmake-3.14.7-win64-x64 -NewName C:\cmake - Write-Host "##vso[task.prependpath]C:\cmake\bin" - displayName: 'Install' - - script: | - mkdir build.cxx%CXXSTD%.%ARCH% - cd build.cxx%CXXSTD%.%ARCH% - cmake --version - cmake -DCMAKE_CXX_STANDARD=%CXXSTD% -DBUILD_SHARED_LIBS=ON -A %ARCH% .. - displayName: 'CMake' - - script: | - cd build.cxx%CXXSTD%.%ARCH% - cmake --build . --config %BUILD_TYPE% - displayName: 'Build' - - script: | - cd build.cxx%CXXSTD%.%ARCH% - ctest -V --output-on-failure -C %BUILD_TYPE% - displayName: 'Test' - condition: and(succeeded(), eq(variables['ARCH'], 'x64')) - - - job: 'macOS' - pool: - vmImage: 'macOS-11' - strategy: - matrix: - # https://github.com/actions/virtual-environments/blob/main/images/macos/macos-11-Readme.md#xcode - Xcode 13.2.1: - TOOLSET: clang - CXXSTD: 11, 14, 20 - XCODE_APP: /Applications/Xcode_13.2.1.app - Xcode 12.4: - TOOLSET: clang - CXXSTD: 11, 14, 20 - XCODE_APP: /Applications/Xcode_12.4.app - Xcode 11.7: - TOOLSET: clang - CXXSTD: 11, 17 - XCODE_APP: /Applications/Xcode_11.7.app - steps: - - script: | - set -e - uname -a - sudo xcode-select -switch ${XCODE_APP} - which clang++ - clang++ --version - displayName: Install - - script: | - set -e - mkdir build.cxx11 - cd build.cxx11 - cmake --version - cmake -DCMAKE_CXX_STANDARD=11 -DCMAKE_BUILD_TYPE=$BUILD_TYPE .. - cmake --build . --config $BUILD_TYPE - ctest -V --output-on-failure -C $BUILD_TYPE - displayName: 'Build C++11' - condition: contains(variables['CXXSTD'], '11') - - script: | - set -e - mkdir build.cxx14 - cd build.cxx14 - cmake --version - cmake -DCMAKE_CXX_STANDARD=14 -DCMAKE_BUILD_TYPE=$BUILD_TYPE .. - cmake --build . --config $BUILD_TYPE - ctest -V --output-on-failure -C $BUILD_TYPE - displayName: 'Build C++14' - condition: contains(variables['CXXSTD'], '14') - - script: | - set -e - mkdir build.cxx17 - cd build.cxx17 - cmake --version - cmake -DCMAKE_CXX_STANDARD=17 -DCMAKE_BUILD_TYPE=$BUILD_TYPE .. - cmake --build . --config $BUILD_TYPE - ctest -V --output-on-failure -C $BUILD_TYPE - displayName: 'Build C++17' - condition: contains(variables['CXXSTD'], '17') - - script: | - set -e - mkdir build.cxx20 - cd build.cxx20 - cmake --version - cmake -DCMAKE_CXX_STANDARD=20 -DCMAKE_BUILD_TYPE=$BUILD_TYPE .. - cmake --build . --config $BUILD_TYPE - ctest -V --output-on-failure -C $BUILD_TYPE - displayName: 'Build C++20' - condition: contains(variables['CXXSTD'], '20') - - - job: Code_quality_checks - pool: - vmImage: 'ubuntu-latest' - steps: - - script: | - set -e - sudo -E apt-get update - sudo -E apt-get -yq --no-install-suggests --no-install-recommends install cppcheck - ./tools/cppcheck.sh - displayName: 'cppcheck' diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7b76d10e53..fb217f94ac 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,7 +9,9 @@ on: push: paths-ignore: - 'web/**' - pull_request: ~ + pull_request: + paths-ignore: + - '**/.md' jobs: linux: @@ -17,61 +19,142 @@ jobs: strategy: matrix: ci: - - { - compiler: g++, - build_type: Coverage, - cxxstd: 11, - arch: 64, - packages: 'g++', - cmake: 3.15.*, - cmake_extra: '-DBUILD_BENCHMARKS=ON', + - cxx_compiler: g++ + c_compiler: gcc + build_type: Coverage + cxxstd: 11 + arch: 64 + packages: g++ + cmake: 3.15.* + cmake_extra: '-DBUILD_BENCHMARKS=ON' os: ubuntu-18.04 - } - - { - compiler: g++, - build_type: Release, - cxxstd: 11, - arch: 32, - packages: 'g++-4.8-multilib gcc-4.8-multilib g++-multilib gcc-multilib', - cmake: 3.13.*, + + - cxx_compiler: g++-4.8 + c_compiler: gcc-4.8 + build_type: Release + cxxstd: 11 + arch: 32 + packages: 'g++-4.8-multilib gcc-4.8-multilib g++-multilib gcc-multilib' + cmake: 3.13.* os: ubuntu-18.04 - } - - { - compiler: clang++, - build_type: Release, - cxxstd: 11, - arch: 64, - packages: 'clang', - cmake: 3.13.*, + + - cxx_compiler: g++-5 + c_compiler: gcc-5 + build_type: Release + cxxstd: 11 + arch: 64 + packages: 'g++-5-multilib gcc-5-multilib' + cmake: 3.13.* os: ubuntu-18.04 - } - - { - compiler: clang++, - build_type: Debug, - cxxstd: 11, - arch: 64, - packages: 'clang', - cmake: 3.17.*, - os: ubuntu-20.04, - } - - { - compiler: clang++, - build_type: Release, - cxxstd: 14, - arch: 64, - packages: 'clang', - cmake: 3.17.*, - os: ubuntu-20.04 - } - - { - compiler: g++, - build_type: Release, - cxxstd: 11, - arch: 64, - packages: 'g++', - cmake: 3.22.*, + + - cxx_compiler: g++-6 + c_compiler: gcc-6 + build_type: Release + cxxstd: 11 + arch: 64 + packages: 'g++-6-multilib gcc-6-multilib' + cmake: 3.13.* + os: ubuntu-18.04 + + - cxx_compiler: g++-7 + c_compiler: gcc-7 + build_type: Release + cxxstd: 11 + arch: 64 + packages: 'g++-7-multilib gcc-7-multilib' + cmake: 3.13.* + os: ubuntu-18.04 + + - cxx_compiler: g++-8 + c_compiler: gcc-8 + build_type: Release + cxxstd: 11 + arch: 64 + packages: 'g++-8-multilib gcc-8-multilib' + cmake: 3.13.* + os: ubuntu-18.04 + + - cxx_compiler: g++-9 + c_compiler: gcc-9 + build_type: Release + cxxstd: 11 + arch: 64 + packages: 'g++-9-multilib gcc-9-multilib' + cmake: 3.13.* + os: ubuntu-18.04 + + - cxx_compiler: g++-10 + c_compiler: gcc-10 + build_type: Release + cxxstd: 11 + arch: 64 + packages: 'g++-10-multilib gcc-10-multilib' + cmake: 3.13.* + os: ubuntu-18.04 + + - cxx_compiler: g++-11 + c_compiler: gcc-11 + build_type: Release + cxxstd: 17 + arch: 64 + packages: 'g++' + cmake: 3.22.* + os: ubuntu-22.04 + + - cxx_compiler: g++-11 + c_compiler: gcc-11 + build_type: Release + cxxstd: 20 + arch: 64 + packages: 'g++' + cmake: 3.22.* os: ubuntu-22.04 - } + + - cxx_compiler: clang++-7 + c_compiler: clang-7 + build_type: Release + cxxstd: 11 + arch: 64 + packages: 'clang-7' + cmake: 3.13.* + os: ubuntu-18.04 + + - cxx_compiler: clang++-8 + c_compiler: clang-8 + build_type: Release + cxxstd: 11 + arch: 64 + packages: 'clang-8' + cmake: 3.13.* + os: ubuntu-18.04 + + - cxx_compiler: clang++-9 + c_compiler: clang-9 + build_type: Release + cxxstd: 11 + arch: 64 + packages: 'clang-9' + cmake: 3.13.* + os: ubuntu-18.04 + + - cxx_compiler: clang++-10 + c_compiler: clang + build_type: Debug + cxxstd: 11 + arch: 64 + packages: 'clang' + cmake: 3.17.* + os: ubuntu-20.04 + + - cxx_compiler: clang++-10 + c_compiler: clang + build_type: Release + cxxstd: 14 + arch: 64 + packages: 'clang' + cmake: 3.17.* + os: ubuntu-20.04 + runs-on: ${{ matrix.ci.os }} steps: @@ -97,7 +180,7 @@ jobs: mkdir build.cmake cd build.cmake cmake --version - cmake ${{ matrix.ci.cmake_extra }} -DCMAKE_CXX_COMPILER=${{ matrix.ci.compiler }} -DCMAKE_CXX_STANDARD=${{ matrix.ci.cxxstd }} -DBUILD_DOCUMENTATION=YES -DCMAKE_BUILD_TYPE=${{ matrix.ci.build_type }} .. + cmake ${{ matrix.ci.cmake_extra }} -DCMAKE_C_COMPILER=${{ matrix.ci.c_compiler }} -DCMAKE_CXX_COMPILER=${{ matrix.ci.cxx_compiler }} -DCMAKE_CXX_STANDARD=${{ matrix.ci.cxxstd }} -DBUILD_DOCUMENTATION=YES -DCMAKE_BUILD_TYPE=${{ matrix.ci.build_type }} .. make -j 2 cmake --build . --target docs @@ -232,25 +315,75 @@ jobs: cd build ctest --output-on-failure -C Release - # windows-msvc-17: - # name: 'Windows (Visual Studio 2017, Release, windows-2016)' - # runs-on: windows-2016 - # steps: - # - name: 'Check Out' - # uses: actions/checkout@v2 - - # - name: 'Build' - # run: | - # mkdir build - # cd build - # cmake --version - # cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=11 -DBUILD_SHARED_LIBS=ON .. - # cmake --build . --config Release -j 2 - - # - name: 'Test' - # run: | - # cd build - # ctest --output-on-failure -C Release + macos: + name: 'macOS clang' + strategy: + matrix: + xcode: [11.7, 12.4, 13.2.1] + cxxstd: [11] + build_type: ['Debug'] + include: + - xcode: 13.2.1 + cxxstd: 14 + build_type: Debug + - xcode: 13.2.1 + cxxstd: 17 + build_type: Debug + - xcode: 13.2.1 + cxxstd: 20 + build_type: Debug + + runs-on: macos-11 + steps: + + - name: 'Install' + env: + XCODE_APP: /Applications/XCode_${{ matrix.xcode }}.app + run: | + set -e + uname -a + sudo xcode-select -switch ${XCODE_APP} + which clang++ + clang++ --version + + - name: 'Check Out' + uses: actions/checkout@v2 + + - name: 'Build' + env: + BUILD_TYPE: ${{ matrix.build_type }} + CXX_STANDARD: ${{ matrix.cxxstd }} + run: | + set -e + mkdir build + cd build + cmake --version + cmake -DCMAKE_CXX_STANDARD=${CXX_STANDARD} -DCMAKE_BUILD_TYPE=${BUILD_TYPE} .. + cmake --build . --config ${BUILD_TYPE} -j 3 + + - name: 'Test' + run: | + cd build + ctest -V --output-on-failure -C ${BUILD_TYPE} + + + code-quality: + name: Code quality checks + runs-on: ubuntu-latest + steps: + - name: Install + run: | + set -e + sudo -E apt-get update + sudo -E apt-get -yq --no-install-suggests --no-install-recommends install cppcheck + + - name: 'Check Out' + uses: actions/checkout@v2 + + - name: 'cppcheck' + run: | + ./tools/cppcheck.sh + cmake-subproject: name: 'CMake Subproject' diff --git a/README.md b/README.md index 6b6a14ad24..265494f9bb 100644 --- a/README.md +++ b/README.md @@ -17,9 +17,9 @@ The official Git repository is at [GitHub](https://github.com/libgeos/geos). | CI | Status | CI | Status | CI | Status | | :---: | :----- | :---: | :----- | :---: | :----- | | GitHub | [![github](https://github.com/libgeos/geos/workflows/CI/badge.svg?branch/main)](https://github.com/libgeos/geos/actions?query=workflow:CI+branch:main) | Bessie | [![bessie](https://debbie.postgis.net/buildStatus/icon?job=GEOS_Worker_Run/label=bessie&build=last:${params.reference=refs/heads/main})](https://debbie.postgis.net/view/GEOS/job/GEOS_Worker_Run/label=bessie) | Debbie | [![debbie](https://debbie.postgis.net/buildStatus/icon?job=GEOS_Master)](https://debbie.postgis.net/view/GEOS/job/GEOS_Master/) | -| Azure | [![Build Status](https://dev.azure.com/libgeos/geos/_apis/build/status/libgeos.geos?branchName=main)](https://dev.azure.com/libgeos/geos/_build/latest?definitionId=2&branchName=main) | Bessie32 | [![bessie32](https://debbie.postgis.net/buildStatus/icon?job=GEOS_Worker_Run/label=bessie32&build=last:${params.reference=refs/heads/main})](https://debbie.postgis.net/view/GEOS/job/GEOS_Worker_Run/label=bessie32) | Winnie | [![winnie](https://winnie.postgis.net/view/GEOS/job/GEOS_Master/badge/icon)](https://winnie.postgis.net/view/GEOS/job/GEOS_Master/) | +| AppVeyor | [![appveyor](https://ci.appveyor.com/api/projects/status/62aplwst722b89au/branch/main?svg=true)](https://ci.appveyor.com/project/dbaston/geos/branch/main) | Bessie32 | [![bessie32](https://debbie.postgis.net/buildStatus/icon?job=GEOS_Worker_Run/label=bessie32&build=last:${params.reference=refs/heads/main})](https://debbie.postgis.net/view/GEOS/job/GEOS_Worker_Run/label=bessie32) | Winnie | [![winnie](https://winnie.postgis.net/view/GEOS/job/GEOS_Master/badge/icon)](https://winnie.postgis.net/view/GEOS/job/GEOS_Master/) | | GitLab CI | [![gitlab-ci](https://gitlab.com/geos/libgeos/badges/main/pipeline.svg)](https://gitlab.com/geos/libgeos/commits/main) | Berrie | [![berrie](https://debbie.postgis.net/buildStatus/icon?job=GEOS_Worker_Run/label=berrie&build=last:${params.reference=refs/heads/main})](https://debbie.postgis.net/view/GEOS/job/GEOS_Worker_Run/label=berrie) | Dronie | [![dronie](https://dronie.osgeo.org/api/badges/geos/geos/status.svg?branch=main)](https://dronie.osgeo.org/geos/geos?branch=master) | -| AppVeyor | [![appveyor](https://ci.appveyor.com/api/projects/status/62aplwst722b89au/branch/main?svg=true)](https://ci.appveyor.com/project/dbaston/geos/branch/main) | Berrie64 | [![berrie64](https://debbie.postgis.net/buildStatus/icon?job=GEOS_Worker_Run/label=berrie64&build=last:${params.reference=refs/heads/main})](https://debbie.postgis.net/view/GEOS/job/GEOS_Worker_Run/label=berrie64) | +| | | Berrie64 | [![berrie64](https://debbie.postgis.net/buildStatus/icon?job=GEOS_Worker_Run/label=berrie64&build=last:${params.reference=refs/heads/main})](https://debbie.postgis.net/view/GEOS/job/GEOS_Worker_Run/label=berrie64) | ## Community Resources