Skip to content

Remove jib from apps-generator plugin #235

Remove jib from apps-generator plugin

Remove jib from apps-generator plugin #235

Workflow file for this run

name: 'CI - PR'
on:
pull_request:
paths-ignore:
- 'spring-cloud-dataflow-apps-plugin/**'
env:
MAIN_PATH: 'build-dir'
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MAVEN_THREADS: 'true'
jobs:
build:
if: github.repository == 'spring-cloud/stream-applications'
runs-on: ubuntu-latest
steps:
- name: 'Configure: checkout stream-applications@${{ github.ref_name }}'
uses: actions/checkout@v3
- name: 'Configure: checkout stream-applications@main'
id: checkout-main
uses: actions/checkout@v3
with:
ref: 'main'
path: ${{ env.MAIN_PATH }}
- name: 'Configure: Install gh cli'
uses: ./.github/actions/install-gh
- name: 'Configure: Ensure scripts are executable'
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
with:
java-version: '8'
- 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 }}
- name: 'Configure: cache for maven dependencies'
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: maven-repo-${{ hashFiles('**/pom.xml') }}-pr-${{ github.base_ref }}
restore-keys: |
maven-repo-${{ hashFiles('**/pom.xml') }}-pr-${{ github.base_ref }}
maven-repo-${{ hashFiles('**/pom.xml') }}
maven-repo-
- name: 'Configure: Install xsltproc'
uses: ./.github/actions/install-xsltproc
- name: 'Action: verify changed modules'
shell: bash
env:
ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
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 "::info ::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
PWD=$(pwd)
# Build any applications that was compiled but don't deploy to artifactory.
PROCESSORS=$(find ./applications/processor -name target -exec $PWD/parent-dir.sh '{}' \;)
SINKS=$(find ./applications/sink -name target -exec $PWD/parent-dir.sh '{}' \;)
SOURCES=$(find ./applications/source -name target -exec $PWD/parent-dir.sh '{}' \;)
# true as 3rd argument ensures that jars aren't deployed and containers aren't built.
for appdir in $PROCESSORS; do
./build-app.sh . "./$appdir" true
done
for appdir in $SOURCES; do
./build-app.sh . "./$appdir" true
done
for appdir in $SINKS; do
./build-app.sh . "./$appdir" true
done
- name: 'Configure: Install Trivy'
uses: ./.github/actions/install-trivy
- name: 'Action: Trivy scan'
shell: bash
run: |
BUILD_DIR=$(realpath $MAIN_PATH)
$BUILD_DIR/scan-folders.sh table
- name: 'Upload: Error logs'
if: ${{ failure() }}
uses: actions/upload-artifact@v3
with:
name: 'modified-surefire-reports'
path: '**/target/surefire-reports'
retention-days: 7
if-no-files-found: ignore
- name: 'Built'
shell: bash
run: echo "::info ::Built"