Skip to content

Commit

Permalink
merge 1.0.9
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael-X-Net committed Jul 22, 2023
2 parents d35319e + 779a49b commit 8c35d92
Show file tree
Hide file tree
Showing 97 changed files with 7,116 additions and 2,118 deletions.
83 changes: 30 additions & 53 deletions .github/workflows/build_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ on:
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: Build and test ${{ matrix.name }}
Expand All @@ -21,6 +25,7 @@ jobs:
run:
shell: bash
strategy:
fail-fast: false
matrix:
include:
# TODO: consider running this combination in docker
Expand All @@ -33,7 +38,7 @@ jobs:
build_system: cmake
c_compiler: gcc-9
cxx_compiler: g++-9
os: ubuntu-18.04
os: ubuntu-20.04

# TODO: consider running this combination in docker
#- name: cmake:clang3.5
Expand Down Expand Up @@ -93,19 +98,6 @@ jobs:
cmake_config: Debug
os: windows-2019

# TODO: consider running this combination in docker
#- name: autotools:gcc5

- name: autotools:gcc10
build_system: autotools
c_compiler: gcc-10
cxx_compiler: g++-10

- name: autotools:clang12
build_system: autotools
c_compiler: clang-12
cxx_compiler: clang++12

- name: fuzz:clang12
build_system: fuzz
c_compiler: clang-12
Expand All @@ -114,12 +106,13 @@ jobs:
# TODO: consider running this combination in docker
#- name: python2.7:gcc5

- name: python27:clang9
build_system: python
c_compiler: clang-9
python_version: 2.7
cxx_compiler: clang++-9
os: ubuntu-18.04
# TODO: consider running this combination in docker
#- name: python27:clang9
# build_system: python
# c_compiler: clang-9
# python_version: 2.7
# cxx_compiler: clang++-9
# os: ubuntu-20.04

# TODO: consider running this combination in docker
#- name: python27-win
Expand Down Expand Up @@ -202,7 +195,7 @@ jobs:
- name: bazel-win:root
build_system: bazel
bazel_project: .
os: windows-latest
os: windows-2019

# TODO: use single dll on windows, otherwise it fails to link
#- name: bazel-win:go
Expand All @@ -213,7 +206,7 @@ jobs:
- name: bazel-win:java
build_system: bazel
bazel_project: java
os: windows-latest
os: windows-2019

# TODO: blocked by Bazel Closure rules issue
#- name: bazel-win:js
Expand All @@ -224,19 +217,7 @@ jobs:
- name: bazel-win:research
build_system: bazel
bazel_project: research
os: windows-latest

- name: make
build_system: make

- name: make-osx
build_system: make
os: macos-latest

# TODO: add 32/64-bit x MSYS2/mingw/Cygwin toolchain support.
- name: make-win
build_system: make
os: windows-latest
os: windows-2019

env:
CC: ${{ matrix.c_compiler || 'gcc' }}
Expand All @@ -245,7 +226,7 @@ jobs:
steps:
- name: Install extra deps @ Ubuntu
if: ${{ runner.os == 'Linux' }}
# Already installed: bazel, clang{10-12}, cmake, gcc{9,10}, java{8,11}, maven, python{2.7,3.5-3.9}
# Already installed: bazel, clang{10-12}, cmake, gcc{9,10}, java{8,11}, maven, python{3.5-3.9}
run: |
EXTRA_PACKAGES="${{ matrix.extra_apt_pkgs || '' }}"
sudo apt update
Expand Down Expand Up @@ -286,14 +267,21 @@ jobs:
- name: Quick Fuzz
if: ${{ matrix.build_system == 'fuzz' }}
run: |
export ASAN_OPTIONS=detect_leaks=0
./c/fuzz/test_fuzzer.sh
mkdir ${RUNNER_TEMP}/decode_corpora
unzip java/org/brotli/integration/fuzz_data.zip -d ${RUNNER_TEMP}/decode_corpora
cd ${GITHUB_WORKSPACE}/c/fuzz
bazelisk build --config=asan-libfuzzer :decode_fuzzer
for f in `ls ${RUNNER_TEMP}/decode_corpora`
do
echo "Testing $f"
./bazel-bin/decode_fuzzer_bin ${RUNNER_TEMP}/decode_corpora/$f
done
- name: Build with Bazel
if: ${{ matrix.build_system == 'bazel' }}
run: |
cd ${GITHUB_WORKSPACE}/${{ matrix.bazel_project }}
bazel build -c opt ...:all
bazelisk build -c opt ...:all
- name: Fix symlinks for Bazel (Windows)
if: ${{ matrix.build_system == 'bazel' && runner.os == 'Windows' && matrix.bazel_project == 'java' }}
Expand Down Expand Up @@ -337,9 +325,9 @@ jobs:
if: ${{ matrix.build_system == 'bazel' }}
run: |
cd ${GITHUB_WORKSPACE}/${{ matrix.bazel_project }}
bazel query "tests(...)" --output=label > ${RUNNER_TEMP}/tests.lst
[ -s ${RUNNER_TEMP}/tests.lst ] && bazel test -c opt ...:all
bazel clean
bazelisk query "tests(...)" --output=label > ${RUNNER_TEMP}/tests.lst
[ -s ${RUNNER_TEMP}/tests.lst ] && bazelisk test -c opt ...:all
bazelisk clean
- name: Build / Test with Maven
if: ${{ matrix.build_system == 'maven' }}
Expand All @@ -350,17 +338,6 @@ jobs:
cd integration
mvn -B verify
- name: Build / Test with Autotools
if: ${{ matrix.build_system == 'autotools' }}
run: |
./bootstrap && ./configure && make
- name: Build / Test with Make
if: ${{ matrix.build_system == 'make' }}
run: |
make brotli
make test
- uses: actions/setup-python@v2
if: ${{ matrix.build_system == 'python' }}
with:
Expand Down
70 changes: 70 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: "CodeQL"

