aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorEugene Kliuchnikov <eustas.ru@gmail.com>2021-08-31 14:07:17 +0200
committerGitHub <noreply@github.com>2021-08-31 14:07:17 +0200
commit0e42caf3591d09d156c2b35462bc91a04e903b39 (patch)
treeab1c59f14b2fd82bfd9765ce99784bad903a6755 /scripts
parent68f1b90ad0d204907beb58304d0bd06391001a4d (diff)
downloadbrotli-0e42caf3591d09d156c2b35462bc91a04e903b39.zip
brotli-0e42caf3591d09d156c2b35462bc91a04e903b39.tar.gz
brotli-0e42caf3591d09d156c2b35462bc91a04e903b39.tar.bz2
Migrate to github actions (#920)
Not all combinations are migrated to the initial configuration; corresponding TODOs added. Drive-by: additional combinations uncovered minor portability problems -> fixed Drive-by: remove no-longer used "script" files. Co-authored-by: Eugene Kliuchnikov <eustas@chromium.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/.bintray.json19
-rw-r--r--scripts/.configure-custom.sh1
-rwxr-xr-xscripts/.travis.sh81
-rw-r--r--scripts/appveyor.yml111
-rw-r--r--scripts/dictionary/step-01-download-rfc.py2
-rw-r--r--scripts/dictionary/step-02-rfc-to-bin.py2
-rw-r--r--scripts/dictionary/step-03-validate-bin.py13
-rw-r--r--scripts/dictionary/step-04-generate-java-literals.py11
-rw-r--r--scripts/fix-win-bazel-build.py36
-rw-r--r--scripts/sources.lst3
10 files changed, 15 insertions, 264 deletions
diff --git a/scripts/.bintray.json b/scripts/.bintray.json
deleted file mode 100644
index 17f99ed..0000000
--- a/scripts/.bintray.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "package": {
- "name": "bin",
- "repo": "brotli",
- "subject": "eustas"
- },
-
- "version": {"name": "latest"},
-
- "files": [
- {
- "includePattern": "brotli.zip",
- "uploadPattern": "brotli-${TRAVIS_OS_NAME}-${RELEASE_DATE}.zip",
- "matrix_params": {"override": 1}
- }
- ],
-
- "publish": true
-}
diff --git a/scripts/.configure-custom.sh b/scripts/.configure-custom.sh
deleted file mode 100644
index f1f641a..0000000
--- a/scripts/.configure-custom.sh
+++ /dev/null
@@ -1 +0,0 @@
-#!/usr/bin/env bash
diff --git a/scripts/.travis.sh b/scripts/.travis.sh
deleted file mode 100755
index b5ad13a..0000000
--- a/scripts/.travis.sh
+++ /dev/null
@@ -1,81 +0,0 @@
-#!/bin/bash
-
-case "$1" in
- "before_install")
- ;;
- "install")
- case "${TRAVIS_OS_NAME}" in
- "osx")
- brew update >/dev/null
- brew install binutils
-
- case "${CC}" in
- "gcc-"*)
- which ${CC} || brew install $(echo "${CC}" | sed 's/\-/@/') || brew link --overwrite $(echo "${CC}" | sed 's/\-/@/')
- ;;
- esac
-
- case "${BUILD_SYSTEM}" in
- "bazel")
- brew cask install homebrew/cask-versions/adoptopenjdk8
- brew install bazel
- ;;
- esac
- ;;
- "linux")
- case "${CC}" in
- "pgcc")
- wget 'https://raw.githubusercontent.com/nemequ/pgi-travis/de6212d94fd0e7d07a6ef730c23548c337c436a7/install-pgi.sh'
- echo 'acd3ef995ad93cfb87d26f65147395dcbedd4c3c844ee6ec39616f1a347c8df5 install-pgi.sh' | sha256sum -c --strict || exit 1
- /bin/sh install-pgi.sh
- ;;
- esac
- ;;
- esac
- ;;
- "script")
- case "${BUILD_SYSTEM}" in
- "cmake")
- mkdir builddir && cd builddir
- CMAKE_FLAGS=
- if [ "${CROSS_COMPILE}" = "yes" ]; then
- CMAKE_FLAGS="-DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_RC_COMPILER=${RC_COMPILER}"
- fi
- cmake ${CMAKE_FLAGS} -DCMAKE_C_COMPILER="$CC" -DCMAKE_CXX_COMPILER="$CXX" -DENABLE_SANITIZER="${SANITIZER}" -DCMAKE_C_FLAGS="${CFLAGS}" .. || exit 1
- make VERBOSE=1 || exit 1
- ctest -V || exit 1
- ;;
- "python")
- python setup.py test
- ;;
- "maven")
- cd java/org/brotli
- mvn install && cd integration && mvn verify
- ;;
- "autotools")
- ./bootstrap && ./configure && make
- ;;
- "fuzz")
- ./c/fuzz/test_fuzzer.sh
- ;;
- "bazel")
- bazel build -c opt ...:all &&
- cd go && bazel test -c opt ...:all && cd .. &&
- cd java && bazel test -c opt ...:all && cd .. &&
- cd js && bazel test -c opt ...:all && cd .. &&
- cd research && bazel build -c opt ...:all && cd ..
- ;;
- esac
- ;;
- "after_success")
- ;;
- "before_deploy")
- case "${BUILD_SYSTEM}" in
- "bazel")
- export RELEASE_DATE=`date +%Y-%m-%d`
- perl -p -i -e 's/\$\{([^}]+)\}/defined $ENV{$1} ? $ENV{$1} : $&/eg' scripts/.bintray.json
- zip -j9 brotli.zip bazel-bin/libbrotli*.a bazel-bin/libbrotli*.so bazel-bin/brotli
- ;;
- esac
- ;;
-esac
diff --git a/scripts/appveyor.yml b/scripts/appveyor.yml
deleted file mode 100644
index e52f65a..0000000
--- a/scripts/appveyor.yml
+++ /dev/null
@@ -1,111 +0,0 @@
-branches:
- only:
- - master
-
-environment:
- matrix:
- - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
- BUILD_SYSTEM: CMake
- GENERATOR: Visual Studio 15 2017 Win64
- CONFIG: Release
-
- - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
- BUILD_SYSTEM: CMake
- GENERATOR: Visual Studio 15 2017 Win64
- CONFIG: Debug
-
- - BUILD_SYSTEM: CMake
- GENERATOR: Visual Studio 14 2015 Win64
- CONFIG: Debug
-
- - BUILD_SYSTEM: CMake
- GENERATOR: Visual Studio 14 2015
- CONFIG: Debug
-
- - BUILD_SYSTEM: Python
- PYTHON: "C:\\Python27"
- PYTHON_VERSION: "2.7.x"
- PYTHON_ARCH: "32"
-
- - BUILD_SYSTEM: Python
- PYTHON: "C:\\Python36-x64"
- PYTHON_VERSION: "3.6.x"
- PYTHON_ARCH: "64"
-
- - BUILD_SYSTEM: make
- ARCH: "i686"
-
- - BUILD_SYSTEM: make
- ARCH: "x86_64"
-
- - BUILD_SYSTEM: bazel
-
-install:
-- IF "%BUILD_SYSTEM%"=="Python" (
- SET "PATH=%PYTHON%;%PYTHON%\Scripts;%PATH%" &&
- python -m pip install --upgrade pip &&
- pip install --upgrade setuptools
- )
-- IF "%BUILD_SYSTEM%"=="make" (
- IF "%ARCH%"=="i686" (
- SET "TOOLCHAIN=i686-6.3.0-posix-dwarf-rt_v5-rev1\mingw32"
- ) ELSE (
- SET "TOOLCHAIN=x86_64-7.3.0-posix-seh-rt_v5-rev0\mingw64"
- )
- )
-- IF "%BUILD_SYSTEM%"=="bazel" (
- appveyor DownloadFile https://github.com/bazelbuild/bazel/releases/download/2.2.0/bazel-2.2.0-windows-x86_64.exe -FileName bazel.exe
- )
-
-before_build:
-- FOR /f %%i in ('C:\cygwin64\bin\date.exe +%%Y-%%m-%%d') DO SET "RELEASE_DATE=%%i"
-- IF "%BUILD_SYSTEM%"=="CMake" ( mkdir builddir && cd builddir && cmake -G "%GENERATOR%" .. )
-- IF "%BUILD_SYSTEM%"=="make" (
- SET "CC=gcc" &&
- SET "PATH=C:\mingw-w64\%TOOLCHAIN%\bin;%PATH%" &&
- COPY C:\msys64\usr\bin\make.exe C:\mingw-w64\%TOOLCHAIN%\bin\make.exe
- )
-- SET "ROOT=%APPVEYOR_BUILD_FOLDER%"
-
-build_script:
-- IF "%BUILD_SYSTEM%"=="CMake" ( cmake --build . --config %CONFIG% )
-- IF "%BUILD_SYSTEM%"=="Python" ( python setup.py build_ext )
-- IF "%BUILD_SYSTEM%"=="make" (
- sh -c "make brotli" &&
- cd bin && 7z a -tzip -mx9 brotli-win-%ARCH%-%RELEASE_DATE%.zip brotli.exe &&
- appveyor PushArtifact brotli-win-%ARCH%-%RELEASE_DATE%.zip && cd ..
- )
-- IF "%BUILD_SYSTEM%"=="bazel" (
- cd java &&
- %ROOT%\bazel.exe --batch build -c opt org/brotli/wrapper/...:all &&
- python %ROOT%\scripts\fix-win-bazel-build.py &&
- cd bazel-bin &&
- 7z a -tzip -mx9 brotli-win-bazel-jni-%RELEASE_DATE%.zip brotli_jni.dll &&
- appveyor PushArtifact brotli-win-bazel-jni-%RELEASE_DATE%.zip &&
- cd .. &&
- cd ..
- )
-
-test_script:
-- IF "%BUILD_SYSTEM%"=="CMake" ( ctest --output-on-failure --interactive-debug-mode 0 -C %CONFIG% )
-- IF "%BUILD_SYSTEM%"=="Python" ( python setup.py test )
-- IF "%BUILD_SYSTEM%"=="make" ( sh -c "make test" )
-- IF "%BUILD_SYSTEM%"=="bazel" (
- cd java &&
- %ROOT%\bazel.exe --batch test -c opt --test_output streamed org/brotli/wrapper/...:all &&
- cd ..
- )
-
-deploy:
-- provider: BinTray
- on:
- branch: master
- username: eustas
- api_key:
- secure: B3rM8JYeIHIw6BfOjHggAeyTmxEf8ZDYmyF9gCwqyWaxyxECD9BuN50SiV2KE/RI
- subject: eustas
- repo: brotli
- package: bin
- version: latest
- publish: true
- override: true
diff --git a/scripts/dictionary/step-01-download-rfc.py b/scripts/dictionary/step-01-download-rfc.py
index 14f65cc..04f9ccc 100644
--- a/scripts/dictionary/step-01-download-rfc.py
+++ b/scripts/dictionary/step-01-download-rfc.py
@@ -5,7 +5,7 @@
import urllib2
-response = urllib2.urlopen('https://tools.ietf.org/rfc/rfc7932.txt')
+response = urllib2.urlopen("https://tools.ietf.org/rfc/rfc7932.txt")
text = response.read()
path = "rfc7932.txt"
diff --git a/scripts/dictionary/step-02-rfc-to-bin.py b/scripts/dictionary/step-02-rfc-to-bin.py
index 27737c5..ddf255a 100644
--- a/scripts/dictionary/step-02-rfc-to-bin.py
+++ b/scripts/dictionary/step-02-rfc-to-bin.py
@@ -19,7 +19,7 @@ for line in lines:
if re_data_line.match(line) is not None:
data = line.strip()
for i in range(32):
- dictionary.append(int(data[2 * i : 2 * i + 2], 16))
+ dictionary.append(int(data[2 * i:2 * i + 2], 16))
if len(dictionary) == 122784:
break
else:
diff --git a/scripts/dictionary/step-03-validate-bin.py b/scripts/dictionary/step-03-validate-bin.py
index 171cc9b..b52e614 100644
--- a/scripts/dictionary/step-03-validate-bin.py
+++ b/scripts/dictionary/step-03-validate-bin.py
@@ -10,6 +10,7 @@ bin_path = "dictionary.bin"
with open(bin_path, "rb") as raw:
data = raw.read()
+
def check_digest(name, expected, actual):
if expected == actual:
print("[OK] " + name)
@@ -22,15 +23,11 @@ check_digest(
"0x5136cb04",
hex(zlib.crc32(data)))
-check_digest(
- "MD5",
- "96cecd2ee7a666d5aa3627d74735b32a",
- hashlib.md5(data).hexdigest())
+check_digest("MD5", "96cecd2ee7a666d5aa3627d74735b32a",
+ hashlib.md5(data).hexdigest())
-check_digest(
- "SHA1",
- "72b41051cb61a9281ba3c4414c289da50d9a7640",
- hashlib.sha1(data).hexdigest())
+check_digest("SHA1", "72b41051cb61a9281ba3c4414c289da50d9a7640",
+ hashlib.sha1(data).hexdigest())
check_digest(
"SHA256",
diff --git a/scripts/dictionary/step-04-generate-java-literals.py b/scripts/dictionary/step-04-generate-java-literals.py
index c235f25..d864542 100644
--- a/scripts/dictionary/step-04-generate-java-literals.py
+++ b/scripts/dictionary/step-04-generate-java-literals.py
@@ -1,6 +1,6 @@
# Step 04 - generate Java literals.
#
-# Java byte-code has ridiculous restrictions. There is no such thing as
+# Java byte-code has severe restrictions. There is no such thing as
# "array literal" - those are implemented as series of data[x] = y;
# as a consequence N-byte array will use 7N bytes in class, plus N bytes
# in instantiated variable. Also no literal could be longer than 64KiB.
@@ -17,7 +17,7 @@
try:
unichr # Python 2
-except NameError
+except NameError:
unichr = chr # Python 3
bin_path = "dictionary.bin"
@@ -49,8 +49,9 @@ for b in data:
cntr = skip_flip_offset + 1
hi.append(unichr(cntr))
-low0 = low[0 : len(low) // 2]
-low1 = low[len(low) // 2 : len(low)]
+low0 = low[0:len(low) // 2]
+low1 = low[len(low) // 2:len(low)]
+
def escape(chars):
result = []
@@ -68,7 +69,7 @@ def escape(chars):
elif ord(c) < 32 or ord(c) >= 127:
result.append("\\u%04X" % ord(c))
else:
- result.append(c);
+ result.append(c)
return result
diff --git a/scripts/fix-win-bazel-build.py b/scripts/fix-win-bazel-build.py
deleted file mode 100644
index 7a9b211..0000000
--- a/scripts/fix-win-bazel-build.py
+++ /dev/null
@@ -1,36 +0,0 @@
-import fnmatch
-import os
-import os.path
-from shutil import copyfile
-
-print('Searching for manifests...')
-
-matches = []
-for root, dirnames, filenames in os.walk('bazel-bin\\org\\brotli'):
- for filename in fnmatch.filter(filenames, '*.runfiles_manifest'):
- matches.append(os.path.join(root, filename))
-
-for match in matches:
- print('Scanning manifest ' + match)
- runfiles = match[:-len('_manifest')]
- with open(match) as manifest:
- for entry in manifest:
- entry = entry.strip()
- if not entry.startswith("org_brotli_java"):
- continue
- if entry.startswith('org_brotli_java/external'):
- continue
- (alias, space, link) = entry.partition(' ')
- if alias.endswith('.jar') or alias.endswith('.exe'):
- continue
- link = link.replace('/', '\\')
- alias = alias.replace('/', '\\')
- dst = os.path.join(runfiles, alias)
- if not os.path.exists(dst):
- print(link + ' -> ' + dst)
- parent = os.path.dirname(dst)
- if not os.path.exists(parent):
- os.makedirs(parent)
- copyfile(link, dst)
-
-print('Finished resolving symlinks')
diff --git a/scripts/sources.lst b/scripts/sources.lst
index 18d3867..dd50a45 100644
--- a/scripts/sources.lst
+++ b/scripts/sources.lst
@@ -1,5 +1,6 @@
# IT WOULD BE FOOLISH TO USE COMPUTERS TO AUTOMATE REPETITIVE TASKS:
-# ENLIST EVERY USED HEADER AND SOURCE FILE MANUALLY!
+# neither CMake nor Automake support "glob" expressions,
+# so every header and source file have to be listed manually.
BROTLI_CLI_C = \
c/tools/brotli.c