diff --git a/.travis/build-and-run-docker-test-containers.sh b/.travis/build-and-run-docker-test-containers.sh deleted file mode 100755 index d377ba8dd..000000000 --- a/.travis/build-and-run-docker-test-containers.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/bash -# -# Copyright 2018 Google Inc. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -set -e - -docker build -t build_cpp_image -f tests/docker/Dockerfile.testing.cpp.debian_buster . -# Run tests with sanitizers (--cap-add SYS_PTRACE), both GCC and Clang. -cpp_test_args="--cap-add SYS_PTRACE build_cpp_image sh ./tests/docker/cpp_test.run.sh Debug" -docker run --rm $cpp_test_args -docker run --rm --env CC=/usr/bin/clang --env CXX=/usr/bin/clang++ $cpp_test_args -# Build flatc on debian once to speed up the test loop below. -docker run --name flatc_container build_cpp_image sh ./tests/docker/build_flatc.run.sh Debug -# All dependent dockers refer to 'flatc_debian_stretch'. -docker cp flatc_container:/flatbuffers/flatc flatc_debian_stretch - -for f in $(ls tests/docker/languages | sort) -do - # docker pull sometimes fails for unknown reasons, probably travisci-related. this retries the pull we need a few times. - REQUIRED_BASE_IMAGE=$(cat tests/docker/languages/${f} | head -n 1 | awk ' { print $2 } ') - - set +e - n=0 - until [ $n -ge 5 ] - do - docker pull $REQUIRED_BASE_IMAGE && break - n=$[$n+1] - sleep 1 - done - set -e - - docker build -t $(echo ${f} | cut -f 3- -d .) -f tests/docker/languages/${f} . - echo "TEST OK: ${f}" -done diff --git a/.travis/check-sources.sh b/.travis/check-sources.sh deleted file mode 100644 index 3e6dbf16b..000000000 --- a/.travis/check-sources.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash -# -# Copyright 2018 Google Inc. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -set -e - -if [ -n "$1" ]; then - scan_dir="$1" -else - scan_dir="$( pwd )" -fi - -py_checker="$0.py" - -echo "scan root directory = '$scan_dir'" -python3 --version -# Scan recursively and search all *.cpp and *.h files using regex patterns. -# Assume that script running from a root of Flatbuffers working dir. -python3 $py_checker "ascii" "$scan_dir/include" "\.h$" -python3 $py_checker "ascii" "$scan_dir/src" "\.cpp$" -python3 $py_checker "ascii" "$scan_dir/tests" "\.h$" -python3 $py_checker "utf-8" "$scan_dir/tests" "\.cpp$" diff --git a/.travis/check-sources.sh.py b/.travis/check-sources.sh.py deleted file mode 100644 index 2b001d763..000000000 --- a/.travis/check-sources.sh.py +++ /dev/null @@ -1,35 +0,0 @@ -import os -import re -import sys - -def check_encoding(encoding, scan_dir, regex_pattern): - fname = None - try: - assert encoding in ['ascii', 'utf-8'], "unexpected encoding" - cmp = re.compile(regex_pattern) - for root, dirs, files in os.walk(scan_dir): - fname = root - cmp_list = [f for f in files if cmp.search(f) is not None] - for f in cmp_list: - fname = os.path.join(root, f) - with open(fname, mode='rb') as test_file: - btext = test_file.read() - # check encoding - btext.decode(encoding=encoding, errors="strict") - if encoding == "utf-8" and btext.startswith(b'\xEF\xBB\xBF'): - raise ValueError("unexpected BOM in file") - # check LF line endings - LF = btext.count(b'\n') - CR = btext.count(b'\r') - if CR!=0: - raise ValueError("invalid line endings: LF({})/CR({})".format(LF, CR)) - except Exception as err: - print("ERROR with [{}]: {}".format(fname, err)) - return -1 - else: - return 0 - -if __name__ == "__main__": - # python check-sources.sh.py 'ascii' '.' '.*\.(cpp|h)$' - res = check_encoding(sys.argv[1], sys.argv[2], sys.argv[3]) - sys.exit(0 if res == 0 else -1) diff --git a/.travis/deploy-python.sh b/.travis/deploy-python.sh deleted file mode 100755 index 4cc03460f..000000000 --- a/.travis/deploy-python.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -PROD_REPOSITORY="https://upload.pypi.org/legacy/" -TEST_REPOSITORY="https://test.pypi.org/legacy/" - -twine upload \ - --username "$PYPI_USERNAME" \ - --password "$PYPI_PASSWORD" \ - --repository-url "$PROD_REPOSITORY" \ - "$DIR/../python/dist/"* - diff --git a/.travis/format_check.sh b/.travis/format_check.sh deleted file mode 100644 index cbd1d9b0b..000000000 --- a/.travis/format_check.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/bash -# -# Copyright 2021 Google Inc. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -e - -# HACKY solution to make nodejs work. -source ~/.nvm/nvm.sh -nvm alias default node -nvm use default - -sh scripts/clang-format-git.sh - -# Check formatting for go lang - -cd go -gofmt -w . -cd .. -cd grpc/examples/go -sh format.sh -cd ../../.. - -node_modules/.bin/eslint ts/** --ext .ts --quiet --fix - -#PYTHON IS DISABLED UNTIL WE CREATE A .pylintrc FILE FOR IT -pylint python/** --disable=all - -swiftformat --config swift.swiftformat . - - -if ! git diff --quiet; then - echo >&2 - echo "ERROR: ********************************************************" >&2 - echo "ERROR: The following differences were found after running" >&2 - echo "ERROR: .travis/format_check.sh script. Maybe you forgot to format" >&2 - echo "ERROR: the code after making changes? please check Formatters.md" >&2 - echo "ERROR: ********************************************************" >&2 - echo >&2 - git diff --binary --exit-code -fi \ No newline at end of file diff --git a/.travis/format_install.sh b/.travis/format_install.sh deleted file mode 100644 index 74908d5f9..000000000 --- a/.travis/format_install.sh +++ /dev/null @@ -1,90 +0,0 @@ -#!/bin/bash -# -# Copyright 2020 Google Inc. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -e -set -x - -# install devtools -install_languages() { - sudo apt update - - # Install nodeJS and yarn - wget https://raw.githubusercontent.com/creationix/nvm/v0.31.0/nvm.sh -O ~/.nvm/nvm.sh - source ~/.nvm/nvm.sh - nvm install node - node --version - curl -o- -L https://yarnpkg.com/install.sh | bash - export PATH="$HOME/.yarn/bin:$PATH" - yarn config set prefix ~/.yarn -g - export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH" - - # Install swift - sudo apt-get install \ - binutils \ - git \ - libc6-dev \ - libcurl3 \ - libedit2 \ - libgcc-5-dev \ - libpython2.7 \ - libsqlite3-0 \ - libstdc++-5-dev \ - libxml2 \ - pkg-config \ - tzdata \ - zlib1g-dev - - SWIFT_URL=https://swift.org/builds/swift-5.3.1-release/ubuntu1604/swift-5.3.1-RELEASE/swift-5.3.1-RELEASE-ubuntu16.04.tar.gz - curl -fSsL "$SWIFT_URL" -o swift.tar.gz - - mkdir ~/swiftbuild - tar -xvzf swift.tar.gz -C ~/swiftbuild - - export PATH="~/swiftbuild/swift-5.3.1-RELEASE-ubuntu16.04/usr/bin:$PATH" - - - mkdir ~/gobuild - wget -c https://golang.org/dl/go1.15.2.linux-amd64.tar.gz - tar -xvzf go1.15.2.linux-amd64.tar.gz -C ~/gobuild - - export PATH="~/gobuild/go/bin:$PATH" - - swift --version - go version - yarn -v - node -v -} - -install_formatters() { - # installing swift formatter - git clone --depth 1 --branch 0.47.4 https://github.com/nicklockwood/SwiftFormat.git - cd SwiftFormat - swift build -c release - sudo cp .build/release/swiftformat /usr/local/bin/swiftformat - cd .. - - which yarn - which node - yarn -v - node -v - - yarn install - pip install pylint -} - -install_languages -export PATH="~/swift/swift/usr/bin:$PATH" -install_formatters \ No newline at end of file