2021-11-08 14:20:26 +00:00
|
|
|
name: CI
|
|
|
|
|
|
|
|
# Controls when the action will run.
|
|
|
|
on:
|
|
|
|
# Triggers the workflow on push or pull request events but only for the main branch
|
|
|
|
push:
|
|
|
|
branches: [main]
|
|
|
|
pull_request:
|
|
|
|
branches: [main]
|
|
|
|
|
|
|
|
# Allows you to run this workflow manually from the Actions tab
|
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
test:
|
|
|
|
# The type of runner that the job will run on
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
2022-04-27 04:07:17 +00:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
folder:
|
|
|
|
- "."
|
|
|
|
- "e2e/bzlmod"
|
|
|
|
|
2021-11-08 14:20:26 +00:00
|
|
|
# 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@v2
|
|
|
|
- uses: bazelbuild/setup-bazelisk@v1
|
2022-01-21 16:48:43 +00:00
|
|
|
- name: Mount bazel caches
|
2021-11-08 14:20:26 +00:00
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
2022-01-21 16:48:43 +00:00
|
|
|
path: |
|
|
|
|
"~/.cache/bazel"
|
|
|
|
"~/.cache/bazel-repo"
|
|
|
|
key: bazel-cache-${{ hashFiles('**/BUILD.bazel', '**/*.bzl', 'WORKSPACE') }}
|
|
|
|
restore-keys: bazel-cache-
|
2021-11-08 14:20:26 +00:00
|
|
|
- name: bazel test //...
|
|
|
|
env:
|
|
|
|
# Bazelisk will download bazel to here
|
|
|
|
XDG_CACHE_HOME: ~/.cache/bazel-repo
|
2022-04-27 04:07:17 +00:00
|
|
|
working-directory: ${{ matrix.folder }}
|
|
|
|
run: bazel --bazelrc=$GITHUB_WORKSPACE/.github/workflows/ci.bazelrc --bazelrc=.bazelrc test //...
|
2022-03-31 00:01:16 +00:00
|
|
|
- name: integration tests
|
2022-04-27 04:07:17 +00:00
|
|
|
if: ${{ matrix.folder == '.' }}
|
2022-03-31 00:01:16 +00:00
|
|
|
# Find all shell scripts within e2e, echo the filename, execute, fail on error
|
|
|
|
run: find e2e/*.sh -maxdepth 1 -type f -exec sh -c 'echo "\n\n------------------------------- $0 -------------------------------" && "$0" || kill $PPID' \{\} \;
|