Skip to content

Extend prefix code alphabet size to 68. #163

Extend prefix code alphabet size to 68.

Extend prefix code alphabet size to 68. #163

Workflow file for this run

# 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 building and running tests.
name: Build/Test
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:
ubuntu_build:
name: Ubuntu Build ${{ matrix.name }}
runs-on: ${{ matrix.os || 'ubuntu-latest' }}
strategy:
matrix:
# We have one job per "name" in the matrix. Attributes are set on the
# specific job names.
name: [release, debug, asan, scalar]
include:
- name: release
test_in_pr: true
# Track static stack size on build and check it doesn't exceed 3 kB.
env_stack_size: 1
max_stack: 3000
# Conformance tooling test requires numpy.
apt_pkgs: graphviz python3-numpy
- name: debug
# Runs on AVX3 CPUs require more stack than others. Make sure to
# test on AVX3-enabled CPUs when changing this value.
env_test_stack_size: 4000
# Build scalar-only hwy instructions.
- name: scalar
mode: release
cxxflags: -DHWY_COMPILE_ONLY_SCALAR
- name: asan
skip_install: true
env:
CCACHE_DIR: ${{ github.workspace }}/.ccache
# Whether we track the stack size.
STACK_SIZE: ${{ matrix.env_stack_size }}
TEST_STACK_LIMIT: ${{ matrix.env_test_stack_size }}
WILL_RUN_TESTS: ${{ github.event_name == 'push' || (github.event_name == 'pull_request' && (matrix.test_in_pr || contains(github.event.pull_request.labels.*.name, 'CI:full'))) }}
steps:
- name: Install build deps
run: |
sudo apt update
sudo apt install -y \
ccache \
clang \
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" >> $GITHUB_ENV
echo "CXX=clang++" >> $GITHUB_ENV
- name: Checkout the source
uses: actions/checkout@v2
with:
submodules: true
fetch-depth: 2
- name: Sphinx dependencies
# Dependencies for sphinx HTML documentation
if: matrix.name == 'release'
run: |
pip3 install -r doc/sphinx/requirements.txt
- 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: build-${{ runner.os }}-${{ github.sha }}-${{ matrix.name }}
restore-keys: |
build-${{ runner.os }}-${{ steps.git-env.outputs.parent }}-${{ matrix.name }}
- name: Build
if: matrix.name != 'coverage' || env.WILL_RUN_TESTS == 'true'
run: |
mkdir -p ${CCACHE_DIR}
echo "max_size = 200M" > ${CCACHE_DIR}/ccache.conf
mode="${{ matrix.mode }}"
build_tests=$([ "$WILL_RUN_TESTS" == "true" ] && echo "ON" || echo "OFF")
[[ -n "${mode}" ]] || mode="${{ matrix.name }}"
./ci.sh ${mode} -DJPEGXL_FORCE_SYSTEM_BROTLI=ON \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DBUILD_TESTING=${build_tests} \
${{ matrix.cmake_args }}
env:
SKIP_TEST: 1
CMAKE_CXX_FLAGS: ${{ matrix.cxxflags }}
- name: Build stats
run: |
awk '!/^#/ {total[$4]+=($2-$1);cntr[$4]+=1} END {for (key in total) print total[key]/cntr[key] " " key}' build/.ninja_log | sort -n | tail -n 25
- name: ccache stats
run: ccache --show-stats
# Run the tests on push and when requested in pull_request.
- name: Test ${{ matrix.mode }}
if: env.WILL_RUN_TESTS == 'true'
run: |
./ci.sh test ${{ matrix.ctest_args }}
# Print the running time summary for the slowest tests.
- name: Test runtime stats
run: |
sort build/Testing/Temporary/CTestCostData.txt -k 3 -n | tail -n 20 || true
- name: Coverage report
if: github.event_name == 'push' && matrix.name == 'coverage'
run: |
./ci.sh coverage_report
- name: Coverage upload to Codecov
if: github.event_name == 'push' && matrix.name == 'coverage'
uses: codecov/codecov-action@v2
with:
flags: unittests
files: build/coverage.xml
windows_msys:
name: Windows MSYS2 / ${{ matrix.msystem }}
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
include:
- msystem: mingw64
- msystem: clang64
defaults:
run:
shell: msys2 {0}
steps:
- name: Checkout the source
uses: actions/checkout@v2
with:
submodules: true
fetch-depth: 1
- uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.msystem }}
update: true
path-type: inherit
install: >-
base-devel
git
pacboy: >-
brotli:p
cmake:p
giflib:p
gtest:p
libavif:p
libjpeg-turbo:p
libpng:p
libwebp:p
ninja:p
toolchain:p
- name: CMake configure
run: |
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DJPEGXL_ENABLE_JNI=OFF \
-DJPEGXL_ENABLE_MANPAGES=OFF \
-DJPEGXL_FORCE_SYSTEM_BROTLI=ON \
-DJPEGXL_FORCE_SYSTEM_GTEST=ON \
-B build \
-G Ninja
- name: CMake build
run: cmake --build build
- name: Test
if: |
github.event_name == 'push' ||
(github.event_name == 'pull_request' &&
contains(github.event.pull_request.labels.*.name, 'CI:full'))
run: ctest --test-dir build --parallel 2 --output-on-failure -E "${{ matrix.disable_tests }}"