Skip to content

Backwards Compatibility (JDK 17) #258

Backwards Compatibility (JDK 17)

Backwards Compatibility (JDK 17) #258

name: Backwards Compatibility (JDK 17)
on:
push:
branches: [develop]
paths:
- "core-customize/hybris/bin/custom/sapcxtools/**/*.java"
- "core-customize/hybris/bin/custom/sapcxtools/**/*-beans.xml"
- "core-customize/hybris/bin/custom/sapcxtools/**/*-items.xml"
- "core-customize/hybris/bin/custom/sapcxtools/**/extensioninfo.xml"
- "core-customize/hybris/bin/custom/sapcxtools/**/external-dependencies.xml"
pull_request:
branches: [main, develop]
schedule:
- cron: "0 15 * * 0,3"
workflow_dispatch:
jobs:
compatibility:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
version: ["2205.25"]
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: "adopt"
java-version: "17"
cache: "gradle"
- name: Validate Gradle wrapper
uses: gradle/actions/wrapper-validation@v3
- name: Set up cache for SAP artifacts
uses: actions/cache@v4
with:
key: sap-artifacts-cache-${{ hashFiles('core-customize/manifest.json') }}-${{ matrix.version }}
path: dependencies
- name: Configure SAP version
run: |
sed -i 's/\"commerceSuiteVersion\": \"[^\"]*\"/\"commerceSuiteVersion\": \"${{ matrix.version }}\"/' core-customize/manifest.json
- name: SAP download config
env:
SAPCX_ARTEFACT_BASEURL: ${{ secrets.SAPCX_ARTEFACT_BASEURL }}
SAPCX_ARTEFACT_USER: ${{ secrets.SAPCX_ARTEFACT_USER }}
SAPCX_ARTEFACT_PASSWORD: ${{ secrets.SAPCX_ARTEFACT_PASSWORD }}
shell: bash
run: |
mkdir -p ${HOME}/.gradle
echo "GRADLE_USER_HOME=${HOME}/.gradle" >> $GITHUB_ENV
echo "SAPCX_ARTEFACT_BASEURL=${SAPCX_ARTEFACT_BASEURL}" >> ${HOME}/.gradle/gradle.properties
echo "SAPCX_ARTEFACT_USER=${SAPCX_ARTEFACT_USER}" >> ${HOME}/.gradle/gradle.properties
echo "SAPCX_ARTEFACT_PASSWORD=${SAPCX_ARTEFACT_PASSWORD}" >> ${HOME}/.gradle/gradle.properties
- name: SAP Commerce environment
run: |
echo "HYBRIS_OPT_CONFIG_DIR=$GITHUB_WORKSPACE/core-customize/hybris/config/local-config" >> $GITHUB_ENV
echo "HYBRIS_BIN_DIR=$GITHUB_WORKSPACE/core-customize/hybris/bin" >> $GITHUB_ENV
echo "HYBRIS_CONF_DIR=$GITHUB_WORKSPACE/core-customize/hybris/config" >> $GITHUB_ENV
echo "HYBRIS_LOG_DIR=$GITHUB_WORKSPACE/core-customize/hybris/log" >> $GITHUB_ENV
- name: Bootstrap platform
run: ./gradlew setupLocalDevelopment
- name: Build platform
run: ./gradlew yall
- name: Run unit tests
run: |
cat $GITHUB_WORKSPACE/ci/config/testing-unit.properties > $HYBRIS_CONF_DIR/local-config/99-local.properties
./gradlew yunittests
# Target never fails, therefore, check for test errors and fail if errors were found
for file in $HYBRIS_LOG_DIR/junit/test-results/unit/*.xml; do if [ "$(grep -cE '<(error|failure)' "${file}")" -gt 0 ]; then exit 1; fi; done
- name: Run integration tests
run: |
cat $GITHUB_WORKSPACE/ci/config/testing-integration.properties > $HYBRIS_CONF_DIR/local-config/99-local.properties
./gradlew yintegrationtests
# Target never fails, therefore, check for test errors and fail if errors were found
for file in $HYBRIS_LOG_DIR/junit/test-results/integration/*.xml; do if [ "$(grep -cE '<(error|failure)' "${file}")" -gt 0 ]; then exit 1; fi; done