on:
push:
branches: [ "master" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "master" ]
schedule:
- cron: '18 15 * * 0'

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

jobs:
analyze:
name: Analyze
runs-on: 'ubuntu-latest'
timeout-minutes: 360
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'cpp', 'java', 'javascript', 'python' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby', 'swift' ]

steps:
- name: Checkout repository
uses: actions/checkout@v3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# CodeQL is currently crashing on files with large lists:
# https://github.com/github/codeql/issues/13656
config: |
paths-ignore:
- research
- js/test_data.*
- if: matrix.language == 'cpp'
name: Build CPP
uses: github/codeql-action/autobuild@v2

- if: matrix.language == 'cpp' || matrix.language == 'java'
name: Build Java
run: |
cd ${GITHUB_WORKSPACE}/java
bazelisk build --spawn_strategy=local --nouse_action_cache -c opt ...:all
- if: matrix.language == 'javascript'
name: Build JS
uses: github/codeql-action/autobuild@v2

- if: matrix.language == 'cpp' || matrix.language == 'python'
name: Build Python
run: |
python setup.py build_ext
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{matrix.language}}"
12 changes: 12 additions & 0 deletions .github/workflows/fuzz.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Copyright 2020 Google Inc. All Rights Reserved.
#
# Distributed under MIT license.
# See file LICENSE for detail or copy at https://opensource.org/licenses/MIT

# Workflow for building / running oss-fuzz.

name: CIFuzz
on: [pull_request]

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

jobs:
Fuzzing:
runs-on: ubuntu-latest
Expand Down
121 changes: 121 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
# Copyright 2023 Google Inc. All Rights Reserved.
#
# Distributed under MIT license.
# See file LICENSE for detail or copy at https://opensource.org/licenses/MIT

# Workflow for building the release binaries.

name: Release build / deploy
on:
push:
branches:
- master
- v*.*.*
release:
types: [ published ]

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

jobs:
windows_build:
name: Windows Build (vcpkg / ${{ matrix.triplet }})
runs-on: [windows-2022]
strategy:
fail-fast: false
matrix:
include:
- triplet: x86-windows-dynamic
arch: '-A Win32'
build_shared_libs: 'ON'
- triplet: x64-windows-dynamic
arch: '-A x64'
build_shared_libs: 'ON'
- triplet: x86-windows-static
arch: '-A Win32'
build_shared_libs: 'OFF'
- triplet: x64-windows-static
arch: '-A x64'
build_shared_libs: 'OFF'

env:
VCPKG_VERSION: '2022.11.14'
VCPKG_ROOT: vcpkg
VCPKG_DISABLE_METRICS: 1

steps:
- name: Checkout the source
uses: actions/checkout@v3
with:
submodules: false
fetch-depth: 1

- uses: actions/cache@v3
id: cache-vcpkg
with:
path: vcpkg
key: release-${{ runner.os }}-vcpkg-${{ env.VCPKG_VERSION }}-${{ matrix.triplet }}

- name: Download vcpkg
if: steps.cache-vcpkg.outputs.cache-hit != 'true'
# wget doesn't seem to work under bash.
shell: 'powershell'
run: |
C:\msys64\usr\bin\wget.exe -nv `
https://github.com/microsoft/vcpkg/archive/refs/tags/${{ env.VCPKG_VERSION }}.zip `
-O vcpkg.zip
- name: Bootstrap vcpkg
if: steps.cache-vcpkg.outputs.cache-hit != 'true'
shell: 'bash'
run: |
set -x
unzip -q vcpkg.zip
rm -rf ${VCPKG_ROOT}
mv vcpkg-${VCPKG_VERSION} ${VCPKG_ROOT}
${VCPKG_ROOT}/bootstrap-vcpkg.sh
- name: Configure
shell: 'bash'
run: |
set -x
mkdir out
cmake -Bout -H. ${{ matrix.arch }} \
-DBUILD_TESTING=OFF \
-DBUILD_SHARED_LIBS=${{ matrix.build_shared_libs }} \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=`pwd`/prefix \
-DCMAKE_TOOLCHAIN_FILE=${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake \
-DVCPKG_TARGET_TRIPLET=${{ matrix.triplet }} \
#
- name: Build
shell: 'bash'
run: |
set -x
cmake --build out --config Release
- name: Install
shell: 'bash'
run: |
set -x
cmake --build out --config Release --target install
cp LICENSE prefix/bin/LICENSE.brotli
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: brotli-${{matrix.triplet}}
path: |
prefix/bin/*
- name: Package release zip
if: github.event_name == 'release'
shell: 'powershell'
run: |
Compress-Archive -Path prefix\bin\* `
-DestinationPath brotli-${{matrix.triplet}}.zip
- name: Upload binaries to release
if: github.event_name == 'release'
uses: AButler/upload-release-assets@v2.0
with:
files: brotli-${{matrix.triplet}}.zip
repo-token: ${{ secrets.GITHUB_TOKEN }}
Loading

0 comments on commit 8c35d92

Please sign in to comment.