Bump Microsoft.Extensions.DependencyModel from 8.0.1 to 9.0.1 #416
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 Pull requests | |
on: | |
pull_request: | |
branches: [ master, stable ] | |
paths-ignore: | |
- '**.md' | |
- '.github/**' | |
jobs: | |
service-build: | |
runs-on: ubuntu-latest | |
steps: | |
- 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: Setup .NET Core | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 9.0.x | |
- name: Install dependencies | |
run: dotnet restore eform-debian-service | |
- name: Build | |
run: dotnet build --configuration Release --no-restore eform-debian-service | |
- name: Test | |
run: dotnet test --no-restore --verbosity normal eform-debian-service | |
trash-inspection-service-build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
path: main | |
- name: 'Preparing Frontend checkout' | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
repository: microting/eform-debian-service | |
ref: stable | |
path: eform-debian-service | |
- name: 'Preparing outer inner resource checkout' | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
repository: microting/eform-service-trash-inspection-plugin | |
ref: stable | |
path: eform-service-trash-inspection-plugin | |
- name: Get the version release | |
id: get_release_version | |
run: echo ::set-output name=VERSION::$(cd main && git describe --abbrev=0 --tags | cut -d "v" -f 2) | |
- name: Get the version | |
id: get_version | |
run: echo ::set-output name=VERSION::$(cd eform-service-trash-inspection-plugin && git describe --abbrev=0 --tags | cut -d "v" -f 2) | |
- name: Get the service version | |
id: get_service_version | |
run: echo ::set-output name=FRONTENDVERSION::$(cd eform-debian-service && git describe --abbrev=0 --tags | cut -d "v" -f 2) | |
- name: Copy Docker file | |
run: cp main/Dockerfile-service Dockerfile | |
- name: Build the tagged Docker image | |
run: docker build . -t microtingas/trash-inspection-service-container:latest -t microtingas/trash-inspection-service-container:1.0.0 --build-arg GITVERSION=${{ steps.get_service_version.outputs.FRONTENDVERSION }} --build-arg PLUGINVERSION=${{ steps.get_version.outputs.VERSION }} | |
- name: Tag builds | |
run: |- | |
docker tag microtingas/trash-inspection-service-container:latest microtingas/trash-inspection-service-container:latest | |
- run: docker save microtingas/trash-inspection-service-container:latest -o trash-inspection-service-container.tar | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: trash-inspection-service-container | |
path: trash-inspection-service-container.tar | |
trash-inspection-service-test: | |
needs: [trash-inspection-service-build] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
path: main | |
- 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 -e RABBITMQ_DEFAULT_USER=admin -e RABBITMQ_DEFAULT_PASS=password rabbitmq:latest | |
- uses: actions/[email protected] | |
with: | |
name: trash-inspection-service-container | |
- run: docker load -i trash-inspection-service-container.tar | |
- name: Load DB dump | |
run: | | |
docker exec -i mariadbtest mariadb -h 127.0.0.1 -u root --password=secretpassword -e 'create database `420_SDK`' | |
docker exec -i mariadbtest mariadb -h 127.0.0.1 -u root --password=secretpassword 420_SDK < main/420_SDK.sql | |
- name: Change rabbitmq hostname | |
run: docker exec -i mariadbtest mariadb -u root --password=secretpassword -e 'update 420_SDK.Settings set Value = "my-rabbit" where Name = "rabbitMqHost"' | |
- name: Start the newly build Docker container | |
id: docker-run | |
run: docker run --name my-container --network data microtingas/trash-inspection-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: Stop the newly build Docker container | |
run: docker stop my-container | |
- name: Get standard output | |
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: The job has failed | |
if: ${{ failure() }} | |
run: | | |
cat dotnet_log | |
cat eform-angular-frontend/eform-client/npm_log | |
cat docker_run_log | |
trash-inspection-service-dotnet-test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
path: main | |
- 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:latest | |
- name: Start rabbitmq | |
run: | | |
docker pull rabbitmq:latest | |
docker run -d --hostname my-rabbit --name some-rabbit --network data -e RABBITMQ_DEFAULT_USER=admin -e RABBITMQ_DEFAULT_PASS=password rabbitmq:latest | |
- name: 'Preparing outer inner resource checkout' | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
repository: microting/eform-service-trash-inspection-plugin | |
ref: stable | |
path: eform-service-trash-inspection-plugin | |
- name: Setup .NET Core | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 9.0.x | |
- name: Install dependencies | |
run: dotnet restore eform-service-trash-inspection-plugin | |
- name: Build | |
run: dotnet build eform-service-trash-inspection-plugin --configuration Release --no-restore | |
- name: Unit Tests | |
run: dotnet test --no-restore -c Release -v n eform-service-trash-inspection-plugin/ServiceTrashInspectionPlugin.Integration.Test/ServiceTrashInspectionPlugin.Integration.Test.csproj |