Skip to content

Commit

Permalink
Merge pull request #54 from johnstoletov/github-actions
Browse files Browse the repository at this point in the history
Deployment with GitHub actions
  • Loading branch information
johnstoletov authored Aug 22, 2022
2 parents 8e2e4a6 + f88db61 commit 1fd9698
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 63 deletions.
59 changes: 0 additions & 59 deletions .drone.yml

This file was deleted.

35 changes: 35 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -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
39 changes: 39 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -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
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
2 changes: 1 addition & 1 deletion src/Horarium.Test/RunnerJobTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<string>(), It.IsAny<TimeSpan>()), Times.AtLeast(2));
Expand Down

0 comments on commit 1fd9698

Please sign in to comment.