Skip to content

CI - Integration Tests #81

CI - Integration Tests

CI - Integration Tests #81

Workflow file for this run

name: 'CI - Integration Tests'
on:
workflow_dispatch:
inputs:
version:
required: false
description: 'Version of containers to use for Integration Tests'
env:
MAIN_PATH: 'build-dir'
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MAVEN_THREADS: 'true'
jobs:
test:
if: github.repository == 'spring-cloud/stream-applications'
runs-on: ubuntu-latest
steps:
- name: 'Configure: checkout stream-applications@main'
id: checkout-main
uses: actions/checkout@v3
with:
ref: ${{ inputs.branch }}
- 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: 'Determine Java Version'
id: determineJavaVersion
run: |
if [ "${{ github.ref_name }}" == "main" ] || [[ "${{ inputs.version && inputs.version || '4.0.0-SNAPSHOT' }}" == *"4.0.0"* ]]; then
JAVA_VERSION=17
else
JAVA_VERSION=8
fi
echo "JAVA_VERSION=$JAVA_VERSION" >> $GITHUB_ENV
- name: 'Configure: Install Java'
uses: actions/setup-java@v4
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: 'liberica'
- name: 'Configure: cache for maven dependencies'
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: maven-repo-${{ hashFiles('**/pom.xml') }}-it-${{ github.base_ref }}
restore-keys: |
maven-repo-${{ hashFiles('**/pom.xml') }}-it-${{ github.base_ref }}
maven-repo-${{ hashFiles('**/pom.xml') }}
maven-repo-
- name: 'Configure: Install xsltproc'
uses: ./.github/actions/install-xsltproc
- name: 'Action: Execute Integration Tests'
shell: bash
env:
VERBOSE: ${{ github.debug && 'true' || '' }}
STREAM_APPS_VERSION: ${{ inputs.version }}
run: |
VERBOSE=${{ inputs.verbose }}
if [ "$VERBOSE" == "" ] || [ "$VERBOSE" == "false" ]; then
VERBOSE=${{ github.debug }}
fi
export VERBOSE
./run-ITs.sh
- name: Unit Test Report
uses: dorny/test-reporter@v1
if: ${{ success() || failure() }}
with:
name: Unit Tests
path: '**/surefire-reports/*.xml'
reporter: java-junit
fail-on-empty: 'false'
- name: Integrtation Test Report
uses: dorny/test-reporter@v1
if: ${{ success() || failure() }}
with:
name: Integration Tests
path: '**/failsafe-reports/*.xml'
reporter: java-junit
fail-on-empty: 'false'
- 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