<commit_before>name: Build Tests

on:
  push:
    # for now, trigger only on push to test branch gh-workflows
    # later, will be push/pull_request to all main, develop, and 'release-*'
    branches:
      - gh-workflows

env:
  PLATFORM: posix
  TESTS: yes

jobs:
  build-linux:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        CC: ["gcc", "clang"]
        TLS: ["no", "openssl", "gnutls", "mbedtls"]
    steps:
      - uses: actions/checkout@v2
        with:
          submodules: recursive
      - name: setup
        run: |
          sudo apt-get update && sudo apt-get install -y libcunit1-dev libmbedtls-dev libgnutls28-dev libtool libtool-bin exuberant-ctags valgrind graphviz doxygen libxml2-utils xsltproc docbook-xml docbook-xsl asciidoc
          ./autogen.sh
      - name: configure no-TLS
        if: matrix.TLS == 'no'
        run: |
          mkdir build-${{matrix.TLS}}-${{matrix.CC}}
          cd build-${{matrix.TLS}}-${{matrix.CC}}
          $GITHUB_WORKSPACE/configure --enable-tests --disable-dtls CC=${{matrix.CC}}
      - name: configure TLS
        if: matrix.TLS != 'no'
        run: |
          mkdir build-${{matrix.TLS}}-${{matrix.CC}}
          cd build-${{matrix.TLS}}-${{matrix.CC}}
          "$GITHUB_WORKSPACE/configure" --enable-tests --with-${{matrix.TLS}} CC=${{matrix.CC}}
      - name: compile
        run: |
          cd build-${{matrix.TLS}}-${{matrix.CC}}
          make
      - name: test
        if: matrix.TLS != 'tinydtls'
        run: |
          cd build-${{matrix.TLS}}-${{matrix.CC}}
          libtool --mode=execute tests/testdriver
      - name: test tinydtls
        if: matrix.TLS == 'tinydtls'
        run: |
          cd build-${{matrix.TLS}}-${{matrix.CC}}
          LD_LIBRARY_PATH="ext/tinydtls" libtool --mode=execute tests/testdriver
        <commit_msg>[CI] main.yml: Run unit tests with valgrind<commit_after>name: Build Tests

on:
  push:
    # for now, trigger only on push to test branch gh-workflows
    # later, will be push/pull_request to all main, develop, and 'release-*'
    branches:
      - gh-workflows

env:
  PLATFORM: posix
  TESTS: yes

jobs:
  build-linux:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        CC: ["gcc", "clang"]
        TLS: ["no", "openssl", "gnutls", "mbedtls"]
    steps:
      - uses: actions/checkout@v2
        with:
          submodules: recursive
      - name: setup
        run: |
          sudo apt-get update && sudo apt-get install -y libcunit1-dev libmbedtls-dev libgnutls28-dev libtool libtool-bin exuberant-ctags valgrind graphviz doxygen libxml2-utils xsltproc docbook-xml docbook-xsl asciidoc
          ./autogen.sh
      - name: configure no-TLS
        if: matrix.TLS == 'no'
        run: |
          mkdir build-${{matrix.TLS}}-${{matrix.CC}}
          cd build-${{matrix.TLS}}-${{matrix.CC}}
          $GITHUB_WORKSPACE/configure --enable-tests --disable-dtls CC=${{matrix.CC}}
      - name: configure TLS
        if: matrix.TLS != 'no'
        run: |
          mkdir build-${{matrix.TLS}}-${{matrix.CC}}
          cd build-${{matrix.TLS}}-${{matrix.CC}}
          "$GITHUB_WORKSPACE/configure" --enable-tests --with-${{matrix.TLS}} CC=${{matrix.CC}}
      - name: compile
        run: |
          cd build-${{matrix.TLS}}-${{matrix.CC}}
          make
      - name: test
        run: |
          cd build-${{matrix.TLS}}-${{matrix.CC}}
          libtool --mode=execute valgrind --track-origins=yes --leak-check=yes --show-reachable=yes --error-exitcode=123 --quiet --suppressions=$GITHUB_WORKSPACE/tests/valgrind_suppression tests/testdriver
      - name: OSS Fuzz
        if: matrix.TLS == 'openssl'    # run only once for each compiler
        run: |
          cd build-${{matrix.TLS}}-${{matrix.CC}}
          make -C tests/oss-fuzz -f Makefile.ci check clean
      - name: manual page examples check
        if: matrix.TLS == 'openssl'    # run only once for each compiler
        run: |
          cd build-${{matrix.TLS}}-${{matrix.CC}}
          make -C man
          man/examples-code-check man
{'fraction_non_alphanumeric': 0.1475166790214974, 'fraction_numerical': 0.0032122559920929085, 'mean_word_length': 2.09480122324159, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, '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': '1430409', 'n_tokens_mistral': 1375, 'n_tokens_neox': 1305, 'n_words': 315}