<commit_before># Copyright (c) the JPEG XL Project Authors. All rights reserved.
#
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.

# Workflow for running conformance tests.

name: Conformance
on:
  push:
    branches:
      - main
      - v*.*.x
  pull_request:
    types: [opened, reopened, labeled, synchronize]

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
  cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
  build:
    runs-on: ubuntu-latest
    env:
      CCACHE_DIR: ${{ github.workspace }}/.ccache
    steps:
    - name: Install build deps
      run: |
        sudo apt update
        sudo apt install -y \
          ccache \
          clang-7 \
          cmake \
          doxygen \
          libbenchmark-dev \
          libbenchmark-tools \
          libbrotli-dev \
          libgdk-pixbuf2.0-dev \
          libgif-dev \
          libgtest-dev \
          libgtk2.0-dev  \
          libjpeg-dev \
          libopenexr-dev \
          libpng-dev \
          libwebp-dev \
          ninja-build \
          pkg-config \
          xvfb \
          ${{ matrix.apt_pkgs }} \
        #
        echo "CC=clang-7" >> $GITHUB_ENV
        echo "CXX=clang++-7" >> $GITHUB_ENV
    - name: Checkout the jxl source
      uses: actions/checkout@v2
      with:
        submodules: true
        fetch-depth: 2
    - name: Git environment
      id: git-env
      run: |
        echo "::set-output name=parent::$(git rev-parse ${{ github.sha }}^)"
      shell: bash
    - name: ccache
      uses: actions/cache@v2
      with:
        path: ${{ env.CCACHE_DIR }}
        # When the cache hits the key it is not updated, so if this is a rebuild
        # of the same Pull Request it will reuse the cache if still around. For
        # either Pull Requests or new pushes to main, this will use the parent
        # hash as the starting point from the restore-keys entry.
        key: ${{ runner.os }}-${{ github.sha }}-${{ matrix.name }}
        restore-keys: |
          ${{ runner.os }}-${{ steps.git-env.outputs.parent }}-${{ matrix.name }}
    - name: Build
      run: |
        mkdir -p ${CCACHE_DIR}
        echo "max_size = 200M" > ${CCACHE_DIR}/ccache.conf
        ./ci.sh release -DJPEGXL_FORCE_SYSTEM_BROTLI=ON \
          -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
          -DCMAKE_C_COMPILER_LAUNCHER=ccache \
          -DBUILD_TESTING=OFF
        # Flatten the artifacts directory structure
        cp tools/conformance/conformance.py build/tools/conformance
        cp tools/conformance/lcms2.py build/tools/conformance
        cp build/tools/djxl build/tools/conformance
        cp build/libjxl_dec.so.0.7.0 build/tools/conformance
        cp build/libjxl_threads.so.0.7.0 build/tools/conformance
      env:
        SKIP_TEST: 1
    - uses: actions/upload-artifact@v2
      with:
        name: conformance_binary
        path: |
          build/tools/conformance/conformance.py
          build/tools/conformance/lcms2.py
          build/tools/conformance/djxl
          build/tools/conformance/libjxl_dec.so.0.7.0
          build/tools/conformance/libjxl_threads.so.0.7.0
    - name: ccache stats
      run: ccache --show-stats

  run:
    needs: build
    runs-on: ubuntu-latest
    strategy:
      matrix:
        name: [main_level5, main_level10]
    steps:
    - name: Install deps
      run: |
        pip install numpy
    - name: Checkout the conformance source
      uses: actions/checkout@v2
      with:
        repository: libjxl/conformance
        ref: ce5a804a3ff834097b93c39d2f93e5445f6bf340
        path: conformance
    - name: Download and link conformance files
      run: |
        ${{ github.workspace }}/conformance/scripts/download_and_symlink.sh
    - uses: actions/download-artifact@v2
      with:
        name: conformance_binary<commit_msg>Run conformance tests on different targets<commit_after># Copyright (c) the JPEG XL Project Authors. All rights reserved.
#
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.

# Workflow for running conformance tests.

