mirror of
https://github.com/danieldemus/openhab-core.git
synced 2025-02-04 08:03:53 +01:00
GitHub Actions workflow improvements (#2557)
* Checkout merged branches for pull requests * Echo the mvn command used for builds * Use more functions in maven-build so it is similar to what will be used for add-on builds Signed-off-by: Wouter Born <github@maindrain.net>
This commit is contained in:
parent
4bc8027461
commit
cd29a16609
46
.github/scripts/maven-build
vendored
46
.github/scripts/maven-build
vendored
@ -1,7 +1,11 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
BUILD_LOG=build.log
|
BUILD_LOG=build.log
|
||||||
DEFAULT_ARGUMENTS="clean verify -B -T 1.5C -U"
|
|
||||||
|
ARGUMENTS="clean verify -B -T 1.5C -U"
|
||||||
|
if [ $# -ge 1 ]; then
|
||||||
|
ARGUMENTS=$@
|
||||||
|
fi
|
||||||
|
|
||||||
function print_reactor_summary() {
|
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_end=$(grep -anE "\[INFO\] \\-{70,}" "$BUILD_LOG" | tail -n4 | cut -f1 -d: | sed -e 1b -e '$!d' | xargs)
|
||||||
@ -22,22 +26,26 @@ function mvnp() {
|
|||||||
stdbuf -o0 sed -e :a -e "s/^.\{1,${padding}\}|/ &/;ta" # right align progress with padding
|
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
|
mvn -v
|
||||||
echo
|
build_all
|
||||||
|
|
||||||
if [ $# -ge 1 ]; then
|
|
||||||
mvnp $@
|
|
||||||
else
|
|
||||||
mvnp $DEFAULT_ARGUMENTS
|
|
||||||
fi
|
|
||||||
|
|
||||||
status=$?
|
|
||||||
echo
|
|
||||||
|
|
||||||
if [ $status -eq 0 ]; then
|
|
||||||
print_reactor_summary
|
|
||||||
else
|
|
||||||
tail -n 2000 "$BUILD_LOG"
|
|
||||||
fi
|
|
||||||
|
|
||||||
exit $status
|
|
||||||
|
7
.github/workflows/ci-build.yml
vendored
7
.github/workflows/ci-build.yml
vendored
@ -24,8 +24,15 @@ jobs:
|
|||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
|
if: github.head_ref == ''
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Checkout merge
|
||||||
|
if: github.head_ref != ''
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
ref: refs/pull/${{github.event.pull_request.number}}/merge
|
||||||
|
|
||||||
- name: Set up Cache
|
- name: Set up Cache
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v2
|
||||||
with:
|
with:
|
||||||
|
Loading…
Reference in New Issue
Block a user