Skip to content

Commit 7d5b506

Browse files
committed
Add OS matrix to test the project and examples on Ubuntu, Windows and macOS
1 parent 30f92d1 commit 7d5b506

File tree

3 files changed

+24
-11
lines changed

3 files changed

+24
-11
lines changed

.github/workflows/bld.yml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
name: bld-ci
22

3-
on: [push, pull_request, workflow_dispatch]
3+
on: [ push, pull_request, workflow_dispatch ]
44

55
jobs:
66
build-bld-project:
7-
runs-on: ubuntu-latest
8-
97
strategy:
108
matrix:
11-
java-version: [17, 21, 24]
9+
java-version: [ 17, 21, 24 ]
10+
kotlin-version: [ 1.9.25, 2.0.21, 2.1.20 ]
11+
os: [ ubuntu-latest, windows-latest, macos-latest ]
12+
13+
runs-on: ${{ matrix.os }}
1214

1315
steps:
1416
- name: Checkout source repository
@@ -22,12 +24,16 @@ jobs:
2224
distribution: "zulu"
2325
java-version: ${{ matrix.java-version }}
2426

25-
- name: Download dependencies
27+
- name: Download dependencies [examples]
28+
working-directory: examples
2629
run: ./bld download
2730

28-
- name: Download dependencies [examples]
31+
- name: Run tests [examples]
2932
working-directory: examples
33+
run: ./bld compile test
34+
35+
- name: Download dependencies
3036
run: ./bld download
3137

3238
- name: Run tests
33-
run: ./bld compile test
39+
run: ./bld compile test

src/bld/java/rife/bld/extension/DetektOperationBuild.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import rife.bld.publish.PublishScm;
2424

2525
import java.util.List;
26+
import java.util.Locale;
2627

2728
import static rife.bld.dependencies.Repository.*;
2829
import static rife.bld.dependencies.Scope.compile;
@@ -97,10 +98,13 @@ public void pmd() throws Exception {
9798

9899
@Override
99100
public void test() throws Exception {
100-
new ExecOperation()
101-
.fromProject(this)
102-
.command("scripts/cliargs.sh")
103-
.execute();
101+
var os = System.getProperty("os.name");
102+
if (os != null && os.toLowerCase(Locale.US).contains("linux")) {
103+
new ExecOperation()
104+
.fromProject(this)
105+
.command("scripts/cliargs.sh")
106+
.execute();
107+
}
104108
super.test();
105109
}
106110

src/test/java/rife/bld/extension/DetektOperationTest.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
import org.assertj.core.api.AutoCloseableSoftAssertions;
2020
import org.junit.jupiter.api.BeforeAll;
2121
import org.junit.jupiter.api.Test;
22+
import org.junit.jupiter.api.condition.EnabledOnOs;
23+
import org.junit.jupiter.api.condition.OS;
2224
import rife.bld.BaseProject;
2325
import rife.bld.blueprints.BaseProjectBlueprint;
2426
import rife.bld.extension.detekt.Report;
@@ -92,6 +94,7 @@ void testBaseline() {
9294
}
9395

9496
@Test
97+
@EnabledOnOs(OS.LINUX)
9598
@SuppressWarnings("PMD.AvoidInstantiatingObjectsInLoops")
9699
void testCheckAllParameters() throws IOException {
97100
var args = Files.readAllLines(Paths.get("src", "test", "resources", "detekt-args.txt"));

0 commit comments

Comments
 (0)