<commit_before>language: c
dist: bionic
sudo: required
services:
  - docker
env:
  global:
    - ci_env=`bash <(curl -s https://codecov.io/env)`
    - COVERITY_SCAN_PROJECT_NAME="jluebbe/rauc"
    - COVERITY_SCAN_NOTIFICATION_EMAIL="<EMAIL>"
    - COVERITY_SCAN_BRANCH_PATTERN="master"
    - COVERITY_SCAN_BUILD_COMMAND_PREPEND="cov-configure --comptype gcc --compiler gcc-6 --template && ./autogen.sh && ./configure CC=gcc-6"
    - COVERITY_SCAN_BUILD_COMMAND="make V=1"

stages:
  - name: Main Build and Tests
  - name: Cross-Builds

jobs:
  include:
    - stage: Main Build and Tests
      before_script:
        - docker pull rauc/testing:latest

      script:
        # Prepare environment for Coverity tool
        - |
            PLATFORM=`uname`
            export TOOL_BASE="/tmp/coverity-scan-analysis"
            export SCAN_URL="https://scan.coverity.com"
            export UPLOAD_URL="https://scan.coverity.com/builds"
            export TOOL_ARCHIVE="/tmp/cov-analysis-${PLATFORM}.tgz"

        # Get Coverity tool
        # - test/get-coverity.sh
        # - TOOL_DIR="$(find $TOOL_BASE -type d -name 'cov-analysis*' || exit 0)"

        # Create container and export env variables for Coverity scan
        - env | grep -E "TRAVIS|COV|TOOL|URL" > .cov-env
        - cat /proc/cpuinfo
        - sudo chmod 666 /dev/kvm
        - ls -l /dev
        - |
            docker run -dit --privileged \
            --env-file .cov-env \
            -v "$PWD":/home/travis -w /home/travis \
            --tmpfs /tmp/qemu:exec,mode=777 \
            --tmpfs /tmp:exec \
            -v ${TOOL_BASE}:${TOOL_BASE} \
            -u travis $ci_env \
            --name rauc-ci rauc/testing:latest bash

        # Make sure Coverity script is executable
        # - docker cp test/run-coverity.sh rauc-ci:/usr/local/bin

        # Run Coverity Analysis
        # - docker exec -it rauc-ci run-coverity.sh build
        # - docker exec -it rauc-ci run-coverity.sh upload

        - docker exec -it rauc-ci ./autogen.sh
        - docker exec -it rauc-ci ./configure --enable-code-coverage
        - docker exec -it rauc-ci make clean
        - docker exec -it rauc-ci make -j2
        - docker exec -it rauc-ci make doc SPHINXOPTS=-W
        - docker exec -it rauc-ci make check TESTS=
        - docker exec -it rauc-ci /bin/sh -c 'export TMPDIR=/tmp/qemu && ./qemu-test'
        - docker exec -it rauc-ci make distcheck
        - docker exec -it rauc-ci /bin/sh -c 'cd /home/travis/contrib/cgi && ./autogen.sh && ./configure && make clean && make -j2 && make distcheck'
        - ./uncrustify.sh && git diff --exit-code
      after_success:
        - docker exec -it rauc-ci /bin/sh -c 'find . -type f -name *.gcno -exec gcov -pbr {} +'
        - docker exec -it rauc-ci /usr/bin/codecov -X gcov
      after_failure:
        - cat test/*.log || true
        - cat test-suite.log || true
        - cat rauc-*/_build/sub/test-suite.log || true
    - &cross
      stage: Cross-Builds
      name: armhf
      before_install:
        - docker run --rm --privileged multiarch/qemu-user-static:register --reset
      install:
        - docker run --name cross -dit -v "$PWD":/home -w /home multiarch/debian-debootstrap:armhf-buster bash
      before_script:
        - docker exec -it cross uname -a
        - docker exec -it cross apt-get update
        - docker exec -it cross apt-get install -y build-essential automake libtool libglib2.0-dev libcurl3-dev libssl-dev libjson-glib-dev libdbus-1-dev
      script:
        - docker exec -it cross ./autogen.sh
        - docker exec -it cross ./configure
        - docker exec -it cross make
      after_script:
        - docker stop cross
      after_failure:
        - cat config.log || true
        - cat test/*.log || true
        - cat test-suite.log || true
        - cat rauc-*/_build/sub/test-suite.log || true
    - <<: *cross
      name: arm64<commit_msg>.travis.yml: enable -Werror for CI builds<commit_after>language: c
dist: bionic
sudo: required
services:
  - docker
