<commit_before>name: CI

on:
  push:
    branches:
      - v1.x
      - ci-test
  pull_request:
    branches:
      - v1.x

defaults:
  run:
    shell: bash

jobs:
  commit-msg:
    name: Commit message check
    runs-on: ubuntu-18.04
    strategy:
      fail-fast: true
    steps:
    - uses: actions/checkout@v2
      with:
        fetch-depth: 100
    - name: Check commit messages
      run: |
        if git log --oneline | tail -n +2 | head -n 100 | cut -d ' ' -f2- | grep -q '.\{73\}'; then
          (echo -n "::error::";
           echo "Some commit message summary lines are too long. See CONTRIBUTING.md for more information.";
           echo "Invalid commits:";
           echo;
           git log --oneline | tail -n +2 | head -n 100 | cut -d ' ' -f2- | grep '.\{73\}';) | tr '\n' '\001' | sed -e 's#\x01#%0A#g';
          exit 1;
        fi
  clang-format:
    name: Code formatting check
    runs-on: ubuntu-18.04
    strategy:
      fail-fast: true
    steps:
    - uses: actions/checkout@v2
      with:
        fetch-depth: 5
    - name: Add LLVM apt repository
      run: |
        wget -O - http://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
        sudo add-apt-repository -y 'deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-3.8 main'
    - name: Install clang-format-3.8
      run: |
        sudo apt-get update -qq
        sudo apt-get install -y -qq clang-format-3.8 
    - name: Run clang-format-3.8
      run: |
        . ./util/clang_format_all.sh
        git clean -f
    - name: Check formatting
      run: |
        git diff --quiet || (
          (echo -n "::error::";
          echo "clang-format issues were found. See CONTRIBUTING.md for more information.";
          echo;
          git diff;) | tr '\n' '\001' | sed -e 's#\x01#%0A#g';
          exit 1;
        )
  windows:
    name: Windows
    needs: [commit-msg, clang-format]
    runs-on: windows-2019
    strategy:
      fail-fast: false
      matrix:
        name: [ VS2015 x86 Development, VS2015 x64 Development, VS2015 x64 Release, VS2017 x64 Development, VS2019 x64 Development ]
        include:
          - name: VS2015 x86 Development
            compiler: VS2015
            toolset: v140
            platform: x86
            configuration: Development
          - name: VS2015 x64 Development
            compiler: VS2015
            toolset: v140
            platform: x64
            configuration: Development
          - name: VS2015 x64 Release
            compiler: VS2015
            toolset: v140
            platform: x64
            configuration: Release
          - name: VS2017 x64 Development
            compiler: VS2017
            toolset: v141
            platform: x64
            configuration: Development
          - name: VS2019 x64 Development
            compiler: VS2019
            toolset: v142
            platform: x64
            configuration: Development
    steps:
    - uses: actions/checkout@v2
      with:
        fetch-depth: 5
    - name: Download optional 3rdparty extras
      run: |
        curl https://renderdoc.org/qrenderdoc_3rdparty.zip -O
        7z x qrenderdoc_3rdparty.zip
    - name: Set up Visual Studio tools
      uses: microsoft/setup-msbuild@v1.0.2
    - name: Building solution
      run: msbuild.exe renderdoc.sln "/m" "/p:Configuration=${{ matrix.configuration }}" "/p:Platform=${{ matrix.platform }}" "/p:PlatformToolset=${{ matrix.toolset }}"
      shell: powershell
    - if: matrix.configuration == 'Development'
      name: Running core unit tests
      run: |
        if ! ./*/Development/renderdoccmd.exe test unit -o test.log; then
          echo "::error::$(cat test.log)" | tr -d '\r' |  tr '\n' '\001' | sed -e 's#\x01#%0D%0A#g';
          exit 1;
        fi
    - if: matrix.configuration == 'Development'
      name: Running UI unit tests
      run: |
        if ! ./*/Development/qrenderdoc.exe --unittest test.log; then
          echo "::error::$(cat test.log)" | tr -d '\r' |  tr '\n' '\001' | sed -e 's#\x01#%0D%0A#g';
          exit 1;
        fi
  docs:
    name: Documentation Build
    needs: [commit-msg, clang-format]
    runs-on: ubuntu-18.04
    env:
      QT_SELECT: qt5
    steps:
    - uses: actions/checkout@v2
      with:
        fetch-depth: 5
    - name: Install compilation dependencies
      run: |
        sudo apt-get update -qq
        sudo apt-get install -y -qq libx11-dev mesa-common-dev libgl1-mesa-dev qtbase5-dev libxcb-keysyms1-dev
    - name: Install sphinx dependencies
      run: sudo pip3 install Sphinx==3.4.0
    - name: Build cut-down renderdoc for python modules
      run: |
        mkdir build
        pushd build
        cmake -DCMAKE_BUILD_TYPE=Debug -DENABLE_GL=OFF -DENABLE_GLES=OFF -DENABLE_VULKAN=OFF -DENABLE_RENDERDOCCMD=OFF -DENABLE_QRENDERDOC=OFF ..
        make -j2
        popd
    - name: Build documentation
      run: |
        cd docs
        make html SPHINXOPTS=-W
        python3 verify-docstrings.py
  linux:
    name: Linux
    needs: [commit-msg, clang-format]
    runs-on: ubuntu-18.04
    env:
      QT_SELECT: qt5
    strategy:
      fail-fast: false
      matrix:
        name: [ GCC 5 Development, Clang 3.8 Development, Clang 3.8 Release, Clang 9 Development ]
        include:<commit_msg>Sphinx version with bugfix has been released, stop requiring 3.4.0 in CI<commit_after>name: CI

on:
  push:
    branches:
      - v1.x
      - ci-test
  pull_request:
    branches:
      - v1.x

