diff --git a/.drone.yml b/.drone.yml deleted file mode 100644 index c408044..0000000 --- a/.drone.yml +++ /dev/null @@ -1,59 +0,0 @@ -kind: pipeline -name: default - -steps: -- name: check-mongo - image: mongo:4 - commands: - - sleep 5 - - mongo --host mongo --eval "db.version()" - -- name: build - image: mcr.microsoft.com/dotnet/core/sdk:2.2 - environment: - MONGO_ADDRESS: mongo - commands: - - cd src - - dotnet build Horarium.sln -c Release - - dotnet test Horarium.Test/Horarium.Test.csproj --no-restore /p:CollectCoverage=true /p:CoverletOutputFormat=opencover - - DataBase=MongoDB dotnet test Horarium.IntegrationTest/Horarium.IntegrationTest.csproj --no-restore - - DataBase=Memory dotnet test Horarium.IntegrationTest/Horarium.IntegrationTest.csproj --no-restore - -- name: coverage - image: plugins/codecov - settings: - token: - from_secret: CODECOV_TOKEN - files: - - src/Horarium.Test/coverage.opencover.xml - -- name: push - image: mcr.microsoft.com/dotnet/core/sdk:2.2 - environment: - NUGET_APIKEY: - from_secret: NUGET_APIKEY - commands: - - cd src - - dotnet pack Horarium/Horarium.csproj -c Release /p:PackageVersion=$DRONE_TAG - - dotnet pack Horarium.Mongo/Horarium.Mongo.csproj -c Release /p:PackageVersion=$DRONE_TAG - - dotnet pack Horarium.AspNetCore/Horarium.AspNetCore.csproj -c Release /p:PackageVersion=$DRONE_TAG - - dotnet nuget push **/Horarium.*.nupkg -k $NUGET_APIKEY -s https://www.nuget.org - when: - event: - - tag - - -services: -- name: mongo - image: mongo:4.0 - command: [ --smallfiles ] - ports: - - 27017 - -trigger: - event: - - pull_request - - push - - tag - - diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..6ce6410 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,35 @@ +name: Build +on: + - workflow_call + - pull_request +jobs: + build: + runs-on: ubuntu-latest + services: + mongodb: + image: mongo:5.0.10 + ports: + - 27017:27017 + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-dotnet@v2 + with: + dotnet-version: '2.2.x' # SDK Version to use. + env: + MONGO_ADDRESS: localhost + - name: build + run: | + dotnet build src/Horarium.sln -c Release + - name: check mongo + run: | + sleep 5 + mongo --host localhost --eval "db.version()" + - name: run unit tests + run: | + dotnet test src/Horarium.Test/Horarium.Test.csproj -c Release --no-restore + - name: run MongoDB integration tests + run: | + DataBase=MongoDB dotnet test src/Horarium.IntegrationTest/Horarium.IntegrationTest.csproj -c Release --no-restore + - name: run InMemory integration tests + run: | + DataBase=Memory dotnet test src/Horarium.IntegrationTest/Horarium.IntegrationTest.csproj -c Release --no-restore \ No newline at end of file diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..55794df --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,39 @@ +name: Deploy + +on: + release: + types: [released] + +jobs: + build: + uses: ./.github/workflows/build.yml + + deploy: + needs: [ build ] + runs-on: ubuntu-latest + env: + VERSION: ${{ github.event.release.tag_name }} + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-dotnet@v2 + with: + dotnet-version: '2.2.x' # SDK Version to use. + - name: prepare version + run: | + echo "$VERSION" + - name: pack Horarium + run: | + cd src + dotnet pack Horarium/Horarium.csproj -c Release /p:PackageVersion=${{env.VERSION}} + - name: pack Horarium.Mongo + run: | + cd src + dotnet pack Horarium.Mongo/Horarium.Mongo.csproj -c Release /p:PackageVersion=${{env.VERSION}} + - name: pack Horarium.AspNetCore + run: | + cd src + dotnet pack Horarium.AspNetCore/Horarium.AspNetCore.csproj -c Release /p:PackageVersion=${{env.VERSION}} + - name: publish + run: | + cd src + dotnet nuget push **/Horarium.*.nupkg -k ${{secrets.NUGET_APIKEY}} -s https://www.nuget.org \ No newline at end of file diff --git a/README.md b/README.md index f6b8b37..a9ecd90 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,7 @@ # Horarium -[![Build Status](https://cloud.drone.io/api/badges/TinkoffCreditSystems/Horarium/status.svg)](https://cloud.drone.io/TinkoffCreditSystems/Horarium) +[![Build Status](https://github.com/TinkoffCreditSystems/Horarium/actions/workflows/build.yml/badge.svg)](https://github.com/TinkoffCreditSystems/Horarium/actions/) [![Nuget](https://img.shields.io/nuget/v/Horarium.svg)](https://www.nuget.org/packages/Horarium) -[![codecov](https://codecov.io/gh/TinkoffCreditSystems/Horarium/branch/master/graph/badge.svg)](https://codecov.io/gh/TinkoffCreditSystems/Horarium) -[![codefactor](https://www.codefactor.io/repository/github/tinkoffcreditsystems/horarium/badge)](https://www.codefactor.io/repository/github/tinkoffcreditsystems/horarium) Horarium is an open source job scheduling .NET library with an easy to use API, that can be integrated within applications of any scale - from the smallest stand-alone application to the largest e-commerce system. diff --git a/src/Horarium.Test/RunnerJobTest.cs b/src/Horarium.Test/RunnerJobTest.cs index af12ddd..345d78c 100644 --- a/src/Horarium.Test/RunnerJobTest.cs +++ b/src/Horarium.Test/RunnerJobTest.cs @@ -66,7 +66,7 @@ public async Task Start_RecoverAfterIntervalTimeout_AfterFailedDB() // Act runnerJobs.Start(); - await Task.Delay(settings.IntervalStartJob + TimeSpan.FromMilliseconds(500)); + await Task.Delay(settings.IntervalStartJob + TimeSpan.FromMilliseconds(1000)); // Assert jobRepositoryMock.Verify(r => r.GetReadyJob(It.IsAny(), It.IsAny()), Times.AtLeast(2));