diff --git a/.github/scripts/maven-build b/.github/scripts/maven-build deleted file mode 100755 index 29cb4f50081..00000000000 --- a/.github/scripts/maven-build +++ /dev/null @@ -1,51 +0,0 @@ -#!/bin/bash - -BUILD_LOG=build.log - -ARGUMENTS="clean verify -B -T 1.5C -U" -if [ $# -ge 1 ]; then - ARGUMENTS=$@ -fi - -function print_reactor_summary() { - local start_end=$(grep -anE "\[INFO\] \\-{70,}" "$BUILD_LOG" | tail -n4 | cut -f1 -d: | sed -e 1b -e '$!d' | xargs) - local start=$(awk '{print $1}' <<< $start_end) - local end=$(awk '{print $2}' <<< $start_end) - cat "$BUILD_LOG" | sed -n "${start},${end}p" | sed 's/\[INFO\] //' -} - -function mvnp() { - set -o pipefail # exit build with error when pipes fail - local reactor_size=$(find -name "pom.xml" | grep -vE '/src/|/target/' | wc -l) - local padding=$(bc -l <<< "scale=0;2*(l($reactor_size)/l(10)+1)") - local command=(mvn $@) - exec "${command[@]}" 2>&1 | # execute, redirect stderr to stdout - tee "$BUILD_LOG" | # write output to log - stdbuf -oL grep -aE '^\[INFO\] Building .+ \[.+\]$' | # filter progress - stdbuf -o0 sed -uE 's/^\[INFO\] Building (.*[^ ])[ ]+\[([0-9]+\/[0-9]+)\]$/\2| \1/' | # prefix project name with progress - stdbuf -o0 sed -e :a -e "s/^.\{1,${padding}\}|/ &/;ta" # right align progress with padding -} - -function build_all() { - echo - echo "Building all projects" - echo - echo "+ mvn $ARGUMENTS" - echo - - mvnp $ARGUMENTS - - status=$? - echo - - if [ $status -eq 0 ]; then - print_reactor_summary - else - tail -n 2000 "$BUILD_LOG" - fi - - exit $status -} - -mvn -v -build_all diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 22ad0b09ee5..89e7a4c2315 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -4,6 +4,7 @@ on: push: branches: - 'main' + - 'use-tempdir' paths-ignore: - '.github/**/*.md' pull_request: @@ -20,10 +21,16 @@ jobs: matrix: java: [ '17' ] maven: [ '3.8.6' ] - os: [ 'ubuntu-22.04' ] + os: [ 'macos-12', 'ubuntu-22.04', 'windows-2022' ] name: Build (Java ${{ matrix.java }}, ${{ matrix.os }}) runs-on: ${{ matrix.os }} steps: + - name: Set up line endings + if: ${{ matrix.os == 'windows-2022' }} + run: | + git config --global core.autocrlf false + git config --global core.eol crlf + - name: Checkout if: github.head_ref == '' uses: actions/checkout@v3 @@ -56,14 +63,14 @@ jobs: maven-version: ${{ matrix.maven }} - name: Register Problem Matchers - if: ${{ matrix.java == '17' }} + if: ${{ matrix.java == '17' && matrix.os == 'ubuntu-22.04' }} id: problem_matchers run: | echo "::add-matcher::.github/openhab-compile-problems.json" - name: Build id: build - run: './.github/scripts/maven-build' + run: mvn clean verify -B -T 1.5C -U env: MAVEN_OPTS: >- -Xmx2g @@ -86,7 +93,7 @@ jobs: path: target/summary_report.html - name: Report SAT Errors as Annotations - if: ${{ matrix.java == '17' && always() && ((steps.build.outcome == 'success') || (steps.build.outcome == 'failure')) }} + if: ${{ matrix.java == '17' && matrix.os == 'ubuntu-22.04' && always() && ((steps.build.outcome == 'success') || (steps.build.outcome == 'failure')) }} uses: ghys/checkstyle-github-action@main with: title: CheckStyle Violations