Increases CI Speed #866
Workflow file for this run
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
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven | |
name: Java CI with Maven | |
on: | |
pull_request: | |
branches: [ main ] | |
paths-ignore: | |
- '.github/ISSUE_TEMPLATE/**' | |
- '.github/CODE_OF_CONDUCT.md' | |
- '.github/CODING_CONVENTIONS.md' | |
- '.github/CONTRIBUTING.md' | |
- '.github/dependabot.yml' | |
- '.github/pull_request_template.md' | |
- '.github/SECURITY.md' | |
- 'docs/**' | |
- 'examples/**' | |
- 'README.md' | |
- '.gitattributes' | |
- '.gitignore' | |
- 'LICENSE' | |
- 'NOTICE' | |
env: | |
VERSION: 2.0.0-SNAPSHOT | |
jobs: | |
build-test-aas-repository: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'adopt' | |
cache: maven | |
- name: Build AAS Repository Docker Image | |
run: | | |
mvn package -DskipTests -Ddocker.namespace=test --pl "org.eclipse.digitaltwin.basyx:basyx.aasrepository.component" | |
- name: Test AAS Repository Docker Image | |
run: | | |
docker run -d --name test_aas_repository test/aas-repository:${VERSION} | |
sleep 30 | |
if [ "$(docker inspect --format='{{.State.Health.Status}}' test_aas_repository)" == "healthy" ]; then | |
echo "AAS Repository started successfully and is healthy." | |
else | |
echo "AAS Repository failed to start or is unhealthy." | |
docker logs test_aas_repository | |
exit 1 | |
fi | |
docker stop test_aas_repository | |
docker rm test_aas_repository | |
- name: Clean up Docker Image | |
run: docker rmi -f $(docker images -aq) | |
build-test-aas-environment: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'adopt' | |
cache: maven | |
- name: Build AAS Environment Docker Image | |
run: | | |
mvn package -DskipTests -Ddocker.namespace=test --pl "org.eclipse.digitaltwin.basyx:basyx.aasenvironment.component" | |
- name: Test AAS Environment Docker Image | |
run: | | |
docker run -d --name test_aas_environment test/aas-environment:${VERSION} | |
sleep 30 | |
if [ "$(docker inspect --format='{{.State.Health.Status}}' test_aas_environment)" == "healthy" ]; then | |
echo "AAS Environment started successfully and is healthy." | |
else | |
echo "AAS Environment failed to start or is unhealthy." | |
docker logs test_aas_environment | |
exit 1 | |
fi | |
docker stop test_aas_environment | |
docker rm test_aas_environment | |
- name: Clean up Docker Image | |
run: docker rmi -f $(docker images -aq) | |
build-test-concept-description-repository: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'adopt' | |
cache: maven | |
- name: Build Concept Description Repository Docker Image | |
run: | | |
mvn package -DskipTests -Ddocker.namespace=test --pl "org.eclipse.digitaltwin.basyx:basyx.conceptdescriptionrepository.component" | |
- name: Test Concept Description Repository Docker Image | |
run: | | |
docker run -d --name test_conceptdescription_repository test/conceptdescription-repository:${VERSION} | |
sleep 30 | |
if [ "$(docker inspect --format='{{.State.Health.Status}}' test_conceptdescription_repository)" == "healthy" ]; then | |
echo "Concept Description Repository started successfully and is healthy." | |
else | |
echo "Concept Description Repository failed to start or is unhealthy." | |
docker logs test_conceptdescription_repository | |
exit 1 | |
fi | |
docker stop test_conceptdescription_repository | |
docker rm test_conceptdescription_repository | |
- name: Clean up Docker Image | |
run: docker rmi -f $(docker images -aq) | |
build-test-aas-discovery: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'adopt' | |
cache: maven | |
- name: Build AAS Discovery Docker Image | |
run: | | |
mvn package -DskipTests -Ddocker.namespace=test --pl "org.eclipse.digitaltwin.basyx:basyx.aasdiscoveryservice.component" | |
- name: Test AAS Discovery Docker Image | |
run: | | |
docker run -d --name test_aas_discovery test/aas-discovery:${VERSION} | |
sleep 30 | |
if [ "$(docker inspect --format='{{.State.Health.Status}}' test_aas_discovery)" == "healthy" ]; then | |
echo "AAS Discovery started successfully and is healthy." | |
else | |
echo "AAS Discovery failed to start or is unhealthy." | |
docker logs test_aas_discovery | |
exit 1 | |
fi | |
docker stop test_aas_discovery | |
docker rm test_aas_discovery | |
- name: Clean up Docker Image | |
run: docker rmi -f $(docker images -aq) | |
build-test-aasx-fileserver: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'adopt' | |
cache: maven | |
- name: Build AASX File Server Docker Image | |
run: | | |
mvn package -DskipTests -Ddocker.namespace=test --pl "org.eclipse.digitaltwin.basyx:basyx.aasxfileserver.component" | |
- name: Test AASX File Server Docker Image | |
run: | | |
docker images | |
docker run -d --name test_aasxfileserver test/aasxfileserver:${VERSION} | |
sleep 30 | |
if [ "$(docker inspect --format='{{.State.Health.Status}}' test_aasxfileserver)" == "healthy" ]; then | |
echo "AASX File Server started successfully and is healthy." | |
else | |
echo "AASX File Server failed to start or is unhealthy." | |
docker logs test_aasxfileserver | |
exit 1 | |
fi | |
docker stop test_aasxfileserver | |
docker rm test_aasxfileserver | |
- name: Clean up Docker Image | |
run: docker rmi -f $(docker images -aq) | |
build-test-submodel-repository: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'adopt' | |
cache: maven | |
- name: Build Submodel Repository Docker Image | |
run: | | |
mvn package -DskipTests -Ddocker.namespace=test --pl "org.eclipse.digitaltwin.basyx:basyx.submodelrepository.component" | |
- name: Test Submodel Repository Docker Image | |
run: | | |
docker run -p 8081:8081 -d --name test_submodel_repository test/submodel-repository:${VERSION} | |
# Initialize variables | |
max_checks=24 # 2 minutes total (120 seconds / 5 seconds per check) | |
sleep_interval=5 # Interval in seconds between checks | |
check_count=0 | |
# Loop to check health status | |
while [ $check_count -lt $max_checks ]; do | |
if [ "$(docker inspect --format='{{.State.Health.Status}}' test_submodel_repository)" == "healthy" ]; then | |
echo "Submodel Repository started successfully and is healthy." | |
break | |
else | |
echo "Waiting for Submodel Repository to become healthy..." | |
check_count=$((check_count + 1)) | |
sleep $sleep_interval | |
fi | |
done | |
# If the container is still not healthy after the loop | |
if [ $check_count -eq $max_checks ]; then | |
echo "Submodel Repository failed to start or is unhealthy after 2 minutes." | |
docker logs test_submodel_repository | |
exit 1 | |
fi | |
# Stop and remove the container after testing | |
docker stop test_submodel_repository | |
docker rm test_submodel_repository | |
- name: Clean up Docker Image | |
run: docker rmi -f $(docker images -aq) | |
build-test-submodel-service: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'adopt' | |
cache: maven | |
- name: Build Submodel Service Docker Image | |
run: | | |
mvn package -DskipTests -Ddocker.namespace=test --pl "org.eclipse.digitaltwin.basyx:basyx.submodelservice.example" | |
- name: Test Submodel Service Docker Image | |
run: | | |
docker run -d --name test_submodel_service test/submodel-service:${VERSION} | |
sleep 30 | |
if [ "$(docker inspect --format='{{.State.Health.Status}}' test_submodel_service)" == "healthy" ]; then | |
echo "Submodel Service started successfully and is healthy." | |
else | |
echo "Submodel Service failed to start or is unhealthy." | |
docker logs test_submodel_service | |
exit 1 | |
fi | |
docker stop test_submodel_service | |
docker rm test_submodel_service | |
- name: Clean up Docker Image | |
run: docker rmi -f $(docker images -aq) | |
build-test-aas-registry-kafka-mem: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'adopt' | |
cache: maven | |
- name: Build AAS Registry Kafka Mem Docker Image | |
run: | | |
mvn package -DskipTests -Ddocker.namespace=test --pl "org.eclipse.digitaltwin.basyx:basyx.aasregistry-service-release-kafka-mem" | |
- name: Test AAS Registry Kafka Mem Docker Image | |
run: | | |
docker run -d --name test_aas_registry_kafka_mem test/aas-registry-kafka-mem:${VERSION} | |
sleep 30 | |
if [ "$(docker inspect --format='{{.State.Health.Status}}' test_aas_registry_kafka_mem)" == "healthy" ]; then | |
echo "AAS Registry Kafka Mem started successfully and is healthy." | |
else | |
echo "AAS Registry Kafka Mem failed to start or is unhealthy." | |
docker logs test_aas_registry_kafka_mem | |
exit 1 | |
fi | |
docker stop test_aas_registry_kafka_mem | |
docker rm test_aas_registry_kafka_mem | |
- name: Clean up Docker Image | |
run: docker rmi -f $(docker images -aq) | |
build-test-aas-registry-kafka-mongodb: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'adopt' | |
cache: maven | |
- name: Build AAS Registry Kafka MongoDB Docker Image | |
run: | | |
mvn package -DskipTests -Ddocker.namespace=test --pl "org.eclipse.digitaltwin.basyx:basyx.aasregistry-service-release-kafka-mongodb" | |
- name: Test AAS Registry Kafka MongoDB Docker Image | |
run: | | |
docker run -d --name test_aas_registry_kafka_mongodb test/aas-registry-kafka-mongodb:${VERSION} | |
sleep 30 | |
if [ "$(docker inspect --format='{{.State.Health.Status}}' test_aas_registry_kafka_mongodb)" == "healthy" ]; then | |
echo "AAS Registry Kafka MongoDB started successfully and is healthy." | |
else | |
echo "AAS Registry Kafka MongoDB failed to start or is unhealthy." | |
docker logs test_aas_registry_kafka_mongodb | |
exit 1 | |
fi | |
docker stop test_aas_registry_kafka_mongodb | |
docker rm test_aas_registry_kafka_mongodb | |
- name: Clean up Docker Image | |
run: docker rmi -f $(docker images -aq) | |
build-test-aas-registry-log-mem: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'adopt' | |
cache: maven | |
- name: Build AAS Registry Log Mem Docker Image | |
run: | | |
mvn package -DskipTests -Ddocker.namespace=test --pl "org.eclipse.digitaltwin.basyx:basyx.aasregistry-service-release-log-mem" | |
- name: Test AAS Registry Log Mem Docker Image | |
run: | | |
docker run -d --name test_aas_registry_log_mem test/aas-registry-log-mem:${VERSION} | |
sleep 30 | |
if [ "$(docker inspect --format='{{.State.Health.Status}}' test_aas_registry_log_mem)" == "healthy" ]; then | |
echo "AAS Registry Log Mem started successfully and is healthy." | |
else | |
echo "AAS Registry Log Mem failed to start or is unhealthy." | |
docker logs test_aas_registry_log_mem | |
exit 1 | |
fi | |
docker stop test_aas_registry_log_mem | |
docker rm test_aas_registry_log_mem | |
- name: Clean up Docker Image | |
run: docker rmi -f $(docker images -aq) | |
build-test-aas-registry-log-mongodb: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'adopt' | |
cache: maven | |
- name: Build AAS Registry Log MongoDB Docker Image | |
run: | | |
mvn package -DskipTests -Ddocker.namespace=test --pl "org.eclipse.digitaltwin.basyx:basyx.aasregistry-service-release-log-mongodb" | |
- name: Test AAS Registry Log MongoDB Docker Image | |
run: | | |
docker run -d --name test_aas_registry_log_mongodb test/aas-registry-log-mongodb:${VERSION} | |
sleep 30 | |
if [ "$(docker inspect --format='{{.State.Health.Status}}' test_aas_registry_log_mongodb)" == "healthy" ]; then | |
echo "AAS Registry Log MongoDB started successfully and is healthy." | |
else | |
echo "AAS Registry Log MongoDB failed to start or is unhealthy." | |
docker logs test_aas_registry_log_mongodb | |
exit 1 | |
fi | |
docker stop test_aas_registry_log_mongodb | |
docker rm test_aas_registry_log_mongodb | |
- name: Clean up Docker Image | |
run: docker rmi -f $(docker images -aq) | |
build-test-submodel-registry-kafka-mem: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'adopt' | |
cache: maven | |
- name: Build Submodel Registry Kafka Mem Docker Image | |
run: | | |
mvn package -DskipTests -Ddocker.namespace=test --pl "org.eclipse.digitaltwin.basyx:basyx.submodelregistry-service-release-kafka-mem" | |
- name: Test Submodel Registry Kafka Mem Docker Image | |
run: | | |
docker run -d --name test_submodel_registry_kafka_mem test/submodel-registry-kafka-mem:${VERSION} | |
sleep 30 | |
if [ "$(docker inspect --format='{{.State.Health.Status}}' test_submodel_registry_kafka_mem)" == "healthy" ]; then | |
echo "Submodel Registry Kafka Mem started successfully and is healthy." | |
else | |
echo "Submodel Registry Kafka Mem failed to start or is unhealthy." | |
docker logs test_submodel_registry_kafka_mem | |
exit 1 | |
fi | |
docker stop test_submodel_registry_kafka_mem | |
docker rm test_submodel_registry_kafka_mem | |
- name: Clean up Docker Image | |
run: docker rmi -f $(docker images -aq) | |
build-test-submodel-registry-kafka-mongodb: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'adopt' | |
cache: maven | |
- name: Build Submodel Registry Kafka MongoDB Docker Image | |
run: | | |
mvn package -DskipTests -Ddocker.namespace=test --pl "org.eclipse.digitaltwin.basyx:basyx.submodelregistry-service-release-kafka-mongodb" | |
- name: Test Submodel Registry Kafka MongoDB Docker Image | |
run: | | |
docker run -d --name test_submodel_registry_kafka_mongodb test/submodel-registry-kafka-mongodb:${VERSION} | |
sleep 30 | |
if [ "$(docker inspect --format='{{.State.Health.Status}}' test_submodel_registry_kafka_mongodb)" == "healthy" ]; then | |
echo "Submodel Registry Kafka MongoDB started successfully and is healthy." | |
else | |
echo "Submodel Registry Kafka MongoDB failed to start or is unhealthy." | |
docker logs test_submodel_registry_kafka_mongodb | |
exit 1 | |
fi | |
docker stop test_submodel_registry_kafka_mongodb | |
docker rm test_submodel_registry_kafka_mongodb | |
- name: Clean up Docker Image | |
run: docker rmi -f $(docker images -aq) | |
build-test-submodel-registry-log-mem: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'adopt' | |
cache: maven | |
- name: Build Submodel Registry Log Mem Docker Image | |
run: | | |
mvn package -DskipTests -Ddocker.namespace=test --pl "org.eclipse.digitaltwin.basyx:basyx.submodelregistry-service-release-log-mem" | |
- name: Test Submodel Registry Log Mem Docker Image | |
run: | | |
docker run -d --name test_submodel_registry_log_mem test/submodel-registry-log-mem:${VERSION} | |
sleep 30 | |
if [ "$(docker inspect --format='{{.State.Health.Status}}' test_submodel_registry_log_mem)" == "healthy" ]; then | |
echo "Submodel Registry Log Mem started successfully and is healthy." | |
else | |
echo "Submodel Registry Log Mem failed to start or is unhealthy." | |
docker logs test_submodel_registry_log_mem | |
exit 1 | |
fi | |
docker stop test_submodel_registry_log_mem | |
docker rm test_submodel_registry_log_mem | |
- name: Clean up Docker Image | |
run: docker rmi -f $(docker images -aq) | |
build-test-submodel-registry-log-mongodb: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'adopt' | |
cache: maven | |
- name: Build Submodel Registry Log MongoDB Docker Image | |
run: | | |
mvn package -DskipTests -Ddocker.namespace=test --pl "org.eclipse.digitaltwin.basyx:basyx.submodelregistry-service-release-log-mongodb" | |
- name: Test Submodel Registry Log MongoDB Docker Image | |
run: | | |
docker run -d --name test_submodel_registry_log_mongodb test/submodel-registry-log-mongodb:${VERSION} | |
sleep 30 | |
if [ "$(docker inspect --format='{{.State.Health.Status}}' test_submodel_registry_log_mongodb)" == "healthy" ]; then | |
echo "Submodel Registry Log MongoDB started successfully and is healthy." | |
else | |
echo "Submodel Registry Log MongoDB failed to start or is unhealthy." | |
docker logs test_submodel_registry_log_mongodb | |
exit 1 | |
fi | |
docker stop test_submodel_registry_log_mongodb | |
docker rm test_submodel_registry_log_mongodb | |
- name: Clean up Docker Image | |
run: docker rmi -f $(docker images -aq) |