| # This is a basic workflow to help you get started with Actions |
| |
| name: CI |
| |
| # Controls when the workflow will run |
| on: |
| push: |
| branches: [main, staging, trying] |
| pull_request: |
| branches: [main] |
| |
| # Allows you to run this workflow manually from the Actions tab |
| workflow_dispatch: |
| |
| # A workflow run is made up of one or more jobs that can run sequentially or in parallel |
| jobs: |
| |
| build_and_test: |
| # The type of runner that the job will run on |
| runs-on: ubuntu-20.04 |
| strategy: |
| matrix: |
| lib: |
| - "@com_google_googletest//..." |
| - "@com_google_absl//..." |
| |
| # Steps represent a sequence of tasks that will be executed as part of the job |
| steps: |
| # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it |
| - uses: actions/checkout@v3 |
| |
| - name: Mount bazel build cache |
| uses: actions/cache@v3 |
| with: |
| path: "~/bazel/disk_cache" |
| key: ${{ matrix.lib }}-${{ runner.os }}-bazel |
| |
| - name: Mount bazel repository cache |
| uses: actions/cache@v3 |
| with: |
| path: "~/bazel/repository_cache" |
| key: ${{ runner.os }}-bazel |
| |
| # Runs a single command using the runners shell |
| - name: Bazel build/test external test repos |
| run: | |
| bazelisk --bazelrc=ci.bazelrc test ${{ matrix.lib }} |
| bazelisk --bazelrc=ci.bazelrc build ${{ matrix.lib }} |
| bazelisk --bazelrc=ci.bazelrc build ${{ matrix.lib }} --config analyser |
| |
| ci-success: |
| name: ci |
| if: ${{ success() }} |
| needs: |
| - build_and_test |
| runs-on: ubuntu-20.04 |
| steps: |
| - name: CI succeeded |
| run: exit 0 |