| 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 |
| |
| strategy: |
| matrix: |
| folder: |
| - '.' |
| - 'e2e/bzlmod' |
| - 'e2e/npm_link_package' |
| - 'e2e/pnpm_workspace' |
| - 'e2e/pnpm_workspace_rerooted' |
| - 'e2e/rules_foo' |
| - 'e2e/js_image' |
| |
| # 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 caches |
| uses: actions/cache@v3 |
| with: |
| path: | |
| "~/.cache/bazel" |
| "~/.cache/bazel-repo" |
| key: bazel-cache-${{ hashFiles('**/BUILD.bazel', '**/*.bzl', 'WORKSPACE', '**/*.js') }} |
| restore-keys: bazel-cache- |
| - name: bazel test //... |
| env: |
| # Bazelisk will download bazel to here |
| XDG_CACHE_HOME: ~/.cache/bazel-repo |
| working-directory: ${{ matrix.folder }} |
| run: | |
| bazel --bazelrc=$GITHUB_WORKSPACE/.github/workflows/ci.bazelrc --bazelrc=.bazelrc test //... |
| ls $(bazel info output_base)/external | grep -v __links | grep -vz unused |