diff options
-rw-r--r-- | .appveyor.yml | 66 | ||||
-rw-r--r-- | .github/workflows/build.yml | 68 | ||||
-rw-r--r-- | .github/workflows/build_release.yml | 90 | ||||
-rw-r--r-- | .travis.yml | 93 | ||||
-rw-r--r-- | scripts/appveyor-after-test.bat | 23 | ||||
-rwxr-xr-x | scripts/travis-before-deploy.sh | 50 | ||||
-rwxr-xr-x | scripts/travis-before-install.sh | 20 | ||||
-rwxr-xr-x | scripts/travis-build.sh | 35 | ||||
-rwxr-xr-x | scripts/travis-common.sh | 22 | ||||
-rwxr-xr-x | scripts/travis-emcc.sh | 21 | ||||
-rwxr-xr-x | scripts/travis-test.sh | 61 |
11 files changed, 155 insertions, 394 deletions
diff --git a/.appveyor.yml b/.appveyor.yml deleted file mode 100644 index 934b1f26..00000000 --- a/.appveyor.yml +++ /dev/null @@ -1,66 +0,0 @@ ---- - -init: - # AppVeyor default is python2, but we want python 3 - - set PATH=C:\Python36;C:\Python36\Scripts;%PATH% - - set PATH=C:\msys64\mingw64\bin;C:\msys64\usr\bin;%PATH% - # Python doesn't seem to be able to import files from the current script's - # directory on Windows. - - set PYTHONPATH=%APPVEYOR_BUILD_FOLDER%\test - - ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) - -install: - - git submodule update --init - -environment: - JOBS: 3 - matrix: - - GENERATOR: MSYS Makefiles - CONFIG: Release - JOBS_FLAG: -j - EXE_DIR: . - DEPLOY: false - - GENERATOR: Visual Studio 14 2015 - CONFIG: Release - JOBS_FLAG: "/m:" - EXE_DIR: '%CONFIG%' - DEPLOY: true - DEPLOY_NAME: wabt-%APPVEYOR_REPO_TAG_NAME%-win32.zip - - GENERATOR: Visual Studio 14 2015 Win64 - CONFIG: Debug - JOBS_FLAG: "/m:" - EXE_DIR: '%CONFIG%' - DEPLOY: false - - GENERATOR: Visual Studio 14 2015 Win64 - CONFIG: Release - JOBS_FLAG: "/m:" - EXE_DIR: '%CONFIG%' - DEPLOY: true - DEPLOY_NAME: wabt-%APPVEYOR_REPO_TAG_NAME%-win64.zip - -build_script: - - cmake . -DCMAKE_BUILD_TYPE=%CONFIG% -DCMAKE_INSTALL_PREFIX=%APPVEYOR_BUILD_FOLDER% -G "%GENERATOR%" - - cmake --build . --config %CONFIG% --target install -- %JOBS_FLAG%%JOBS% - -test_script: - - python test\run-tests.py -v --bindir %APPVEYOR_BUILD_FOLDER%\bin - -# Must happen before artifacts step. -after_test: - - call scripts\appveyor-after-test.bat - -artifacts: - - path: "%DEPLOY_NAME%" - name: wabt - - path: "%DEPLOY_NAME%.sha256" - name: sha256 - -deploy: - description: 'wabt release' - provider: GitHub - auth_token: - secure: lHQSdycL1FHsFKZZ0RSnYSUtRitYaLb4uxDjCSOpYHnk4gIO/0/DLu4aoU2VvD7Y - artifact: wabt,sha256 - on: - appveyor_repo_tag: true - deploy: true diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9af12a89..d2a87574 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,7 +10,7 @@ on: jobs: lint: - name: Lint + name: lint runs-on: ubuntu-latest steps: - uses: actions/setup-python@v1 @@ -21,11 +21,11 @@ jobs: run: pip3 install flake8==3.7.8 - run: flake8 build: - name: Build + name: build runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-16.04, macos-latest, windows-latest] + os: [ubuntu-latest, macos-latest, windows-latest] steps: - uses: actions/setup-python@v1 with: @@ -33,11 +33,25 @@ jobs: - uses: actions/checkout@v1 with: submodules: true + - name: install ninja (linux) + run: sudo apt-get install ninja-build + if: matrix.os == 'ubuntu-latest' + - name: install ninja (osx) + run: brew install ninja + if: matrix.os == 'macos-latest' + - name: install ninja (win) + run: choco install ninja + if: matrix.os == 'windows-latest' - name: mkdir run: mkdir -p out - name: cmake + run: cmake .. -G Ninja + working-directory: out + if: matrix.os != 'windows-latest' + - name: cmake (windows) run: cmake .. working-directory: out + if: matrix.os == 'windows-latest' - name: build run: cmake --build out - name: unittests @@ -46,3 +60,51 @@ jobs: run: cmake --build out --target run-c-api-tests - name: tests run: cmake --build out --target run-tests + emscripten: + name: emscripten + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + with: + submodules: true + - name: build + run: | + docker run -di --name emscripten -v $(pwd):/src trzeci/emscripten:sdk-incoming-64bit bash + docker exec emscripten emconfigure cmake . + docker exec emscripten emmake make -j 2 + + build-asan: + name: asan + runs-on: ubuntu-latest + env: + USE_NINJA: "1" + steps: + - uses: actions/setup-python@v1 + with: + python-version: '3.x' + - uses: actions/checkout@v1 + with: + submodules: true + - run: sudo apt-get install ninja-build + - run: make clang-debug-asan + - run: make clang-release-asan + - run: make test-clang-debug-asan + - run: make test-clang-release-asan + + build-ubsan: + name: ubsan + runs-on: ubuntu-latest + env: + USE_NINJA: "1" + steps: + - uses: actions/setup-python@v1 + with: + python-version: '3.x' + - uses: actions/checkout@v1 + with: + submodules: true + - run: sudo apt-get install ninja-build + - run: make clang-debug-ubsan + - run: make clang-release-ubsan + - run: make test-clang-debug-ubsan + - run: make test-clang-release-ubsan diff --git a/.github/workflows/build_release.yml b/.github/workflows/build_release.yml new file mode 100644 index 00000000..c0826bcb --- /dev/null +++ b/.github/workflows/build_release.yml @@ -0,0 +1,90 @@ +name: Build Release + +# Trigger whenever a release is created +on: + release: + types: + - created + +jobs: + build: + name: build + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [linux-16.04, macos-latest, windows-latest] + defaults: + run: + shell: bash + steps: + - uses: actions/setup-python@v1 + with: + python-version: '3.x' + - uses: actions/checkout@v1 + with: + submodules: true + + - name: install ninja (linux) + run: sudo apt-get install ninja-build + if: matrix.os == 'ubuntu-latest' + + - name: install ninja (osx) + run: brew install ninja + if: matrix.os == 'macos-latest' + + - name: install ninja (win) + run: choco install ninja + if: matrix.os == 'windows-latest' + + - name: mkdir + run: mkdir -p out + + - name: cmake (unix) + run: cmake -S . -B out -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install + if: matrix.os != 'windows-latest' + + - name: cmake (win) + # -G "Visual Studio 15 2017" + run: cmake -S . -B out + if: matrix.os == 'windows-latest' + + - name: build + run: cmake --build out --config Release --target install + + - name: strip + run: find bin/ -type f -perm -u=x -exec strip {} + + if: matrix.os != 'windows-latest' + + - name: archive + id: archive + run: | + OSNAME=$(echo ${{ matrix.os }} | sed 's/-latest//') + VERSION=${{ github.event.release.tag_name }} + PKGNAME="wabt-$VERSION-$OSNAME" + TARBALL=$PKGNAME.tar.gz + SHASUM=$PKGNAME.tar.gz.sha256 + mv install wabt-$VERSION + tar -czf $TARBALL wabt-$VERSION + scripts/sha256sum.py $TARBALL > $SHASUM + echo "::set-output name=tarball::$TARBALL" + echo "::set-output name=shasum::$SHASUM" + + - name: upload tarball + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: ./${{ steps.archive.outputs.tarball }} + asset_name: ${{ steps.archive.outputs.tarball }} + asset_content_type: application/gzip + + - name: upload shasum + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: ./${{ steps.archive.outputs.shasum }} + asset_name: ${{ steps.archive.outputs.shasum }} + asset_content_type: text/plain diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 39057c5d..00000000 --- a/.travis.yml +++ /dev/null @@ -1,93 +0,0 @@ -language: cpp -dist: xenial -before_install: - - eval "${MATRIX_EVAL}" - - scripts/travis-before-install.sh -script: - - scripts/travis-build.sh - - scripts/travis-test.sh -matrix: - include: - - name: gcc - os: linux - compiler: gcc - - name: gcc-i686 - os: linux - sudo: required - addons: - apt: - packages: - - gcc-4.8-multilib - - g++-4.8-multilib - compiler: gcc-i686 - - name: clang-release - os: linux - compiler: clang - env: WABT_DEPLOY=clang-release - - name: asan - os: linux - compiler: clang - env: SANITIZER=asan -# Disabled because MSAN seems to have stopped working on Travis. -# - os: linux -# compiler: clang -# env: SANITIZER=msan - - name: lsan - os: linux - compiler: clang - env: SANITIZER=lsan - - name: ubsan - os: linux - compiler: clang - env: SANITIZER=ubsan - - name: osx - os: osx - compiler: clang - env: WABT_DEPLOY=clang-release - # Build the .js outputs using emcc - - name: emscripten - services: - - docker - before_install: - - docker run -dit --name emscripten -v $(pwd):/src trzeci/emscripten:sdk-incoming-64bit bash - script: - # run binaryen.js and wasm.js tests before and after building, so we see if the bundled - # version is good too - - docker exec -it emscripten bash scripts/travis-emcc.sh - - # Allow failures on the Mac bots. We'd rather not, but they are quite slow. - allow_failures: - - os: osx - compiler: clang - - fast_finish: true - -before_deploy: - # Only run deploy script once (see https://github.com/travis-ci/travis-ci/issues/2570#issuecomment-171262181) - - > - if ! [ "$BEFORE_DEPLOY_RUN" ]; then - export BEFORE_DEPLOY_RUN=1; - scripts/travis-before-deploy.sh - fi - -deploy: - - provider: releases - api_key: - secure: UTs36nT7zk1E5cmv4PmsrLbfpQoCJmkQ1upBvyiUl7F2GtPpd7bn/lxN9+e6xroW3vvFTD0MAx/ylqqKHISMhUlRj3vSRW9M1JO/EKj3jQ8kqr92Nz9On5QcGJ8usMMuzq4rXW/t32XIFci25RlFTBxAVXaQq6cVbvjGzvGfvJ6V6vTtho6Pjgj2HCq3K38TYMwA6/+NiP30bV2OkYKjTRx6RCFkYUhKallr0t035GT30bgW7Zz5roLlXUXMiCt8TqY5MCcFYmKukYpLF/tp+B5MUXR0rFFoTsafOc7hWCIi9SdngkwlUFW2tbc9CD0MtNEIUpF+Pf+siXo2RKqfg9A4pdHyHTx1PIOqyDTGcMLHBrs8bsQAoO4PJy6V0WLA1PwQDajXzGfFC3O7Wg/ljOpUumaHCt8yl3/aFu0LZu1NOCZnTpu/kLMXiB1osbSPuYqO+v2j8qgS6xDWf183d9cBzqlep+Wnk2Pgoq1PX2lO08QfxJjW6o3dJkZ/4icpT8hHb4ymcIr3VI9Pl+5Gg1JiMZooZeGV/XMXDAaaO2SNELOK4Dz9eBy4d4ffgaNPZkmNIJZLEx8nISDCU+u2VLcC5FHsCT8VyjcG9JdAXwOmlv2auxhyU87buteJvsJFDavfnc4BEgHPM1xR9PVJzY3IXAOAwAXUZQPWxSKwEgQ= - file: wabt-$TRAVIS_TAG-*.tar.gz* - file_glob: true - skip_cleanup: true - on: - tags: true - condition: -n ${WABT_DEPLOY} - - provider: gcs - access_key_id: GOOGF5TNXVUMCZBNQSHP54QW - secret_access_key: - secure: s4RCOYQnJNj/9cwdsKf7nz3K232Ffc2eAetfItCYuVIFSSvPKrMAsvDBfyG6drINWKDwBN1qJj7P0jj9xYZ1lish291kh8UkecaHzUKufq8vRTB4sVqoTNFUwfuKTnnVn+M+R7d42b4nMbC9dddKwYqWZaBv6pqt1N431hsMoK0sWzfEQFZldvp42TgMBGI1RATaKwW8t2SfYtk/y8/gLAbaVOGW2MRkGulU3ZbjTTGMqO5P+3iWtRNHcdLh9rvxI5T31vjwj4FdymGkza7daQqMuXdDDh9kURuMtbcIGnO/9Wr/EWG4r0BJ8nMkUVm4pVN15V1AaBTpQI3RmorERpPOMu6qbQI0zw3v6lb6xRIbeunDl9LvHR3YbORicsqnbMaNBnOpKumMojBb4KvEwawCd1RXhArfElgfpdO8J0Nk7VgKGoTN0yxIvivUxBY+5NO8v7M3kF7tOH5VpDmaQmaFyGxFZJTTnyVB+ukP/cfMF4WJWwDlnec+mMzLWSWlXEu+Ra96Qd19GEsyBeW+fNckeyGS1wBRowetpJRP2cS97V+owhOdvqVzXuZnD7/fPEtEgZ8DubCDnsuQM2JPFFoa26C1XmY/NRUssrSNuaJeTI/SRNUd14QBBMrjR9LVVyZnRtLsSgmzAVA2Sa/cvc2+RiweTCJeXst6zAYNEGU= - bucket: webassembly - skip_cleanup: true - on: - tags: true - condition: -n ${WABT_DEPLOY} - acl: public-read - local_dir: gcs diff --git a/scripts/appveyor-after-test.bat b/scripts/appveyor-after-test.bat deleted file mode 100644 index 8c9114db..00000000 --- a/scripts/appveyor-after-test.bat +++ /dev/null @@ -1,23 +0,0 @@ -REM Copyright 2018 WebAssembly Community Group participants -REM -REM Licensed under the Apache License, Version 2.0 (the "License"); -REM you may not use this file except in compliance with the License. -REM You may obtain a copy of the License at -REM -REM http://www.apache.org/licenses/LICENSE-2.0 -REM -REM Unless required by applicable law or agreed to in writing, software -REM distributed under the License is distributed on an "AS IS" BASIS, -REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -REM See the License for the specific language governing permissions and -REM limitations under the License. - -REM Set up the artifact for this build, but only if this is a tag build. - -IF "%DEPLOY%" == "true" ( - IF "%APPVEYOR_REPO_TAG%" == "true" ( - ren "%APPVEYOR_BUILD_FOLDER%\\bin" "wabt-%APPVEYOR_REPO_TAG_NAME%" - 7z a %DEPLOY_NAME% "%APPVEYOR_BUILD_FOLDER%\\wabt-%APPVEYOR_REPO_TAG_NAME%\\*.exe" - python "%APPVEYOR_BUILD_FOLDER%\\scripts\\sha256sum.py" "%DEPLOY_NAME%" > "%DEPLOY_NAME%.sha256" - ) -) diff --git a/scripts/travis-before-deploy.sh b/scripts/travis-before-deploy.sh deleted file mode 100755 index f509fbff..00000000 --- a/scripts/travis-before-deploy.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/bash -# -# Copyright 2018 WebAssembly Community Group participants -# -# 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 -o nounset -set -o errexit - -SCRIPT_DIR="$(cd "$(dirname "$0")"; pwd -P)" -source "${SCRIPT_DIR}/travis-common.sh" - -sha256sum() { - ${SCRIPT_DIR}/sha256sum.py ${1} > ${1}.sha256 -} - -if [[ -n ${WABT_DEPLOY:-} ]]; then - # Rebuild the WABT_DEPLOY target so it copies the results into bin/ - make ${WABT_DEPLOY} - - PKGNAME="wabt-${TRAVIS_TAG}-${TRAVIS_OS_NAME}" - mv bin wabt-${TRAVIS_TAG} - tar -czf ${PKGNAME}.tar.gz wabt-${TRAVIS_TAG} - sha256sum ${PKGNAME}.tar.gz - - # We want to store the output in the `webassembly` bucket, with the directory - # `wabt/${TRAVIS_TAG}/${TRAVIS_OS_NAME}/`. The root directory is `gcs/` so it - # can be recursively copied by the deployment step. - GCS_DIR=gcs/wabt/${TRAVIS_TAG}/${TRAVIS_OS_NAME} - mkdir -p ${GCS_DIR} - cp wabt-${TRAVIS_TAG}/* ${GCS_DIR} - - # Create sha256 files for each tool. - cd ${GCS_DIR} - for tool in *; do - sha256sum ${tool} - done - cd - -fi diff --git a/scripts/travis-before-install.sh b/scripts/travis-before-install.sh deleted file mode 100755 index f5a430b2..00000000 --- a/scripts/travis-before-install.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash -# -# Copyright 2016 WebAssembly Community Group participants -# -# 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. -# - -if [[ ${TRAVIS_OS_NAME} = "osx" ]]; then - brew update -fi diff --git a/scripts/travis-build.sh b/scripts/travis-build.sh deleted file mode 100755 index 8e49667d..00000000 --- a/scripts/travis-build.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash -# -# Copyright 2016 WebAssembly Community Group participants -# -# 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 -o nounset -set -o errexit - -SCRIPT_DIR="$(cd "$(dirname "$0")"; pwd -P)" -source "${SCRIPT_DIR}/travis-common.sh" - -if [[ ${COMPILER} = "clang" && -z ${SANITIZER:-} ]]; then - # Test building without GTest submodule - make clang-debug-no-tests -fi - -for BUILD_TYPE in ${BUILD_TYPES}; do - if [[ -n ${SANITIZER:-} ]]; then - make ${COMPILER}-${BUILD_TYPE}-${SANITIZER} - else - make ${COMPILER}-${BUILD_TYPE} - fi -done diff --git a/scripts/travis-common.sh b/scripts/travis-common.sh deleted file mode 100755 index 3f0f9baf..00000000 --- a/scripts/travis-common.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash -# -# Copyright 2016 WebAssembly Community Group participants -# -# 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. -# - -SCRIPT_DIR="$(cd "$(dirname "$0")"; pwd -P)" -ROOT_DIR="$(dirname "${SCRIPT_DIR}")" -BUILD_TYPES="debug release" -BUILD_TYPES_UPPER="Debug Release" -COMPILER="${CC:=clang}" diff --git a/scripts/travis-emcc.sh b/scripts/travis-emcc.sh deleted file mode 100755 index 7287f870..00000000 --- a/scripts/travis-emcc.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash -# -# Copyright 2016 WebAssembly Community Group participants -# -# 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 -emconfigure cmake . -emmake make -j 2 - diff --git a/scripts/travis-test.sh b/scripts/travis-test.sh deleted file mode 100755 index a03e132d..00000000 --- a/scripts/travis-test.sh +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/bash -# -# Copyright 2016 WebAssembly Community Group participants -# -# 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 -o nounset -set -o errexit - -RTN=0 -SCRIPT_DIR="$(cd "$(dirname "$0")"; pwd -P)" -source "${SCRIPT_DIR}/travis-common.sh" - -cd ${ROOT_DIR} - -log_and_run() { - echo $* - if ! $*; then - echo "travis-test.sh: sub-command failed: $*" - RTN=1; - fi -} - -run_tests() { - log_and_run test/run-tests.py -v --bindir ${BINDIR} $* --timeout=10 - log_and_run ${BINDIR}/wabt-unittests -} - -set_run_test_args() { - local COMPILER=$1 - local BUILD_TYPE=$2 - local CONFIG=${3:-} - - BINDIR="out/${COMPILER}/${BUILD_TYPE}/${CONFIG}" -} - -for BUILD_TYPE in ${BUILD_TYPES_UPPER}; do - if [[ -n "${SANITIZER:-}" ]]; then - if set_run_test_args ${COMPILER} ${BUILD_TYPE} ${SANITIZER}; then - run_tests - fi - else - if set_run_test_args ${COMPILER} ${BUILD_TYPE}; then - run_tests - fi - fi -done - -echo "travis-test.sh done: $RTN" -exit $RTN |