Merge branch 'master' into stable #1165
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: .NET Master | |
on: | |
push: | |
branches: [ master, stable ] | |
paths-ignore: | |
- '**.md' | |
- '.github/**' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
path: eform-service-backendconfiguration-plugin | |
- name: Create docker network | |
run: docker network create --driver bridge data | |
- name: Start MariaDB | |
run: | | |
docker pull mariadb:10.8 | |
docker run --name mariadbtest --network data -e MYSQL_ROOT_PASSWORD=secretpassword -p 3306:3306 -d mariadb:10.8 | |
- name: Start rabbitmq | |
run: | | |
docker pull rabbitmq:latest | |
docker run -d --hostname my-rabbit --name some-rabbit --network data -p 5672:5672 -e RABBITMQ_DEFAULT_USER=admin -e RABBITMQ_DEFAULT_PASS=password rabbitmq:latest | |
- name: 'Preparing Debian Service checkout' | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
repository: microting/eform-debian-service | |
ref: stable | |
path: eform-debian-service | |
- name: 'Preparing items planning checkout' | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
repository: microting/eform-service-items-planning-plugin | |
ref: stable | |
path: eform-service-items-planning-plugin | |
- name: 'Preparing workflow checkout' | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
repository: microting/eform-service-workflow-plugin | |
ref: stable | |
path: eform-service-workflow-plugin | |
- name: 'Preparing TimePlanning checkout' | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
repository: microting/eform-service-timeplanning-plugin | |
ref: stable | |
path: eform-service-timeplanning-plugin | |
- name: Load DB dump | |
run: | | |
docker exec -i mariadbtest mysql -u root --password=secretpassword -e 'create database `420_SDK`' | |
docker exec -i mariadbtest mysql -u root --password=secretpassword 420_SDK < eform-service-backendconfiguration-plugin/420_SDK.sql | |
docker exec -i mariadbtest mysql -u root --password=secretpassword -e 'create database `420_Angular`' | |
docker exec -i mariadbtest mysql -u root --password=secretpassword 420_Angular < eform-service-backendconfiguration-plugin/420_Angular.sql | |
docker exec -i mariadbtest mysql -u root --password=secretpassword -e 'create database `420_eform-backend-configuration-plugin`' | |
docker exec -i mariadbtest mysql -u root --password=secretpassword 420_eform-backend-configuration-plugin < eform-service-backendconfiguration-plugin/420_eform-backend-configuration-plugin.sql | |
docker exec -i mariadbtest mysql -u root --password=secretpassword -e 'create database `420_eform-angular-time-planning-plugin`' | |
docker exec -i mariadbtest mysql -u root --password=secretpassword 420_eform-angular-time-planning-plugin < eform-service-backendconfiguration-plugin/420_eform-angular-time-planning-plugin.sql | |
docker exec -i mariadbtest mysql -u root --password=secretpassword -e 'create database `420_eform-angular-items-planning-plugin`' | |
docker exec -i mariadbtest mysql -u root --password=secretpassword 420_eform-angular-items-planning-plugin < eform-service-backendconfiguration-plugin/420_eform-angular-items-planning-plugin.sql | |
docker exec -i mariadbtest mysql -u root --password=secretpassword -e 'create database `420_eform-angular-case-template-plugin`' | |
docker exec -i mariadbtest mysql -u root --password=secretpassword 420_eform-angular-case-template-plugin < eform-service-backendconfiguration-plugin/420_eform-angular-case-template-plugin.sql | |
docker exec -i mariadbtest mysql -u root --password=secretpassword -e 'create database `420_chemical-base-plugin`' | |
docker exec -i mariadbtest mysql -u root --password=secretpassword 420_chemical-base-plugin < eform-service-backendconfiguration-plugin/420_chemical-base-plugin.sql | |
- name: Setup .NET Core | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: 9.0.x | |
- name: Install dependencies | |
run: dotnet restore eform-service-backendconfiguration-plugin | |
- name: Build | |
run: dotnet build --configuration Release --no-restore eform-service-backendconfiguration-plugin | |
- name: Unit Tests | |
run: dotnet test --no-restore -c Release -v n eform-service-backendconfiguration-plugin/ServiceBackendConfigurationPlugin.Integration.Test/ServiceBackendConfigurationPlugin.Integration.Test.csproj | |
- name: Copy Docker file | |
run: cp eform-service-backendconfiguration-plugin/Dockerfile-service Dockerfile | |
- name: Login to DockerHub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build the tagged Docker image | |
run: docker build . -t microtingas/service-container:latest --build-arg GITVERSION=1.0.0 --build-arg PLUGINVERSION=1.0.0 --build-arg PLUGIN3VERSION=1.0.0 --build-arg PLUGIN4VERSION=1.0.0 --build-arg PLUGIN5VERSION=1.0.0 | |
- name: Start the newly build Docker container | |
id: docker-run | |
run: docker run --name my-container --network data microtingas/service-container:latest "/ConnectionString=host=mariadbtest;Database=420_SDK;user=root;password=secretpassword;port=3306;Convert Zero Datetime = true;SslMode=none;" > docker_run_log 2>&1 & | |
- name: Sleep 75 seconds for letting the container start and generate some output we can | |
run: sleep 75 | |
- name: Get standard output | |
run: cat docker_run_log | |
- name: Check for correct startup of service | |
run: | | |
cat docker_run_log | |
result=`cat docker_run_log | grep "No messages for us right now!" -m 1 | wc -l` | |
if [ $result -ne 1 ];then exit 1; fi | |
- name: Compile eformparsed test program | |
run: | | |
dotnet build --configuration Release eform-service-backendconfiguration-plugin/ci/eformparsed/ | |
- name: run eformparsed test program | |
run: | | |
dotnet eform-service-backendconfiguration-plugin/ci/eformparsed/bin/Release/net8.0/eformparsed.dll | |
- name: Stop the newly build Docker container | |
run: docker stop my-container | |
- name: Get standard output | |
run: cat docker_run_log | |
- name: The job has failed | |
if: ${{ failure() }} | |
run: | | |
cat docker_run_log |