<commit_before>name: Unit tests
on: [push, pull_request]

jobs:
  tests:
    strategy:
      matrix:
        os: [ubuntu-latest]
    runs-on: ${{ matrix.os }}
    timeout-minutes: 10
    steps:
    - uses: actions/checkout@v2
    - name: Cache for pip
      uses: actions/cache@v1
      with:
        path: ~/.cache/pip
        key: ${{ matrix.os }}-cache-pip

    - name: Install dependencies
      run: |
        ./setup.sh --user
        ./setup-test-tools.sh --user
        pip install --user coveralls

    - name: Python version info
      run: |
        echo 'GDB py:'
        gdb --batch --quiet --nx --nh --ex 'py import sys; print(sys.version)'
        echo 'Installed py:'
        python -V

    # We use `sudo` for `attachp` command tests
    - name: Run tests
      run: |
        PWNDBG_GITHUB_ACTIONS_TEST_RUN=1 sudo --preserve-env ./tests.sh

    - name: Process coverage data
      run: |
        coverage combine
        # coveralls  ## XXX set up coveralls.io like pwntools?<commit_msg>Add Codecov<commit_after>name: Unit tests
on: [push, pull_request]

jobs:
  tests:
    strategy:
      matrix:
        os: [ubuntu-latest]
    runs-on: ${{ matrix.os }}
    timeout-minutes: 10
    steps:
    - uses: actions/checkout@v2
    - name: Cache for pip
      uses: actions/cache@v1
      with:
        path: ~/.cache/pip
        key: ${{ matrix.os }}-cache-pip

    - name: Install dependencies
      run: |
        ./setup.sh --user
        ./setup-test-tools.sh --user
        pip install --user coveralls

    - name: Python version info
      run: |
        echo 'GDB py:'
        gdb --batch --quiet --nx --nh --ex 'py import sys; print(sys.version)'
        echo 'Installed py:'
        python -V

    # We use `sudo` for `attachp` command tests
    - name: Run tests
      run: |
        PWNDBG_GITHUB_ACTIONS_TEST_RUN=1 sudo --preserve-env ./tests.sh

    - name: Process coverage data
      run: |
        coverage combine
        coverage xml

    - name: "Upload coverage to Codecov"
      uses: codecov/codecov-action@v2
      with:
        fail_ci_if_error: true

{'fraction_non_alphanumeric': 0.11818181818181818, 'fraction_numerical': 0.005263157894736842, 'mean_word_length': 1.7842876165113182, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 1}, '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': '2854763', 'n_tokens_mistral': 696, 'n_tokens_neox': 664, 'n_words': 195}