<commit_before>name: test
on:
  push:
    tags:
      - v*
    branches:
      - main
      - master
      - release-*
  pull_request:

jobs:
  test:
    runs-on: ubuntu-20.04
    strategy:
      fail-fast: false
      matrix:
        go-version: [1.15.x, 1.16.x, 1.17.x]

    steps:

    - name: checkout
      uses: actions/checkout@v2

    - name: install deps
      run: |
        sudo apt -q update
        sudo apt -q install libseccomp-dev

    - name: install go ${{ matrix.go-version }}
      uses: actions/setup-go@v2
      with:
        stable: '!contains(${{ matrix.go-version }}, "beta") && !contains(${{ matrix.go-version }}, "rc")'
        go-version: ${{ matrix.go-version }}

    - name: build
      run: make check-build

    - name: test
      run: make test
<commit_msg>CI/GHA: test against libseccomp 2.5.2 and HEAD<commit_after>name: test
on:
  push:
    tags:
      - v*
    branches:
      - main
      - master
      - release-*
  pull_request:

jobs:
  test:
    runs-on: ubuntu-20.04
    strategy:
      fail-fast: false
      matrix:
        go-version: [1.15.x, 1.16.x, 1.17.x]
        libseccomp: ["v2.5.2", "HEAD"]

    steps:

    - name: checkout
      uses: actions/checkout@v2

    - name: install go ${{ matrix.go-version }}
      uses: actions/setup-go@v2
      with:
        stable: '!contains(${{ matrix.go-version }}, "beta") && !contains(${{ matrix.go-version }}, "rc")'
        go-version: ${{ matrix.go-version }}

    - name: build libseccomp ${{ matrix.libseccomp }}
      run: |
        set -x
        sudo apt -qq update
        sudo apt -qq install gperf

        PREFIX="$(pwd)/seccomp"
        LIBDIR="$PREFIX/lib"

        git clone https://github.com/seccomp/libseccomp
        cd libseccomp
        git checkout ${{ matrix.libseccomp }}
        # In main branch, configure.ac sets libseccomp version to 0.0.0, which
        # results in error when compiling libseccomp-golang. While 0.0.0 is
        # there for a reason, here we need to build and test against HEAD, so
        # set it to a suitable value.
        #
        # Version 9.9.9 is used because:
        #  - version >= current is needed;
        #  - chances are good such version won't ever exist;
        #  - it is easy to spot in tests output;
        #  - the LIBFILE pattern below expects single digits.
        sed -i '/^AC_INIT(/s/0\.0\.0/9.9.9/' configure.ac
        ./autogen.sh
        ./configure --prefix="$PREFIX" --libdir="$LIBDIR"
        make
        sudo make install
        cd -
        rm -rf libseccomp

        # For the next steps to build and execute with the compiled library.
        echo "PKG_CONFIG_LIBDIR=$LIBDIR/pkgconfig" >> $GITHUB_ENV
        LIBFILE="$(echo $LIBDIR/libseccomp.so.?.?.?)"
        echo "LD_PRELOAD=$LIBFILE" >> $GITHUB_ENV

    - name: build
      run: make check-build

    - name: test
      run: make test

{'fraction_non_alphanumeric': 0.12934631432545202, 'fraction_numerical': 0.01773296244784423, 'mean_word_length': 1.8316929133858268, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 8, 'https://': 1, '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': '7288669', 'n_tokens_mistral': 1009, 'n_tokens_neox': 943, 'n_words': 263}