<commit_before>name: unit-tests
on: [pull_request, workflow_dispatch]
jobs:
  unit-tests:
    runs-on: ubuntu-20.04
    strategy:
      matrix:
        startarg:
         - check-memory
         - CC=clang :i386 check-memory
         - CC=clang distcheck
         - :i386 distcheck
      fail-fast: false
    timeout-minutes: 60
    env:
      # current podman backport falls over as non-root, and completely breaks down with :i386 image
      docker: docker
    steps:
      - name: Clone repository
        uses: actions/checkout@v2
        with:
          # need this to also fetch tags
          fetch-depth: 0

      - name: Build unit test container if it changed
        run: |
          changes=$(git diff --name-only origin/master..HEAD -- containers/unit-tests/)
          if [ -n "${changes}" ]; then
            case '${{ matrix.startarg }}' in
              *:i386*) arch=i386;;
              *) arch=amd64;;
            esac
            containers/unit-tests/build $arch
          fi

      - name: Run unit-tests container
        run: containers/unit-tests/start ${{ matrix.startarg }}
<commit_msg>workflows: Fix unit-tests' "changed" detection to compare against correct target branch<commit_after>name: unit-tests
on: [pull_request, workflow_dispatch]
jobs:
  unit-tests:
    runs-on: ubuntu-20.04
    strategy:
      matrix:
        startarg:
         - check-memory
         - CC=clang :i386 check-memory
         - CC=clang distcheck
         - :i386 distcheck
      fail-fast: false
    timeout-minutes: 60
    env:
      # current podman backport falls over as non-root, and completely breaks down with :i386 image
      docker: docker
    steps:
      - name: Clone repository
        uses: actions/checkout@v2
        with:
          # need this to also fetch tags
          fetch-depth: 0

      - name: Build unit test container if it changed
        run: |
          changes=$(git diff --name-only origin/${{ github.event.pull_request.base.ref }}..HEAD -- containers/unit-tests/)
          if [ -n "${changes}" ]; then
            case '${{ matrix.startarg }}' in
              *:i386*) arch=i386;;
              *) arch=amd64;;
            esac
            containers/unit-tests/build $arch
          fi

      - name: Run unit-tests container
        run: containers/unit-tests/start ${{ matrix.startarg }}

{'fraction_non_alphanumeric': 0.10355156183140779, 'fraction_numerical': 0.02139495079161318, 'mean_word_length': 1.8236714975845412, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '340991', 'n_tokens_mistral': 710, 'n_tokens_neox': 658, 'n_words': 194}