defaults:
  run:
    shell: bash

jobs:
  commit-msg:
    name: Commit message check
    runs-on: ubuntu-18.04
    strategy:
      fail-fast: true
    steps:
    - uses: actions/checkout@v2
      with:
        fetch-depth: 100
    - name: Check commit messages
      run: |
        if git log --oneline | tail -n +2 | head -n 100 | cut -d ' ' -f2- | grep -q '.\{73\}'; then
          (echo -n "::error::";
           echo "Some commit message summary lines are too long. See CONTRIBUTING.md for more information.";
           echo "Invalid commits:";
           echo;
           git log --oneline | tail -n +2 | head -n 100 | cut -d ' ' -f2- | grep '.\{73\}';) | tr '\n' '\001' | sed -e 's#\x01#%0A#g';
          exit 1;
        fi
  clang-format:
    name: Code formatting check
    runs-on: ubuntu-18.04
    strategy:
      fail-fast: true
    steps:
    - uses: actions/checkout@v2
      with:
        fetch-depth: 5
    - name: Add LLVM apt repository
      run: |
        wget -O - http://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
        sudo add-apt-repository -y 'deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-3.8 main'
    - name: Install clang-format-3.8
      run: |
        sudo apt-get update -qq
        sudo apt-get install -y -qq clang-format-3.8 
    - name: Run clang-format-3.8
      run: |
        . ./util/clang_format_all.sh
        git clean -f
    - name: Check formatting
      run: |
        git diff --quiet || (
          (echo -n "::error::";
          echo "clang-format issues were found. See CONTRIBUTING.md for more information.";
          echo;
          git diff;) | tr '\n' '\001' | sed -e 's#\x01#%0A#g';
          exit 1;
        )
  windows:
    name: Windows
    needs: [commit-msg, clang-format]
    runs-on: windows-2019
    strategy:
      fail-fast: false
      matrix:
        name: [ VS2015 x86 Development, VS2015 x64 Development, VS2015 x64 Release, VS2017 x64 Development, VS2019 x64 Development ]
        include:
          - name: VS2015 x86 Development
            compiler: VS2015
            toolset: v140
            platform: x86
            configuration: Development
          - name: VS2015 x64 Development
            compiler: VS2015
            toolset: v140
            platform: x64
            configuration: Development
          - name: VS2015 x64 Release
            compiler: VS2015
            toolset: v140
            platform: x64
            configuration: Release
          - name: VS2017 x64 Development
            compiler: VS2017
            toolset: v141
            platform: x64
            configuration: Development
          - name: VS2019 x64 Development
            compiler: VS2019
            toolset: v142
            platform: x64
            configuration: Development
    steps:
    - uses: actions/checkout@v2
      with:
        fetch-depth: 5
    - name: Download optional 3rdparty extras
      run: |
        curl https://renderdoc.org/qrenderdoc_3rdparty.zip -O
        7z x qrenderdoc_3rdparty.zip
    - name: Set up Visual Studio tools
      uses: microsoft/setup-msbuild@v1.0.2
    - name: Building solution
      run: msbuild.exe renderdoc.sln "/m" "/p:Configuration=${{ matrix.configuration }}" "/p:Platform=${{ matrix.platform }}" "/p:PlatformToolset=${{ matrix.toolset }}"
      shell: powershell
    - if: matrix.configuration == 'Development'
      name: Running core unit tests
      run: |
        if ! ./*/Development/renderdoccmd.exe test unit -o test.log; then
          echo "::error::$(cat test.log)" | tr -d '\r' |  tr '\n' '\001' | sed -e 's#\x01#%0D%0A#g';
          exit 1;
        fi
    - if: matrix.configuration == 'Development'
      name: Running UI unit tests
      run: |
        if ! ./*/Development/qrenderdoc.exe --unittest test.log; then
          echo "::error::$(cat test.log)" | tr -d '\r' |  tr '\n' '\001' | sed -e 's#\x01#%0D%0A#g';
          exit 1;
        fi
  docs:
    name: Documentation Build
    needs: [commit-msg, clang-format]
    runs-on: ubuntu-18.04
    env:
      QT_SELECT: qt5
    steps:
    - uses: actions/checkout@v2
      with:
        fetch-depth: 5
    - name: Install compilation dependencies
      run: |
        sudo apt-get update -qq
        sudo apt-get install -y -qq libx11-dev mesa-common-dev libgl1-mesa-dev qtbase5-dev libxcb-keysyms1-dev
    - name: Install sphinx dependencies
      run: sudo pip3 install Sphinx
    - name: Build cut-down renderdoc for python modules
      run: |
        mkdir build
        pushd build
        cmake -DCMAKE_BUILD_TYPE=Debug -DENABLE_GL=OFF -DENABLE_GLES=OFF -DENABLE_VULKAN=OFF -DENABLE_RENDERDOCCMD=OFF -DENABLE_QRENDERDOC=OFF ..
        make -j2
        popd
    - name: Build documentation
      run: |
        cd docs
        make html SPHINXOPTS=-W
        python3 verify-docstrings.py
  linux:
    name: Linux
    needs: [commit-msg, clang-format]
    runs-on: ubuntu-18.04
    env:
      QT_SELECT: qt5
    strategy:
      fail-fast: false
      matrix:
        name: [ GCC 5 Development, Clang 3.8 Development, Clang 3.8 Release, Clang 9 Development ]
        include:
{'fraction_non_alphanumeric': 0.11076369149137767, 'fraction_numerical': 0.04074284631419367, 'mean_word_length': 1.7761704366123092, 'pattern_counts': {'":': 8, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 40, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1324575', 'n_tokens_mistral': 3716, 'n_tokens_neox': 3377, 'n_words': 976}