| name: build_and_test |
|
|
| |
| on: |
| |
| push: |
| branches: [ master ] |
| pull_request: |
| branches: [ master ] |
| |
| workflow_dispatch: |
|
|
| env: |
| PIP_BREAK_SYSTEM_PACKAGES: 1 |
|
|
| |
| jobs: |
|
|
| unix: |
| strategy: |
| fail-fast: false |
| matrix: |
| runs-on: [ubuntu-latest] |
| build_tool: [bazel, cmake] |
|
|
| name: "${{matrix.runs-on}} ${{matrix.build_tool}}" |
| runs-on: ${{matrix.runs-on}} |
|
|
| |
| steps: |
| - name: Show env |
| run: env |
|
|
| |
| - uses: actions/checkout@v3 |
|
|
| - name: Install bazel |
| if: matrix.build_tool == 'bazel' |
| |
| run: | |
| sudo apt install curl gnupg |
| curl -fsSL https://bazel.build/bazel-release.pub.gpg | gpg --dearmor > bazel.gpg |
| sudo mv bazel.gpg /etc/apt/trusted.gpg.d/ |
| echo "deb [arch=amd64] https://storage.googleapis.com/bazel-apt stable jdk1.8" | sudo tee /etc/apt/sources.list.d/bazel.list |
| sudo apt update && sudo apt install bazel -y |
| |
| - name: Show bazel version |
| if: matrix.build_tool == 'bazel' |
| run: bazel --version |
|
|
| - name: Update cmake |
| if: matrix.build_tool == 'cmake' |
| uses: jwlawson/actions-setup-cmake@v1.14 |
|
|
| - name: Show cmake version |
| if: matrix.build_tool == 'cmake' |
| run: cmake --version |
|
|
| - name: Show platform info |
| run: python -m platform |
|
|
| - name: Install virtualenv |
| run: | |
| sudo apt-get install python3-pip -y |
| sudo pip3 install virtualenv |
| |
| - name: Show nproc |
| run: echo nproc=$(nproc) |
|
|
| - name: Build and run tests |
| run: bash ./scripts/build_and_run_tests_${{matrix.build_tool}}.sh -j $(nproc) |
|
|