Skip to content

Bump Microsoft.NET.Test.Sdk from 18.3.0 to 18.4.0 #431

Bump Microsoft.NET.Test.Sdk from 18.3.0 to 18.4.0

Bump Microsoft.NET.Test.Sdk from 18.3.0 to 18.4.0 #431

Workflow file for this run

name: .NET Pull requests
on:
pull_request:
branches: [ master, stable, angular19 ]
paths-ignore:
- '**.md'
- '.github/**'
jobs:
outer-inner-resource-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
path: eform-angular-outer-inner-resource-plugin
- name: 'Preparing Frontend checkout'
uses: actions/checkout@v3
with:
repository: microting/eform-angular-frontend
ref: stable
path: eform-angular-frontend
- name: Copy dependencies
run: |
cp -av eform-angular-outer-inner-resource-plugin/eform-client/src/app/plugins/modules/outer-inner-resource-pn eform-angular-frontend/eform-client/src/app/plugins/modules/outer-inner-resource-pn
mkdir -p eform-angular-frontend/eFormAPI/eFormAPI.Web/Plugins
cd eform-angular-frontend/eform-client && ../../eform-angular-outer-inner-resource-plugin/testinginstallpn.sh
- name: Get the version release
id: get_release_version
run: echo ::set-output name=VERSION::$(cd eform-angular-outer-inner-resource-plugin && 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-angular-outer-inner-resource-plugin && git describe --abbrev=0 --tags | cut -d "v" -f 2)
- name: Get the work order version
id: get_frontend_version
run: echo ::set-output name=FRONTENDVERSION::$(cd eform-angular-frontend && git describe --abbrev=0 --tags | cut -d "v" -f 2)
- name: Copy Dockerfile
run: cp eform-angular-outer-inner-resource-plugin/Dockerfile .
- name: Build the tagged Docker image
run: docker build . -t microtingas/outer-inner-resource-container:latest -t microtingas/outer-inner-resource-container:1.0.0 --build-arg GITVERSION=1.00 --build-arg PLUGINVERSION=1.0.0
- run: docker save microtingas/outer-inner-resource-container:latest -o outer-inner-resource-container.tar
- uses: actions/upload-artifact@v4
with:
name: outer-inner-resource-container
path: outer-inner-resource-container.tar
outer-inner-resource-playwright-test:
needs: outer-inner-resource-build
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
test: [a,b]
steps:
- uses: actions/checkout@v3
with:
path: eform-angular-outer-inner-resource-plugin
- name: Create docker network
run: docker network create --driver bridge --attachable 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/download-artifact@v4
with:
name: outer-inner-resource-container
- run: docker load -i outer-inner-resource-container.tar
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 22
- name: 'Preparing Frontend checkout'
uses: actions/checkout@v3
with:
repository: microting/eform-angular-frontend
ref: stable
path: eform-angular-frontend
- name: Sleep 15 seconds
run: sleep 15
- name: Copy dependencies
run: |
cp -av eform-angular-outer-inner-resource-plugin/eform-client/src/app/plugins/modules/outer-inner-resource-pn eform-angular-frontend/eform-client/src/app/plugins/modules/outer-inner-resource-pn
mkdir -p eform-angular-frontend/eform-client/playwright/e2e/plugins/
cp -av eform-angular-outer-inner-resource-plugin/eform-client/playwright/e2e/plugins/outer-inner-resource-pn eform-angular-frontend/eform-client/playwright/e2e/plugins/outer-inner-resource-pn
cp -av eform-angular-outer-inner-resource-plugin/eform-client/playwright.config.ts eform-angular-frontend/eform-client/playwright.config.ts
mkdir -p eform-angular-frontend/eFormAPI/eFormAPI.Web/Plugins
cd eform-angular-frontend/eform-client && ../../eform-angular-outer-inner-resource-plugin/testinginstallpn.sh
- name: Start the newly build Docker container
id: docker-run
run: docker run --name my-container -p 4200:5000 --network data microtingas/outer-inner-resource-container:latest "/ConnectionString=host=mariadbtest;Database=420_Angular;user=root;password=secretpassword;port=3306;Convert Zero Datetime = true;SslMode=none;" > docker_run_log 2>&1 &
- name: Sleep 15 seconds
run: sleep 15
- name: Get standard output
run: cat docker_run_log
- name: Pretest changes to work with Docker container
run: sed -i 's/localhost/mariadbtest/g' eform-angular-frontend/eform-client/playwright/e2e/Constants/DatabaseConfigurationConstants.ts
- name: yarn install
run: cd eform-angular-frontend/eform-client && yarn install
- name: Install Playwright browsers
run: cd eform-angular-frontend/eform-client && npx playwright install --with-deps chromium
- name: Wait for app
run: npx wait-on http://localhost:4200 --timeout 120000
- name: DB Configuration
run: cd eform-angular-frontend/eform-client && npx playwright test playwright/e2e/Tests/database-configuration/
- name: Change rabbitmq hostname
run: docker exec -i mariadbtest mysql -u root --password=secretpassword -e 'update 420_SDK.Settings set Value = "my-rabbit" where Name = "rabbitMqHost"'
- name: Get standard output
run: |
cat docker_run_log
result=`cat docker_run_log | grep "Now listening on:.*:5000" -m 1 | wc -l`
if [ $result -ne 1 ];then exit 1; fi
- name: Enable plugin
if: matrix.test != 'a'
run: |
docker exec -i mariadbtest mysql -u root --password=secretpassword -e 'update 420_Angular.EformPlugins set Status = 2'
docker restart my-container
sleep 15
- name: Wait for app
run: npx wait-on http://localhost:4200 --timeout 120000
- name: ${{ matrix.test }} playwright test
run: |
cd eform-angular-frontend/eform-client
npx playwright test playwright/e2e/plugins/outer-inner-resource-pn/${{ matrix.test }}/
- 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 "Now listening on:.*:5000" -m 1 | wc -l`
if [ $result -ne 1 ];then exit 1; fi
- name: Get standard output
if: ${{ failure() }}
run: cat docker_run_log
- name: Archive Playwright report
if: failure()
uses: actions/upload-artifact@v4
with:
name: playwright-report-${{ matrix.test }}
path: eform-angular-frontend/eform-client/playwright-report/
retention-days: 2
outer-inner-resource-dotnet-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
path: eform-angular-outer-inner-resource-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: Sleep 15 seconds
run: sleep 15
- name: Setup .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: 10.0.x
- name: Build
run: dotnet build eform-angular-outer-inner-resource-plugin/eFormAPI/Plugins/OuterInnerResource.Pn/OuterInnerResource.Pn.sln
- name: Unit Tests
run: dotnet test --no-restore -c Release -v n eform-angular-outer-inner-resource-plugin/eFormAPI/Plugins/OuterInnerResource.Pn/OuterInnerResource.Pn.Test/OuterInnerResource.Pn.Test.csproj