env:
  global:
    - ci_env=`bash <(curl -s https://codecov.io/env)`
    - COVERITY_SCAN_PROJECT_NAME="jluebbe/rauc"
    - COVERITY_SCAN_NOTIFICATION_EMAIL="<EMAIL>"
    - COVERITY_SCAN_BRANCH_PATTERN="master"
    - COVERITY_SCAN_BUILD_COMMAND_PREPEND="cov-configure --comptype gcc --compiler gcc-6 --template && ./autogen.sh && ./configure CC=gcc-6"
    - COVERITY_SCAN_BUILD_COMMAND="make V=1"

stages:
  - name: Main Build and Tests
  - name: Cross-Builds

jobs:
  include:
    - stage: Main Build and Tests
      before_script:
        - docker pull rauc/testing:latest

      script:
        # Prepare environment for Coverity tool
        - |
            PLATFORM=`uname`
            export TOOL_BASE="/tmp/coverity-scan-analysis"
            export SCAN_URL="https://scan.coverity.com"
            export UPLOAD_URL="https://scan.coverity.com/builds"
            export TOOL_ARCHIVE="/tmp/cov-analysis-${PLATFORM}.tgz"

        # Get Coverity tool
        # - test/get-coverity.sh
        # - TOOL_DIR="$(find $TOOL_BASE -type d -name 'cov-analysis*' || exit 0)"

        # Create container and export env variables for Coverity scan
        - env | grep -E "TRAVIS|COV|TOOL|URL" > .cov-env
        - cat /proc/cpuinfo
        - sudo chmod 666 /dev/kvm
        - ls -l /dev
        - |
            docker run -dit --privileged \
            --env-file .cov-env \
            -v "$PWD":/home/travis -w /home/travis \
            --tmpfs /tmp/qemu:exec,mode=777 \
            --tmpfs /tmp:exec \
            -v ${TOOL_BASE}:${TOOL_BASE} \
            -u travis $ci_env \
            --name rauc-ci rauc/testing:latest bash

        # Make sure Coverity script is executable
        # - docker cp test/run-coverity.sh rauc-ci:/usr/local/bin

        # Run Coverity Analysis
        # - docker exec -it rauc-ci run-coverity.sh build
        # - docker exec -it rauc-ci run-coverity.sh upload

        - docker exec -it rauc-ci ./autogen.sh
        - docker exec -it rauc-ci ./configure --enable-code-coverage CFLAGS=-Werror
        - docker exec -it rauc-ci make clean
        - docker exec -it rauc-ci make -j2
        - docker exec -it rauc-ci make doc SPHINXOPTS=-W
        - docker exec -it rauc-ci make check TESTS=
        - docker exec -it rauc-ci /bin/sh -c 'export TMPDIR=/tmp/qemu && ./qemu-test'
        - docker exec -it rauc-ci make distcheck
        - docker exec -it rauc-ci /bin/sh -c 'cd /home/travis/contrib/cgi && ./autogen.sh && ./configure CFLAGS=-Werror && make clean && make -j2 && make distcheck'
        - ./uncrustify.sh && git diff --exit-code
      after_success:
        - docker exec -it rauc-ci /bin/sh -c 'find . -type f -name *.gcno -exec gcov -pbr {} +'
        - docker exec -it rauc-ci /usr/bin/codecov -X gcov
      after_failure:
        - cat test/*.log || true
        - cat test-suite.log || true
        - cat rauc-*/_build/sub/test-suite.log || true
    - &cross
      stage: Cross-Builds
      name: armhf
      before_install:
        - docker run --rm --privileged multiarch/qemu-user-static:register --reset
      install:
        - docker run --name cross -dit -v "$PWD":/home -w /home multiarch/debian-debootstrap:armhf-buster bash
      before_script:
        - docker exec -it cross uname -a
        - docker exec -it cross apt-get update
        - docker exec -it cross apt-get install -y build-essential automake libtool libglib2.0-dev libcurl3-dev libssl-dev libjson-glib-dev libdbus-1-dev
      script:
        - docker exec -it cross ./autogen.sh
        - docker exec -it cross ./configure CFLAGS=-Werror
        - docker exec -it cross make
      after_script:
        - docker stop cross
      after_failure:
        - cat config.log || true
        - cat test/*.log || true
        - cat test-suite.log || true
        - cat rauc-*/_build/sub/test-suite.log || true
    - <<: *cross
      name: arm64
{'fraction_non_alphanumeric': 0.12251109701965758, 'fraction_numerical': 0.004565630944831959, 'mean_word_length': 1.8582819862268938, 'pattern_counts': {'":': 4, '<': 11, '<?xml version=': 0, '>': 7, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1110280', 'n_tokens_mistral': 2703, 'n_tokens_neox': 2585, 'n_words': 681}