Add OS matrix to test the project and examples on Ubuntu, Windows and macOS

This commit is contained in:
Erik C. Thauvin 2025-03-24 01:44:39 -07:00
parent 30f92d1262
commit 7d5b50641c
Signed by: erik
GPG key ID: 776702A6A2DA330E
3 changed files with 25 additions and 12 deletions

View file

@ -4,11 +4,13 @@ on: [push, pull_request, workflow_dispatch]
jobs:
build-bld-project:
runs-on: ubuntu-latest
strategy:
matrix:
java-version: [ 17, 21, 24 ]
kotlin-version: [ 1.9.25, 2.0.21, 2.1.20 ]
os: [ ubuntu-latest, windows-latest, macos-latest ]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout source repository
@ -22,12 +24,16 @@ jobs:
distribution: "zulu"
java-version: ${{ matrix.java-version }}
- name: Download dependencies
run: ./bld download
- name: Download dependencies [examples]
working-directory: examples
run: ./bld download
- name: Run tests [examples]
working-directory: examples
run: ./bld compile test
- name: Download dependencies
run: ./bld download
- name: Run tests
run: ./bld compile test

View file

@ -23,6 +23,7 @@ import rife.bld.publish.PublishLicense;
import rife.bld.publish.PublishScm;
import java.util.List;
import java.util.Locale;
import static rife.bld.dependencies.Repository.*;
import static rife.bld.dependencies.Scope.compile;
@ -97,10 +98,13 @@ public class DetektOperationBuild extends Project {
@Override
public void test() throws Exception {
var os = System.getProperty("os.name");
if (os != null && os.toLowerCase(Locale.US).contains("linux")) {
new ExecOperation()
.fromProject(this)
.command("scripts/cliargs.sh")
.execute();
}
super.test();
}

View file

@ -19,6 +19,8 @@ package rife.bld.extension;
import org.assertj.core.api.AutoCloseableSoftAssertions;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.EnabledOnOs;
import org.junit.jupiter.api.condition.OS;
import rife.bld.BaseProject;
import rife.bld.blueprints.BaseProjectBlueprint;
import rife.bld.extension.detekt.Report;
@ -92,6 +94,7 @@ class DetektOperationTest {
}
@Test
@EnabledOnOs(OS.LINUX)
@SuppressWarnings("PMD.AvoidInstantiatingObjectsInLoops")
void testCheckAllParameters() throws IOException {
var args = Files.readAllLines(Paths.get("src", "test", "resources", "detekt-args.txt"));