From 246ea67210009ba90b55e7dc3a545c4b0c1819ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9E=D0=BB=D1=8F=20=D0=91=D0=B8=D0=B7=D1=8E=D0=BA=D0=BE?= =?UTF-8?q?=D0=B2=D0=B0?= Date: Tue, 4 Feb 2025 10:48:13 +0500 Subject: [PATCH] =?UTF-8?q?=D0=9A=D0=BE=D0=BD=D1=82=D0=B5=D0=B9=D0=BD?= =?UTF-8?q?=D0=B5=D1=80=20=D0=B4=D0=BB=D1=8F=20=D0=BF=D1=83=D0=B1=D0=BB?= =?UTF-8?q?=D0=B8=D0=BA=D0=B0=D1=86=D0=B8=D0=B8=20Persistence=20=D0=B8=20?= =?UTF-8?q?=D1=81=D0=BE=D0=B7=D0=B4=D0=B0=D0=BD=D0=B8=D1=8F=20docker-image?= =?UTF-8?q?=20=D1=81=20=D0=BF=D1=80=D0=B8=D0=BB=D0=BE=D0=B6=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D0=B5=D0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/integrationTests.yaml | 8 +++++ .gitea/workflows/pubcontainer.yaml | 43 ++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 .gitea/workflows/pubcontainer.yaml diff --git a/.gitea/workflows/integrationTests.yaml b/.gitea/workflows/integrationTests.yaml index ca1bb73..8ee8d4c 100644 --- a/.gitea/workflows/integrationTests.yaml +++ b/.gitea/workflows/integrationTests.yaml @@ -35,19 +35,27 @@ jobs: uses: actions/setup-dotnet@v4 with: dotnet-version: 9.0.x + - name: Add gitea as nuget source run: dotnet nuget add source --name gitea --username publisher --password ${{ secrets.PUBLISHER_PASSWORD }} --store-password-in-clear-text https://git.ddrilling.ru/api/packages/DDrilling/nuget/index.json + - name: Check out repository code uses: actions/checkout@v4 + - name: Run integration tests run: dotnet test DD.Persistence.IntegrationTests + - name: Run unit tests run: dotnet test DD.Persistence.Test --no-build + - name: Pack Persistence Client run: dotnet pack DD.Persistence.Client/DD.Persistence.Client.csproj -c Debug -o ./artifacts + - name: Pack Persistence Models run: dotnet pack DD.Persistence.Models/DD.Persistence.Models.csproj -c Debug -o ./artifacts + - name: Publish Persistence Client Package run: dotnet nuget push ./artifacts/DD.Persistence.Client.*.nupkg --source gitea --skip-duplicate + - name: Publish Persistence Models Package run: dotnet nuget push ./artifacts/DD.Persistence.Models.*.nupkg --source gitea --skip-duplicate diff --git a/.gitea/workflows/pubcontainer.yaml b/.gitea/workflows/pubcontainer.yaml new file mode 100644 index 0000000..330e152 --- /dev/null +++ b/.gitea/workflows/pubcontainer.yaml @@ -0,0 +1,43 @@ +name: .NET Persistence +on: + push: + branches: + - main + +jobs: + pubcontainer: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup .NET + if: ${{ steps.cache-dotnet.outputs.cache-hit != 'true' }} + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 9.0.x + + - name: Add gitea as nuget source + run: dotnet nuget add source --name gitea --username publisher --password ${{ secrets.PUBLISHER_PASSWORD }} --store-password-in-clear-text https://git.ddrilling.ru/api/packages/DDrilling/nuget/index.json + + - name: Restore dependencies + run: dotnet restore + + - name: Build solution + run: dotnet build --no-restore + + - name: Run integration tests + run: dotnet test DD.Persistence.IntegrationTests + + - name: Run unit tests + run: dotnet test DD.Persistence.Test --no-build + + - name: Login to Gitea Docker Registry + run: docker login -u publisher -p ${{ secrets.PUBLISHER_PASSWORD }} https://git.ddrilling.ru + + - name: Docker Build + run: docker build -t git.ddrilling.ru/on.nemtina/persistence:latest --network=host --build-arg PUBLISHERPASSWORD="${{ secrets.PUBLISHER_PASSWORD }}" -f DD.Persistence.App/Dockerfile . + # run: docker build -t git.ddrilling.ru/ddrilling/iocollector:latest --network=host --build-arg PUBLISHERPASSWORD="${{ secrets.PUBLISHER_PASSWORD }}" -f DD.IoCollector.App/Dockerfile . + + - name: Push Docker image to Gitea + run: docker push git.ddrilling.ru/ddrilling/persistence:latest \ No newline at end of file