Simplify CI-PR (#570)

Removed checks for changed modules and ensure the build scripts works in the absence of credentials.
This changes the distribution to use liberica since it properly detects the latest patch version of the distribution.

See #550
This commit is contained in:
Corneil du Plessis
2024-11-14 13:23:32 +02:00
committed by GitHub
parent 7e0a34d133
commit e46b43b23f
6 changed files with 50 additions and 60 deletions

View File

@@ -7,10 +7,16 @@ env:
MAIN_PATH: 'build-dir'
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MAVEN_THREADS: 'false'
BUILD_NAME: 'stream-applications-${{ github.ref_name }}'
BUILD_NUMBER: ${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }}
ARTIFACTORY_USERNAME: 'anonymous'
ARTIFACTORY_PASSWORD: 'anonymous'
SKIP_DEPLOY: 'true'
jobs:
build:
if: github.repository == 'spring-cloud/stream-applications'
runs-on: ubuntu-latest
runs-on: ubuntu22-8-32-OSS
steps:
- name: 'Configure: checkout stream-applications@${{ github.ref_name }}'
uses: actions/checkout@v3
@@ -26,18 +32,10 @@ jobs:
shell: bash
run: find . -type f -name "*.sh" -exec chmod a+x '{}' \;
- name: 'Configure: Install Java'
if: ${{ github.base_ref != 'main' }}
uses: actions/setup-java@v1
uses: actions/setup-java@v4
with:
java-version: ${{ needs.parameters.outputs.jdk_build }}
- name: 'Configure: Install GraalVM'
if: ${{ github.base_ref == 'main' }}
uses: graalvm/setup-graalvm@v1
with:
version: 'latest'
java-version: '17'
components: 'js'
github-token: ${{ secrets.GITHUB_TOKEN }}
distribution: 'liberica'
- name: 'Configure: cache for maven dependencies'
uses: actions/cache@v3
with:
@@ -49,51 +47,18 @@ jobs:
maven-repo-
- name: 'Configure: Install xsltproc'
uses: ./.github/actions/install-xsltproc
- name: 'Action: verify changed modules'
- name: 'Action: Build Core'
shell: bash
env:
VERBOSE: ${{ github.debug && 'true' || '' }}
run: |
PR=$(echo "${{ github.ref_name }}" | grep -o '[[:digit:]]*')
echo "Checking out pull request #$PR"
gh pr checkout $PR
BUILD_DIR=$(realpath $MAIN_PATH)
echo "Changed files:"
gh pr diff --name-only
CHANGED=$(gh pr diff --name-only)
$BUILD_DIR/scripts/determine-modules-changed.sh "$CHANGED"
MODULES=$(jq '.[]' modules.json | sed 's/\"//g')
FOLDERS=
ROOT_MODULES=
if [ "$MAVEN_THREADS" = "true" ]; then
MVN_THR="-T 0.5C"
else
MVN_THR=
fi
MAVEN_OPTS="-s $BUILD_DIR/.settings.xml -B -U $MVN_THR"
echo "VERBOSE=$VERBOSE"
if [ "$VERBOSE" = "true" ]; then
MAVEN_OPTS="-X $MAVEN_OPTS"
fi
for module in $MODULES; do
if [ "$FOLDERS" = "" ]; then
FOLDERS="$module"
else
FOLDERS="$FOLDERS,$module"
fi
done
set +e
if [ "$FOLDERS" != "" ]; then
echo "::notice::install $FOLDERS and dependents"
echo "::debug::MAVEN:./mvnw $MAVEN_OPTS -amd -pl $FOLDERS install"
./mvnw $MAVEN_OPTS -amd -pl $FOLDERS install
RC=$?
if ((RC!=0)); then
exit $RC
fi
fi
- name: 'Configure: Install Trivy'
uses: ./.github/actions/install-trivy
./build-core.sh "-T 1C package -Psnapshot"
- name: 'Action: Build Apps'
shell: bash
env:
VERBOSE: ${{ github.debug && 'true' || '' }}
run: |
./build-apps.sh "-T 1C package -Psnapshot"
- name: 'Upload: Error logs'
if: ${{ failure() }}
uses: actions/upload-artifact@v3