diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..e45e7b1 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,94 @@ +name: CI +on: [push, pull_request] + +jobs: + # Here we're keeping on arbitrary LLVM version fixed and varying GCC. + linux-gcc: + strategy: + fail-fast: false + matrix: + image: + # List: https://github.com/conan-io/conan-docker-tools + - gcc10 + - gcc9 + - gcc8 + - gcc7 + - gcc6 + + runs-on: ubuntu-latest + container: + image: conanio/${{matrix.image}} + options: --user root + + steps: + - uses: actions/checkout@v2 + - name: Create Build Environment + run: cmake -E make_directory build + - name: Install libclang + run: apt-get -qq update && apt-get install -y llvm clang libclang-dev + - name: Install ninja + run: type ninja || apt-get install -y ninja-build + + - name: Configure + working-directory: build/ + run: cmake -GNinja $GITHUB_WORKSPACE + - name: Build + working-directory: build/ + run: cmake --build . + - name: Test + working-directory: build/ + run: ctest --output-on-failure + + # Here we're varying the LLVM version and using its clang for compiling as well. + linux-clang: + strategy: + fail-fast: false + matrix: + version: [7, 8, 9, 10] + + runs-on: ubuntu-latest + container: + # Just one of the newer images. + image: conanio/gcc10 + options: --user root + + steps: + - uses: actions/checkout@v2 + - name: Create Build Environment + run: cmake -E make_directory build + - name: Install libclang + run: apt-get -qq update && apt-get install -y llvm-${{matrix.version}} clang-${{matrix.version}} libclang-${{matrix.version}}-dev + - name: Install ninja + run: type ninja || apt-get install -y ninja-build + + - name: Configure + working-directory: build/ + run: cmake -GNinja $GITHUB_WORKSPACE -DCMAKE_CXX_COMPILER=clang++-${{matrix.version}} + - name: Build + working-directory: build/ + run: cmake --build . + - name: Test + working-directory: build/ + run: ctest --output-on-failure + + macos: + runs-on: macos-latest + + steps: + - uses: actions/checkout@v2 + - name: Create Build Environment + run: cmake -E make_directory build + - name: Install ninja + run: brew install ninja + + - name: Configure + working-directory: build/ + run: cmake -GNinja $GITHUB_WORKSPACE -DLLVM_CONFIG_BINARY="/usr/local/opt/llvm/bin/llvm-config" + - name: Build + working-directory: build/ + run: cmake --build . + - name: Test + working-directory: build/ + run: ctest --output-on-failure + + diff --git a/README.md b/README.md index 736196e..1f9d709 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,5 @@ # cppast -[![Build Status](https://dev.azure.com/foonathan/cppast/_apis/build/status/foonathan.cppast?branchName=master)](https://dev.azure.com/foonathan/cppast/_build/latest?definitionId=7&branchName=master) -[![Build status](https://ci.appveyor.com/api/projects/status/8gp5btjq7eassvn7?svg=true)](https://ci.appveyor.com/project/foonathan/cppast) - Library interface to the C++ AST — parse source files, synthesize entities, get documentation comments and generate code. > |[![](https://www.jonathanmueller.dev/embarcadero-logo.png)](https://www.embarcadero.com/de/products/cbuilder/starter) | Sponsored by [Embarcadero C++Builder](https://www.embarcadero.com/de/products/cbuilder/starter). | diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 3db0470..0000000 --- a/appveyor.yml +++ /dev/null @@ -1,11 +0,0 @@ -version: '{build}' -build_script: - - cmd: mkdir build\ && cd build\ - - cmd: call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x64 - - cmd: clang++ --version - - cmd: cmake -G"Visual Studio 14 2015 Win64" -DLLVM_VERSION_EXPLICIT=4.0.0 -DLIBCLANG_LIBRARY="C:/Program Files/LLVM/lib/libclang.lib" -DLIBCLANG_INCLUDE_DIR="C:/Program Files/LLVM/include" -DCLANG_BINARY="C:/Program Files/LLVM/bin/clang++.exe" ../ - - - cmd: cmake --build . -- /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" /verbosity:minimal - -test_script: - - cmd: test\Debug\cppast_test.exe * ~cppast diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index 88458e3..0000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,68 +0,0 @@ -name: 'CI build' -trigger: - branches: - include: - - master - - feature/* - paths: - exclude: - - README.md - -jobs: - - job: compiler_linux - pool: - vmImage: 'Ubuntu 16.04' - strategy: - matrix: - GCC5: - IMAGE: 'conanio/gcc5' - GCC6: - IMAGE: 'conanio/gcc6' - GCC7: - IMAGE: 'conanio/gcc7' - GCC8: - IMAGE: 'conanio/gcc8' - steps: - - script: docker run --privileged -u root -v "$PWD:/cppast" $(IMAGE) bash -c "apt-get -qq update && apt-get -qq install -y --no-install-recommends llvm-4.0-dev clang-4.0 libclang-4.0-dev && cmake /cppast/ && cmake --build . && ctest --output-on-failure -R test" - displayName: "Compiling using $(IMAGE)" - - - job: llvm_linux - pool: - vmImage: 'Ubuntu 16.04' - strategy: - matrix: - LLVM4: - IMAGE: 'foonathan/micro_cpp_llvm:llvm4' - LLVM5: - IMAGE: 'foonathan/micro_cpp_llvm:llvm5' - LLVM6: - IMAGE: 'foonathan/micro_cpp_llvm:llvm6' - LLVM7: - IMAGE: 'foonathan/micro_cpp_llvm:llvm7' - LLVM8: - IMAGE: 'foonathan/micro_cpp_llvm:llvm8' - steps: - - script: docker run -u root -v "$PWD:/cppast" $(IMAGE) bash -c "cmake -DCMAKE_CXX_COMPILER=clang++ /cppast/ && cmake --build . && ctest --output-on-failure -R test" - displayName: "Compiling using $(IMAGE)" - - - job: llvm_macos - pool: - vmImage: 'macOS-10.14' - strategy: - matrix: - LLVM4: - URL: 'http://releases.llvm.org/4.0.0/clang+llvm-4.0.0-x86_64-apple-darwin.tar.xz' - EXCLUDE: 'integration' - LLVM5: - URL: 'http://releases.llvm.org/5.0.2/clang+llvm-5.0.2-x86_64-apple-darwin.tar.xz' - LLVM6: - URL: 'http://releases.llvm.org/6.0.0/clang+llvm-6.0.0-x86_64-apple-darwin.tar.xz' - LLVM7: - URL: 'http://releases.llvm.org/7.0.0/clang+llvm-7.0.0-x86_64-apple-darwin.tar.xz' - LLVM8: - URL: 'http://releases.llvm.org/8.0.0/clang+llvm-8.0.0-x86_64-apple-darwin.tar.xz' - steps: - - script: | - mkdir build && cd build/ - cmake -DLLVM_DOWNLOAD_URL=$URL ../ && cmake --build . && ctest --output-on-failure -R test -E $EXCLUDE - displayName: "Compiling using $(URL)"