name: Conformance
on:
  push:
    branches:
      - main
      - v*.*.x
  pull_request:
    types: [opened, reopened, labeled, synchronize]

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
  cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
  build:
    name: Conformance Build ${{ matrix.name }}
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        include:
          - name: AVX3
            cflags: -DHWY_DISABLED_TARGETS=HWY_AVX3-1
          - name: AVX2
            cflags: -DHWY_DISABLED_TARGETS=HWY_AVX2-1
          - name: SSE4
            cflags: -DHWY_DISABLED_TARGETS=HWY_SSE4-1
          - name: SSSE3
            cflags: -DHWY_DISABLED_TARGETS=HWY_SSSE3-1
          - name: EMU128
            cflags: -DHWY_COMPILE_ONLY_EMU128=1
          - name: SCALAR
            cflags: -DHWY_COMPILE_ONLY_SCALAR=1
    env:
      CCACHE_DIR: ${{ github.workspace }}/.ccache
    steps:
    - name: Install build deps
      run: |
        sudo apt update
        sudo apt install -y \
          ccache \
          clang-7 \
          cmake \
          doxygen \
          libbenchmark-dev \
          libbenchmark-tools \
          libbrotli-dev \
          libgdk-pixbuf2.0-dev \
          libgif-dev \
          libgtest-dev \
          libgtk2.0-dev  \
          libjpeg-dev \
          libopenexr-dev \
          libpng-dev \
          libwebp-dev \
          ninja-build \
          pkg-config \
          xvfb \
          ${{ matrix.apt_pkgs }} \
        #
        echo "CC=clang-7" >> $GITHUB_ENV
        echo "CXX=clang++-7" >> $GITHUB_ENV
    - name: Checkout the jxl source
      uses: actions/checkout@v2
      with:
        submodules: true
        fetch-depth: 2
    - name: Git environment
      id: git-env
      run: |
        echo "::set-output name=parent::$(git rev-parse ${{ github.sha }}^)"
      shell: bash
    - name: ccache
      uses: actions/cache@v2
      with:
        path: ${{ env.CCACHE_DIR }}
        # When the cache hits the key it is not updated, so if this is a rebuild
        # of the same Pull Request it will reuse the cache if still around. For
        # either Pull Requests or new pushes to main, this will use the parent
        # hash as the starting point from the restore-keys entry.
        key: ${{ runner.os }}-${{ github.sha }}-${{ matrix.name }}
        restore-keys: |
          ${{ runner.os }}-${{ steps.git-env.outputs.parent }}-${{ matrix.name }}
    - name: Build
      run: |
        mkdir -p ${CCACHE_DIR}
        echo "max_size = 200M" > ${CCACHE_DIR}/ccache.conf
        CMAKE_FLAGS="${{ matrix.cflags }}" \
        ./ci.sh release -DJPEGXL_FORCE_SYSTEM_BROTLI=ON \
          -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
          -DCMAKE_C_COMPILER_LAUNCHER=ccache \
          -DBUILD_TESTING=OFF
        # Flatten the artifacts directory structure
        cp tools/conformance/conformance.py build/tools/conformance
        cp tools/conformance/lcms2.py build/tools/conformance
        cp build/tools/djxl build/tools/conformance
        cp build/libjxl_dec.so.0.7.0 build/tools/conformance
        cp build/libjxl_threads.so.0.7.0 build/tools/conformance
      env:
        SKIP_TEST: 1
    - uses: actions/upload-artifact@v2
      with:
        name: conformance_binary-${{ matrix.name }}
        path: |
          build/tools/conformance/conformance.py
          build/tools/conformance/lcms2.py
          build/tools/conformance/djxl
          build/tools/conformance/libjxl_dec.so.0.7.0
          build/tools/conformance/libjxl_threads.so.0.7.0
    - name: ccache stats
      run: ccache --show-stats

  run:
    name: Conformance Test ${{ matrix.name }} on ${{ matrix.target}}
    needs: build
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        name: [main_level5, main_level10]
        target: [AVX3, AVX2, SSE4, SSSE3, EMU128, SCALAR]
    steps:
    - name: Install deps
      run: |
        pip install numpy
    - name: Checkout the conformance source
      uses: actions/checkout@v2
      with:
        repository: libjxl/conformance
        ref: ce5a804a3ff834097b93c39d2f93e5445f6bf340
        path: conformance
    - name: Download and link conformance files
      run: |
        ${{ github.workspace }}/conformance/scripts/download_and_symlink.sh
    - uses: actions/download-artifact@v2
      with:
        name: conformance_binary-${{ matrix.target }}
{'fraction_non_alphanumeric': 0.10393682499129021, 'fraction_numerical': 0.01707118801532923, 'mean_word_length': 1.919322033898305, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5542929', 'n_tokens_mistral': 2915, 'n_tokens_neox': 2785, 'n_words': 648}