diff options
author | Sam Clegg <sbc@chromium.org> | 2020-05-18 23:12:24 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-18 20:12:24 -0700 |
commit | a08df5c90ce65c5f83656ee464e562603d0e74b9 (patch) | |
tree | 6cfdadfc698295513833f409bd876337f1c16802 /.github | |
parent | a9317fb219e958b819b9ce98d15214803953c24c (diff) | |
download | wabt-a08df5c90ce65c5f83656ee464e562603d0e74b9.tar.gz wabt-a08df5c90ce65c5f83656ee464e562603d0e74b9.tar.bz2 wabt-a08df5c90ce65c5f83656ee464e562603d0e74b9.zip |
Complete conversion to github actions (#1431)
Diffstat (limited to '.github')
-rw-r--r-- | .github/workflows/build.yml | 68 | ||||
-rw-r--r-- | .github/workflows/build_release.yml | 90 |
2 files changed, 155 insertions, 3 deletions
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 |