<commit_before>name: CMake Build Matrix
# Many thanks to <NAME> for examples
# e.g. https://github.com/cristianadam/HelloWorld/blob/master/.github/workflows/build_cmake.yml
# https://cristianadam.eu/20191222/using-github-actions-with-c-plus-plus-and-cmake/


on: [push, pull_request, workflow_dispatch]

env:
  QT_VERSION: 5.12.12
  # this is different from MACOSX_DEPLOYMENT_TARGET to prevent build problems
  # we set MACOSX_DEPLOYMENT_TARGET later
  MACOS_TARGET: 10.12
  FEATURES: -DUSE_VTK=ON -DBUILD_GPL_PLUGINS=ON -DWITH_COORDGEN=OFF

jobs:
  build:
    name: ${{ matrix.config.name }}
    runs-on: ${{ matrix.config.os }}
    strategy:
      fail-fast: false
      matrix:
        config:
        - {
            name: "Ubuntu 20.04 GCC", artifact: "Ubuntu-2004.tar.gz",
            os: ubuntu-20.04,
            cc: "gcc", cxx: "g++",
            build_type: "Release",
            cmake_flags: "-G Ninja -DENABLE_TESTING=ON -DTEST_QTGL=OFF -DCMAKE_BUILD_TYPE=Release",
            cpack: "",
          }
        - {
            name: "Ubuntu 18.04 AppImage", artifact: "Avogadro2.AppImage",
            os: ubuntu-18.04,
            cc: "gcc", cxx: "g++",
            build_type: "Release",
            cmake_flags: "-G Ninja -DINSTALL_BUNDLE_FILES=ON -DCMAKE_BUILD_TYPE=Release",
            cpack: "",
          }
        - {
            name: "macOS Latest Clang", artifact: "macOS.dmg",
            os: macos-latest,
            cc: "clang", cxx: "clang++",
            build_type: "Release",
            cmake_flags: "-G Ninja",
            cpack_flags: "-G DragNDrop",
          }
        - {
            name: "macOS M1", artifact: "macOS-m1.dmg",
            os: [self-hosted, macOS],
            cc: "clang", cxx: "clang++",
            build_type: "Release",
            cmake_flags: "-G Ninja",
            cpack_flags: "-G DragNDrop",
          }
        - {
            name: "Windows Latest MSVC", artifact: "Win64.exe",
            os: windows-latest,
            cc: "cl", cxx: "cl",
            build_type: "Release",
            cmake_flags: " ",
            build_flags: "-j 2",
            cpack_flags: "-G NSIS",
          }
        - {
            name: "Ubuntu Address Sanitizer", artifact: "",
            os: ubuntu-20.04,
            cc: "gcc", cxx: "g++",
            build_type: "asan",
            cmake_flags: "-G Ninja -DENABLE_TESTING=ON -DTEST_QTGL=OFF",
            cpack: "",
          }
        - {
            name: "Ubuntu Leak Sanitizer", artifact: "",
            os: ubuntu-20.04,
            cc: "gcc", cxx: "g++",
            build_type: "lsan",
            cmake_flags: "-G Ninja -DENABLE_TESTING=ON -DTEST_QTGL=OFF",
            cpack: "",
          }
        - {
            name: "Ubuntu Thread Sanitizer", artifact: "",
            os: ubuntu-20.04,
            cc: "gcc", cxx: "g++",
            build_type: "tsan",
            cmake_flags: "-G Ninja -DENABLE_TESTING=ON -DTEST_QTGL=OFF",
            cpack: "",
          }
        - {
            name: "Ubuntu Undefined Behavior Sanitizer", artifact: "",
            os: ubuntu-20.04,
            cc: "gcc", cxx: "g++",
            build_type: "ubsan",
            cmake_flags: "-G Ninja -DENABLE_TESTING=ON -DTEST_QTGL=OFF",
            cpack: "",
          }

    steps:

    - name: Install Dependencies (Linux)
      if: runner.os == 'Linux'
      run: |
        sudo apt-get -qq update
        sudo apt-get -qq install ninja-build libeigen3-dev libboost-all-dev libglew-dev libxml2-dev qt5-default libqt5x11extras5-dev libqt5svg5-dev
    - name: Install Dependencies (macOS)
      if: runner.os == 'macOS'
      run: |
        brew install ninja eigen glew
    - name: Install Dependencies (Windows)
      if: runner.os == 'Windows'
      run: choco install ninja

    - name: Checkout openchemistry
      uses: actions/checkout@v2
      with:
        repository: openchemistry/openchemistry
        submodules: recursive

    - name: Checkout avogadroapp
      uses: actions/checkout@v2
      with:
        repository: openchemistry/avogadroapp
        path: avogadroapp

    - name: Checkout avogadrolibs
      uses: actions/checkout@v2
      with:
        path: avogadrolibs

    - name: Cache Qt
      id: cache-qt
      uses: actions/cache@v2
      with:
        path: ../Qt
        key: ${{ runner.os }}-QtCache

    - name: Install Qt
      uses: jurplel/install-qt-action@v2
      with:
        cached: ${{ steps.cache-qt.outputs.cache-hit }}
        version: ${{ env.QT_VERSION }}

    - name: Configure MSVC Command Prompt
      if: runner.os == 'Windows'
      uses: ilammy/msvc-dev-cmd@v1
      with:
        arch: x64

    - name: Grab cache files
      uses: actions/cache@v2
      if: runner.os != 'Windows'
      with:
        path: |
          ${{ runner.workspace }}/build/thirdparty
          ${{ runner.workspace }}/build/Downloads
        key: ${{ matrix.config.name }}-thirdparty

    - name: Configure
      run: |
        if [ ! -d "${{ runner.workspace }}/build" ]; then mkdir "${{ runner.workspace }}/build"; fi
        cd "${{ runner.workspace }}/build"
        # won't have any effect except on Mac
        echo "MACOSX_DEPLOYMENT_TARGET=${{ env.MACOS_TARGET }}" >> $GITHUB_ENV
        CC=${{matrix.config.cc}} CXX=${{matrix.config.cxx}} cmake $GITHUB_WORKSPACE ${{env.FEATURES}} -DCMAKE_BUILD_TYPE=${{matrix.config.build_type}} ${{matrix.config.cmake_flags}}
      shell: bash

    - name: Build
      run: |
        CC=${{matrix.config.cc}} CXX=${{matrix.config.cxx}} cmake --build . --config ${{matrix.config.build_type}} ${{matrix.config.build_flags}}<commit_msg>Avoid setup python (fails on selfhosted)<commit_after>name: CMake Build Matrix
