Removed build steps for DevInt & SIT. #53
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build & Test in DevVer and SIT | |
env: | |
ACTIONS_STEP_DEBUG: true | |
on: | |
push: | |
branches: [ "master" ] | |
pull_request: | |
branches: [ "master" ] | |
workflow_dispatch: | |
jobs: | |
DevVer: | |
runs-on: [self-hosted, OPENSUSE2] | |
strategy: | |
matrix: | |
browser: [ chrome ] | |
profile: [ Localtests ] | |
environment: [ DevVer ] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Check Java Version | |
id: check-java | |
run: | | |
JAVA_VERSION=19 | |
if type -p java; then | |
echo "Java found in PATH" | |
_java=java | |
elif [[ -n "$JAVA_HOME" ]] && [[ -x "$JAVA_HOME/bin/java" ]]; then | |
echo "Java found in JAVA_HOME" | |
_java="$JAVA_HOME/bin/java" | |
else | |
echo "Java not found" | |
echo "java_installed=false" >> $GITHUB_ENV | |
exit 1 | |
fi | |
if [[ "$_java" ]]; then | |
version=$("$_java" -version 2>&1 | awk -F[\"_] '{print $2}') | |
echo "Java version: $version" | |
if [[ "$version" == "$JAVA_VERSION"* ]]; then | |
echo "Java version $JAVA_VERSION is already installed." | |
echo "java_installed=true" >> $GITHUB_ENV | |
else | |
echo "Installed Java version does not match required version." | |
echo "java_installed=false" >> $GITHUB_ENV | |
exit 1 | |
fi | |
fi | |
- name: Set up cache | |
if: env.java_installed != 'true' | |
uses: actions/[email protected] | |
with: | |
key: ${{ runner.os }}-java-${{ hashFiles('**/build.gradle') }} | |
restore-keys: | | |
${{ runner.os }}-java- | |
- name: Set up JDK 19 | |
if: env.java_installed != 'true' | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '19' | |
distribution: 'zulu' | |
- name: Cache Maven packages | |
uses: actions/[email protected] | |
with: | |
path: ~/.m2/repository | |
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
restore-keys: | | |
${{ runner.os }}-maven- | |
- name: Build & Test DevVer with Maven | |
run: mvn -B package --file pom.xml -Denvironment=${{matrix.environment}} -Dbrowser=${{ matrix.browser }} -P ${{ matrix.profile}} | |
- name: Upload test results | |
uses: actions/upload-artifact@v4 | |
with: | |
name: DevVer test results ${{ matrix.browser }} - ${{ github.run_id }} | |
path: target/surefire-reports/ | |
DevInt: | |
runs-on: [self-hosted, OPENSUSE2] | |
needs: DevVer | |
strategy: | |
matrix: | |
browser: [ chrome, firefox ] | |
profile: [ Localtests ] | |
environment: [ DevInt ] | |
steps: | |
- name: Build & Test DevInt with Maven | |
run: mvn -B package --file pom.xml -Denvironment=${{matrix.environment}} -Dbrowser=${{ matrix.browser }} -P ${{ matrix.profile}} | |
- name: Upload test results | |
uses: actions/upload-artifact@v4 | |
with: | |
name: DevInt test results ${{ matrix.browser }} - ${{ github.run_id }} | |
path: target/surefire-reports/ | |
SIT: | |
runs-on: [self-hosted, OPENSUSE2] | |
needs: DevInt | |
strategy: | |
matrix: | |
profile: [ Browserstack ] | |
environment: [ SIT ] | |
steps: | |
- name: Build & test SIT with Maven | |
run: mvn -B package --file pom.xml -D environment=${{matrix.environment}} -P ${{ matrix.profile}} | |
# - name: Remove remove previous Docker DevInt container instance | |
# run: docker rm -f SIT | |
# - name: Build Docker image | |
# run: docker build . --file Dockerfile_SIT --tag cicd_project_image:SIT | |
# - name: Run docker image | |
# run: docker run --name SIT cicd_project_image:SIT | |
- name: Upload test results | |
uses: actions/upload-artifact@v4 | |
with: | |
name: SIT test results ${{ matrix.browser }} - ${{ github.run_id }} | |
path: target/surefire-reports/ | |
Production: | |
runs-on: [self-hosted, OPENSUSE2] | |
needs: SIT | |
steps: | |
- name: Deploy to production | |
run: echo 'Deployment successful' |