| # Copyright 2019 Google LLC |
| # |
| # 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 |
| # |
| # https://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. |
| |
| name: Continuous Integration |
| |
| on: |
| push: |
| branches: |
| - master |
| - ci-test # A branch specifically for testing CI |
| |
| jobs: |
| bazel: |
| runs-on: ubuntu-18.04 |
| env: |
| CXX: clang++ |
| CC: clang |
| PYTHON_BIN: /usr/bin/python3 |
| steps: |
| - name: Installing bazel |
| run: | |
| echo "deb [arch=amd64] https://storage.googleapis.com/bazel-apt stable jdk1.8" | sudo tee /etc/apt/sources.list.d/bazel.list |
| sudo apt install curl |
| curl https://bazel.build/bazel-release.pub.gpg | sudo apt-key add - |
| sudo apt-get update && sudo apt-get install bazel |
| - name: Installing dependencies |
| run: | |
| sudo apt-get update |
| sudo apt-get install clang libsdl2-dev python3 python3-pip |
| sudo pip install numpy |
| - name: Checking out latest version and all submodules |
| run: | |
| git config --global remote.origin.fetch '+refs/pull/*:refs/remotes/origin/pull/*' |
| git clone https://github.com/$GITHUB_REPOSITORY $GITHUB_WORKSPACE --no-checkout --no-tags |
| git checkout $GITHUB_SHA |
| git submodule update --init --depth 1000 --jobs 8 |
| - name: Building and testing with bazel |
| run: | |
| # Build and test everything not explicitly marked as excluded from CI |
| # (using the tag "notap", "Test Automation Platform"). |
| # Note that somewhat contrary to its name `bazel test` will also build |
| # any non-test targets specified. |
| # We use `bazel query //...` piped to `bazel test` rather than the |
| # simpler `bazel test //...` because the latter excludes targets |
| # tagged "manual". The "manual" tag allows targets to be excluded from |
| # human wildcard builds, but we want them built by CI unless they are |
| # excluded with "notap". |
| # TODO(gcmn) Enable all tests except notap once we can run them on the CI |
| bazel query '//... except attr("tags", "notap", //...) except //bindings/... except //integrations/... except //iree/hal/vulkan:dynamic_symbols_test except //iree/samples/rt:bytecode_module_api_test' | xargs bazel test --test_output=errors |
| |
| cmake: |
| runs-on: ubuntu-18.04 |
| env: |
| CXX: clang++ |
| CC: clang |
| PYTHON_BIN: /usr/bin/python3 |
| steps: |
| - name: Installing dependencies |
| run: | |
| sudo apt-get update |
| sudo apt-get install clang libsdl2-dev python3 python3-pip |
| sudo pip install numpy |
| - name: Checking out latest version and all submodules |
| run: | |
| git config --global remote.origin.fetch '+refs/pull/*:refs/remotes/origin/pull/*' |
| git clone https://github.com/$GITHUB_REPOSITORY $GITHUB_WORKSPACE --no-checkout --no-tags |
| git checkout $GITHUB_SHA |
| git submodule update --init --depth 1000 --jobs 8 |
| - name: Building with cmake |
| run: | |
| mkdir build && cd build |
| cmake -DIREE_BUILD_COMPILER=OFF -DIREE_BUILD_TESTS=ON -DIREE_BUILD_SAMPLES=OFF -DIREE_BUILD_DEBUGGER=OFF .. |
| cmake --build . |