# Many thanks to <NAME> for examples
# e.g. https://github.com/cristianadam/HelloWorld/blob/master/.github/workflows/build_cmake.yml
# https://cristianadam.eu/20191222/using-github-actions-with-c-plus-plus-and-cmake/


on: [push, pull_request, workflow_dispatch]

env:
  QT_VERSION: 5.12.12
  # this is different from MACOSX_DEPLOYMENT_TARGET to prevent build problems
  # we set MACOSX_DEPLOYMENT_TARGET later
  MACOS_TARGET: 10.12
  FEATURES: -DUSE_VTK=ON -DBUILD_GPL_PLUGINS=ON -DWITH_COORDGEN=OFF

jobs:
  build:
    name: ${{ matrix.config.name }}
    runs-on: ${{ matrix.config.os }}
    strategy:
      fail-fast: false
      matrix:
        config:
        - {
            name: "Ubuntu 20.04 GCC", artifact: "Ubuntu-2004.tar.gz",
            os: ubuntu-20.04,
            cc: "gcc", cxx: "g++",
            build_type: "Release",
            cmake_flags: "-G Ninja -DENABLE_TESTING=ON -DTEST_QTGL=OFF -DCMAKE_BUILD_TYPE=Release",
            cpack: "",
          }
        - {
            name: "Ubuntu 18.04 AppImage", artifact: "Avogadro2.AppImage",
            os: ubuntu-18.04,
            cc: "gcc", cxx: "g++",
            build_type: "Release",
            cmake_flags: "-G Ninja -DINSTALL_BUNDLE_FILES=ON -DCMAKE_BUILD_TYPE=Release",
            cpack: "",
          }
        - {
            name: "macOS Latest Clang", artifact: "macOS.dmg",
            os: macos-latest,
            cc: "clang", cxx: "clang++",
            build_type: "Release",
            cmake_flags: "-G Ninja",
            cpack_flags: "-G DragNDrop",
          }
        - {
            name: "macOS M1", artifact: "macOS-m1.dmg",
            os: [self-hosted, macOS],
            cc: "clang", cxx: "clang++",
            build_type: "Release",
            cmake_flags: "-G Ninja",
            cpack_flags: "-G DragNDrop",
          }
        - {
            name: "Windows Latest MSVC", artifact: "Win64.exe",
            os: windows-latest,
            cc: "cl", cxx: "cl",
            build_type: "Release",
            cmake_flags: " ",
            build_flags: "-j 2",
            cpack_flags: "-G NSIS",
          }
        - {
            name: "Ubuntu Address Sanitizer", artifact: "",
            os: ubuntu-20.04,
            cc: "gcc", cxx: "g++",
            build_type: "asan",
            cmake_flags: "-G Ninja -DENABLE_TESTING=ON -DTEST_QTGL=OFF",
            cpack: "",
          }
        - {
            name: "Ubuntu Leak Sanitizer", artifact: "",
            os: ubuntu-20.04,
            cc: "gcc", cxx: "g++",
            build_type: "lsan",
            cmake_flags: "-G Ninja -DENABLE_TESTING=ON -DTEST_QTGL=OFF",
            cpack: "",
          }
        - {
            name: "Ubuntu Thread Sanitizer", artifact: "",
            os: ubuntu-20.04,
            cc: "gcc", cxx: "g++",
            build_type: "tsan",
            cmake_flags: "-G Ninja -DENABLE_TESTING=ON -DTEST_QTGL=OFF",
            cpack: "",
          }
        - {
            name: "Ubuntu Undefined Behavior Sanitizer", artifact: "",
            os: ubuntu-20.04,
            cc: "gcc", cxx: "g++",
            build_type: "ubsan",
            cmake_flags: "-G Ninja -DENABLE_TESTING=ON -DTEST_QTGL=OFF",
            cpack: "",
          }

    steps:

    - name: Install Dependencies (Linux)
      if: runner.os == 'Linux'
      run: |
        sudo apt-get -qq update
        sudo apt-get -qq install ninja-build libeigen3-dev libboost-all-dev libglew-dev libxml2-dev qt5-default libqt5x11extras5-dev libqt5svg5-dev
    - name: Install Dependencies (macOS)
      if: runner.os == 'macOS'
      run: |
        brew install ninja eigen glew
    - name: Install Dependencies (Windows)
      if: runner.os == 'Windows'
      run: choco install ninja

    - name: Checkout openchemistry
      uses: actions/checkout@v2
      with:
        repository: openchemistry/openchemistry
        submodules: recursive

    - name: Checkout avogadroapp
      uses: actions/checkout@v2
      with:
        repository: openchemistry/avogadroapp
        path: avogadroapp

    - name: Checkout avogadrolibs
      uses: actions/checkout@v2
      with:
        path: avogadrolibs

    - name: Cache Qt
      id: cache-qt
      uses: actions/cache@v2
      with:
        path: ../Qt
        key: ${{ runner.os }}-QtCache

    - name: Install Qt
      uses: jurplel/install-qt-action@v2
      with:
        cached: ${{ steps.cache-qt.outputs.cache-hit }}
        version: ${{ env.QT_VERSION }}
        setup-python: 'false'

    - name: Configure MSVC Command Prompt
      if: runner.os == 'Windows'
      uses: ilammy/msvc-dev-cmd@v1
      with:
        arch: x64

    - name: Grab cache files
      uses: actions/cache@v2
      if: runner.os != 'Windows'
      with:
        path: |
          ${{ runner.workspace }}/build/thirdparty
          ${{ runner.workspace }}/build/Downloads
        key: ${{ matrix.config.name }}-thirdparty

    - name: Configure
      run: |
        if [ ! -d "${{ runner.workspace }}/build" ]; then mkdir "${{ runner.workspace }}/build"; fi
        cd "${{ runner.workspace }}/build"
        # won't have any effect except on Mac
        echo "MACOSX_DEPLOYMENT_TARGET=${{ env.MACOS_TARGET }}" >> $GITHUB_ENV
        CC=${{matrix.config.cc}} CXX=${{matrix.config.cxx}} cmake $GITHUB_WORKSPACE ${{env.FEATURES}} -DCMAKE_BUILD_TYPE=${{matrix.config.build_type}} ${{matrix.config.cmake_flags}}
      shell: bash

    - name: Build
      run: |
        CC=${{matrix.config.cc}} CXX=${{matrix.config.cxx}} cmake --build . --config ${{matrix.config.build_type}} ${{matrix.config.build_flags}}
{'fraction_non_alphanumeric': 0.13706888908591186, 'fraction_numerical': 0.013653692703253834, 'mean_word_length': 1.8607659142784683, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1861918', 'n_tokens_mistral': 3981, 'n_tokens_neox': 3717, 'n_words': 816}