Skip to content

Expand test coverage (#232) #759

Expand test coverage (#232)

Expand test coverage (#232) #759

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:
runs-on: ubuntu-latest
steps:
- name: "Checkout the sources"
uses: actions/checkout@v7
- name: "Install JDK 11"
uses: actions/setup-java@v4
with:
distribution: "zulu"
java-version: "11"
- name: Mount bazel caches
uses: actions/cache@v6
with:
path: |
~/.cache/bazel-disk-cache
key: bazel-cache-${{ hashFiles('**/BUILD.bazel', '**/*.bzl', 'MODULE.bazel', 'MODULE.bazel.lock') }}
restore-keys: bazel-cache-
- name: "Setup Bazelisk"
uses: bazelbuild/setup-bazelisk@v3
- name: "Configure Bazel"
run: cp .github/workflows/ci.bazelrc .
- name: "Build"
run: bazel build //detekt/wrapper:bin
test:
runs-on: ubuntu-latest
steps:
- name: "Checkout the sources"
uses: actions/checkout@v7
- name: "Install JDK 11"
uses: actions/setup-java@v4
with:
distribution: "zulu"
java-version: "11"
- name: Mount bazel caches
uses: actions/cache@v6
with:
path: |
~/.cache/bazel-disk-cache
key: bazel-cache-${{ hashFiles('**/BUILD.bazel', '**/*.bzl', 'MODULE.bazel', 'MODULE.bazel.lock') }}
restore-keys: bazel-cache-
- name: "Setup Bazelisk"
uses: bazelbuild/setup-bazelisk@v3
- name: "Configure Bazel"
run: cp .github/workflows/ci.bazelrc .
- name: "Unit tests"
run: bazel test -- //... -//tests/integration/...
integration-test:
runs-on: ubuntu-latest
strategy:
matrix:
detekt-strategy: [local, worker]
steps:
- name: "Checkout the sources"
uses: actions/checkout@v7
- name: "Install JDK 11"
uses: actions/setup-java@v4
with:
distribution: "zulu"
java-version: "11"
- name: Mount bazel caches
uses: actions/cache@v6
with:
path: |
~/.cache/bazel-disk-cache
key: bazel-cache-${{ hashFiles('**/BUILD.bazel', '**/*.bzl', 'MODULE.bazel', 'MODULE.bazel.lock') }}
restore-keys: bazel-cache-
- name: "Setup Bazelisk"
uses: bazelbuild/setup-bazelisk@v3
- name: "Configure Bazel"
run: cp .github/workflows/ci.bazelrc .
- name: "Integration tests (${{ matrix.detekt-strategy }})"
run: bazel test --strategy=Detekt=${{ matrix.detekt-strategy }} --disk_cache= --cache_test_results=no //tests/integration/...