Skip to content

Surface Detekt stderr output for detekt_test targets #717

Surface Detekt stderr output for detekt_test targets

Surface Detekt stderr output for detekt_test targets #717

Workflow file for this run

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: [master]
pull_request:
branches: [master]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
concurrency:
# Cancel previous actions from the same PR: https://stackoverflow.com/a/72408109
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest]
include:
- mode: bzlmod
flags: ""
- mode: workspace
flags: "--noenable_bzlmod --enable_workspace"
runs-on: ${{ matrix.os }}
steps:
- name: "Checkout the sources"
uses: actions/checkout@v6
- name: "Install JDK 11"
uses: actions/setup-java@v4
with:
distribution: "zulu"
java-version: "11"
- name: Mount bazel caches
uses: actions/cache@v4
with:
path: |
~/.cache/bazel-disk-cache
key: bazel-cache-${{ matrix.mode }}-${{ hashFiles('**/BUILD.bazel', '**/*.bzl', 'WORKSPACE.bazel', 'WORKSPACE.bzlmod') }}
restore-keys: bazel-cache-${{ matrix.mode }}-
- name: "Setup Bazelisk"
uses: bazelbuild/setup-bazelisk@v3
- name: "Configure Bazel"
run: cp .github/workflows/ci.bazelrc .
- name: "Build (${{ matrix.mode }})"
run: bazel build //detekt/wrapper:bin ${{ matrix.flags }}
test:
strategy:
matrix:
os: [ubuntu-latest]
include:
- mode: bzlmod
flags: ""
- mode: workspace
flags: "--noenable_bzlmod --enable_workspace"
runs-on: ${{ matrix.os }}
steps:
- name: "Checkout the sources"
uses: actions/checkout@v6
- name: "Install JDK 11"
uses: actions/setup-java@v4
with:
distribution: "zulu"
java-version: "11"
- name: Mount bazel caches
uses: actions/cache@v4
with:
path: |
~/.cache/bazel-disk-cache
key: bazel-cache-${{ matrix.mode }}-${{ hashFiles('**/BUILD.bazel', '**/*.bzl', 'WORKSPACE.bazel', 'WORKSPACE.bzlmod') }}
restore-keys: bazel-cache-${{ matrix.mode }}-
- name: "Setup Bazelisk"
uses: bazelbuild/setup-bazelisk@v3
- name: "Configure Bazel"
run: cp .github/workflows/ci.bazelrc .
- name: "Unit tests (${{ matrix.mode }})"
run: bazel test //... ${{ matrix.flags }}
integration-test:
strategy:
matrix:
os: [ubuntu-latest]
include:
- mode: bzlmod
flags: ""
- mode: workspace
flags: "--noenable_bzlmod --enable_workspace"
runs-on: ${{ matrix.os }}
steps:
- name: "Checkout the sources"
uses: actions/checkout@v6
- name: "Install JDK 11"
uses: actions/setup-java@v4
with:
distribution: "zulu"
java-version: "11"
- name: Mount bazel caches
uses: actions/cache@v4
with:
path: |
~/.cache/bazel-disk-cache
key: bazel-cache-${{ matrix.mode }}-${{ hashFiles('**/BUILD.bazel', '**/*.bzl', 'WORKSPACE.bazel', 'WORKSPACE.bzlmod') }}
restore-keys: bazel-cache-${{ matrix.mode }}-
- name: "Setup Bazelisk"
uses: bazelbuild/setup-bazelisk@v3
- name: "Configure Bazel"
run: cp .github/workflows/ci.bazelrc .
- name: "Integration tests (${{ matrix.mode }})"
run: bash tests/integration/suite.sh "${{ matrix.flags }}"