Skip to content

Commit

Permalink
Don't build manual targets on CI (#162)
Browse files Browse the repository at this point in the history
* Don't build manual targets on CI

* Run main CI using the same configs

* Revert

* Use try-import to import the CI test configuration

* Enable --test_tag_filters=-manual always
  • Loading branch information
Bencodes authored Oct 5, 2023
1 parent fcc6c4e commit c6562c0
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
common --enable_bzlmod
common --test_tag_filters=-manual

try-import %workspace%/ci.bazelrc
4 changes: 1 addition & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ jobs:
- name: "Build"
run: bazel build //detekt/wrapper:bin
- name: "Unit tests"
run: bazel test //detekt/wrapper:tests
- name: "Analysis tests"
run: bazel test //tests/analysis:tests
run: bazel test //...
- name: "Integration tests"
run: bash tests/integration/suite.sh
2 changes: 2 additions & 0 deletions tests/analysis/tests.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ def _test_action_full_contents():
parallel = True,
# The "plugins" option is skipped here since the path includes a declared Detekt version
# and we do not want to change the test every time the Detekt artifact is updated.
tags = ["manual"],
)

action_full_contents_test(
Expand Down Expand Up @@ -157,6 +158,7 @@ def _test_action_blank_contents():
detekt(
name = "test_target_blank",
srcs = ["path A.kt", "path B.kt", "path C.kt"],
tags = ["manual"],
)

action_blank_contents_test(
Expand Down
8 changes: 8 additions & 0 deletions tests/integration/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -3,46 +3,54 @@ load("//detekt:defs.bzl", "detekt")
filegroup(
name = "detekt_config_lenient",
srcs = ["detekt_config_lenient.yml"],
tags = ["manual"],
)

detekt(
name = "detekt_without_config",
srcs = glob(["src/main/kotlin/**/*.kt"]),
tags = ["manual"],
)

detekt(
name = "detekt_without_config_with_report_html",
srcs = glob(["src/main/kotlin/**/*.kt"]),
html_report = True,
tags = ["manual"],
)

detekt(
name = "detekt_without_config_with_report_xml",
srcs = glob(["src/main/kotlin/**/*.kt"]),
tags = ["manual"],
xml_report = True,
)

detekt(
name = "detekt_without_config_with_baseline",
srcs = glob(["src/main/kotlin/**/*.kt"]),
baseline = "detekt_baseline.xml",
tags = ["manual"],
)

detekt(
name = "detekt_without_config_with_baseline_with_plugin",
srcs = glob(["src/main/kotlin/**/*.kt"]),
baseline = "detekt_baseline.xml",
tags = ["manual"],
plugins = ["@rules_detekt_dependencies//:io_gitlab_arturbosch_detekt_detekt_formatting"],
)

detekt(
name = "detekt_with_config_file_lenient",
srcs = glob(["src/main/kotlin/**/*.kt"]),
cfgs = ["detekt_config_lenient.yml"],
tags = ["manual"],
)

detekt(
name = "detekt_with_config_filegroup_lenient",
srcs = glob(["src/main/kotlin/**/*.kt"]),
cfgs = ["//tests/integration:detekt_config_lenient"],
tags = ["manual"],
)

0 comments on commit c6562c0

Please sign in to comment.