diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 18ea0017f44c..fa852843e7de 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -151,6 +151,13 @@ jobs: run: hadoop-ozone/dev-support/checks/build.sh -Pdist -Psrc -Dmaven.javadoc.skip=true ${{ inputs.ratis_args }} env: DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }} + - name: Archive build results + uses: actions/upload-artifact@v4 + if: ${{ !cancelled() }} + with: + name: ${{ github.job }} + path: target/${{ github.job }} + continue-on-error: true - name: Store binaries for tests uses: actions/upload-artifact@v4 with: @@ -227,10 +234,17 @@ jobs: distribution: 'temurin' java-version: ${{ matrix.java }} - name: Compile Ozone using Java ${{ matrix.java }} - run: hadoop-ozone/dev-support/checks/build.sh -Pdist -DskipRecon -Dmaven.javadoc.failOnWarnings=${{ matrix.java != 8 }} -Djavac.version=${{ matrix.java }} ${{ inputs.ratis_args }} + run: hadoop-ozone/dev-support/checks/compile.sh -Pdist -DskipRecon -Dmaven.javadoc.failOnWarnings=${{ matrix.java != 8 }} -Djavac.version=${{ matrix.java }} ${{ inputs.ratis_args }} env: OZONE_WITH_COVERAGE: false DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }} + - name: Archive build results + uses: actions/upload-artifact@v4 + if: ${{ !cancelled() }} + with: + name: ${{ github.job }}-${{ matrix.java }} + path: target/${{ github.job }} + continue-on-error: true basic: needs: - build-info diff --git a/hadoop-ozone/dev-support/checks/_build.sh b/hadoop-ozone/dev-support/checks/_build.sh index b1f23a9ba8a2..fa2ff3224caa 100755 --- a/hadoop-ozone/dev-support/checks/_build.sh +++ b/hadoop-ozone/dev-support/checks/_build.sh @@ -13,11 +13,20 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. + +set -u -o pipefail + DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" cd "$DIR/../../.." || exit 1 +: ${CHECK:="build"} +: ${ERROR_PATTERN:="\[ERROR\]"} : ${OZONE_WITH_COVERAGE:="false"} +BASE_DIR="$(pwd -P)" +REPORT_DIR=${OUTPUT_DIR:-"${BASE_DIR}/target/${CHECK}"} +REPORT_FILE="$REPORT_DIR/summary.txt" + MAVEN_OPTIONS='-V -B -DskipTests -DskipDocs --no-transfer-progress' if [[ "${OZONE_WITH_COVERAGE}" == "true" ]]; then @@ -27,5 +36,10 @@ else fi export MAVEN_OPTS="-Xmx4096m ${MAVEN_OPTS:-}" -mvn ${MAVEN_OPTIONS} clean "$@" +mvn ${MAVEN_OPTIONS} clean "$@" | tee output.log rc=$? + +mkdir -p "$REPORT_DIR" # after `mvn clean` +mv output.log "$REPORT_DIR"/ + +source "${DIR}/_post_process.sh" diff --git a/hadoop-ozone/dev-support/checks/build.sh b/hadoop-ozone/dev-support/checks/build.sh index ac524f755e32..11adbb9b8c0a 100755 --- a/hadoop-ozone/dev-support/checks/build.sh +++ b/hadoop-ozone/dev-support/checks/build.sh @@ -14,7 +14,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -set -eu -o pipefail +set -u -o pipefail DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" + source "${DIR}"/_build.sh install "$@" diff --git a/hadoop-ozone/dev-support/checks/compile.sh b/hadoop-ozone/dev-support/checks/compile.sh new file mode 100755 index 000000000000..cdae70546e7c --- /dev/null +++ b/hadoop-ozone/dev-support/checks/compile.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -u -o pipefail + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" + +CHECK=compile + +source "${DIR}"/_build.sh verify "$@" diff --git a/hadoop-ozone/dev-support/checks/repro.sh b/hadoop-ozone/dev-support/checks/repro.sh index 8d3db0fa7e99..cbc707c12745 100755 --- a/hadoop-ozone/dev-support/checks/repro.sh +++ b/hadoop-ozone/dev-support/checks/repro.sh @@ -19,19 +19,8 @@ set -u -o pipefail DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" -cd "$DIR/../../.." || exit 1 -BASE_DIR="$(pwd -P)" -REPORT_DIR=${OUTPUT_DIR:-"${BASE_DIR}/target/repro"} +CHECK=repro +ERROR_PATTERN='ERROR.*mismatch' -rc=0 -source "${DIR}"/_build.sh verify artifact:compare "$@" | tee output.log - -mkdir -p "$REPORT_DIR" -mv output.log "$REPORT_DIR"/ - -REPORT_FILE="$REPORT_DIR/summary.txt" -grep 'ERROR.*mismatch' "${REPORT_DIR}/output.log" > "${REPORT_FILE}" - -ERROR_PATTERN="\[ERROR\]" -source "${DIR}/_post_process.sh" +source "${DIR}"/_build.sh verify artifact:compare "$@"