Skip to content

Commit

Permalink
Merge pull request #7 from Ali-YousefiTelori/develop
Browse files Browse the repository at this point in the history
add github actions
  • Loading branch information
Ali-YousefiTelori authored Dec 2, 2023
2 parents 7e98b8f + 23dfca6 commit c69d800
Show file tree
Hide file tree
Showing 14 changed files with 269 additions and 3 deletions.
13 changes: 13 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
## Title

<!-- A sentence about the issue. -->

## Description

<!-- Description of the issue. -->

### Checklist:

- [ ] It's a bug report.
- [ ] It's a feature request.
- [ ] Related language label is selected.
19 changes: 19 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
## Description

<!-- A few sentences describing the pull request. -->

### Related issue(s)

<!-- If this PR relates to any issues, mention them here. -->

### Checklist:

- [ ] It refers to an [Issue](https://github.com/EasyMicroservices/FileManager/issues).
- [ ] It fixes a bug.
- [ ] It's a new feature (non-breaking change which adds functionality)
- [ ] It's a breaking (fix or feature that would cause existing functionality to change)
- [ ] My code follows the code style of this project.
- [ ] I have added tests to cover my changes.
- [ ] All new and existing tests passed.
- [ ] CHANGELOG is updated.
- [ ] Related language label is selected.
36 changes: 36 additions & 0 deletions .github/workflows/dotnet-format-action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: dotnet format
on:
push:
branches: [develop]

jobs:
format:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
7.0.x
- name: Run dotnet format
id: format
uses: jfversluis/[email protected]
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
action: "fix"
workspace: "./src/CSharp/EasyMicroservices.IdentityMicroservice.sln"
- name: Test
run: |
dotnet test ./src/CSharp/EasyMicroservices.IdentityMicroservice.sln -f net7.0
- name: Commit files
if: steps.format.outputs.has-changes == 'true'
uses: EndBug/[email protected]
with:
author_name: Github Actions
author_email: [email protected]
message: "chore: Automated dotnet-format update"
ref: ${{ github.head_ref }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25 changes: 25 additions & 0 deletions .github/workflows/dotnet-linux-client.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Linux Client (dotnet build and test)

on:
push:
branches: [develop]
pull_request:
branches: [develop]

jobs:
os-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
7.0.x
- name: Restore dependencies
run: dotnet restore ./src/CSharp/EasyMicroservices.IdentityMicroservice.Client.sln
- name: Build
run: dotnet build ./src/CSharp/EasyMicroservices.IdentityMicroservice.Client.sln --no-restore
- name: Test
run: |
dotnet test ./src/CSharp/EasyMicroservices.IdentityMicroservice.Client.sln --no-build --verbosity normal -f net7.0
25 changes: 25 additions & 0 deletions .github/workflows/dotnet-linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Linux (dotnet build and test)

on:
push:
branches: [develop]
pull_request:
branches: [develop]

jobs:
os-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
7.0.x
- name: Restore dependencies
run: dotnet restore ./src/CSharp/EasyMicroservices.IdentityMicroservice.sln
- name: Build
run: dotnet build ./src/CSharp/EasyMicroservices.IdentityMicroservice.sln --no-restore
- name: Test
run: |
dotnet test ./src/CSharp/EasyMicroservices.IdentityMicroservice.sln --no-build --verbosity normal -f net7.0
25 changes: 25 additions & 0 deletions .github/workflows/dotnet-macos-client.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: MacOS Client (dotnet build and test)

on:
push:
branches: [develop]
pull_request:
branches: [develop]

jobs:
os-tests:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
7.0.x
- name: Restore dependencies
run: dotnet restore ./src/CSharp/EasyMicroservices.IdentityMicroservice.Client.sln
- name: Build
run: dotnet build ./src/CSharp/EasyMicroservices.IdentityMicroservice.Client.sln --no-restore
- name: Test
run: |
dotnet test ./src/CSharp/EasyMicroservices.IdentityMicroservice.Client.sln --no-build --verbosity normal -f net7.0
25 changes: 25 additions & 0 deletions .github/workflows/dotnet-macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: MacOS (dotnet build and test)

on:
push:
branches: [develop]
pull_request:
branches: [develop]

jobs:
os-tests:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
7.0.x
- name: Restore dependencies
run: dotnet restore ./src/CSharp/EasyMicroservices.IdentityMicroservice.sln
- name: Build
run: dotnet build ./src/CSharp/EasyMicroservices.IdentityMicroservice.sln --no-restore
- name: Test
run: |
dotnet test ./src/CSharp/EasyMicroservices.IdentityMicroservice.sln --no-build --verbosity normal -f net7.0
24 changes: 24 additions & 0 deletions .github/workflows/dotnet-windows-client.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Windows Client (dotnet build and test)

on:
push:
branches: [develop]
pull_request:
branches: [develop]

jobs:
os-tests:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
7.0.x
- name: Restore dependencies
run: dotnet restore ./src/CSharp/EasyMicroservices.IdentityMicroservice.Client.sln
- name: Build
run: dotnet build ./src/CSharp/EasyMicroservices.IdentityMicroservice.Client.sln --no-restore
- name: Test
run: dotnet test ./src/CSharp/EasyMicroservices.IdentityMicroservice.Client.sln --no-build --verbosity normal
24 changes: 24 additions & 0 deletions .github/workflows/dotnet-windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Windows (dotnet build and test)

on:
push:
branches: [develop]
pull_request:
branches: [develop]

jobs:
os-tests:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
7.0.x
- name: Restore dependencies
run: dotnet restore ./src/CSharp/EasyMicroservices.IdentityMicroservice.sln
- name: Build
run: dotnet build ./src/CSharp/EasyMicroservices.IdentityMicroservice.sln --no-restore
- name: Test
run: dotnet test ./src/CSharp/EasyMicroservices.IdentityMicroservice.sln --no-build --verbosity normal
25 changes: 25 additions & 0 deletions .github/workflows/nuget-push-public-client.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: NuGet Push Public Client

on: [workflow_dispatch]

jobs:
build-test-prep-push:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-dotnet@v3
with:
dotnet-version: |
7.0.x
env:
DOTNET_INSTALL_DIR: /usr/share/dotnet
- name: Restore dependencies
run: dotnet restore ./src/CSharp/EasyMicroservices.IdentityMicroservice.Client.sln
- name: Build
run: dotnet build ./src/CSharp/EasyMicroservices.IdentityMicroservice.Client.sln --no-restore
- name: Test
run: dotnet test ./src/CSharp/EasyMicroservices.IdentityMicroservice.Client.sln --no-build --verbosity normal
- name: Create the package
run: dotnet pack ./src/CSharp/EasyMicroservices.IdentityMicroservice.Client.sln --output nupkgs
- name: Publish the package to NuGet.org
run: dotnet nuget push nupkgs\*.nupkg -k ${{secrets.NUGET_KEY}} -s https://api.nuget.org/v3/index.json --skip-duplicate
25 changes: 25 additions & 0 deletions .github/workflows/nuget-push-public.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: NuGet Push Public

on: [workflow_dispatch]

jobs:
build-test-prep-push:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-dotnet@v3
with:
dotnet-version: |
7.0.x
env:
DOTNET_INSTALL_DIR: /usr/share/dotnet
- name: Restore dependencies
run: dotnet restore ./src/CSharp/EasyMicroservices.IdentityMicroservice.sln
- name: Build
run: dotnet build ./src/CSharp/EasyMicroservices.IdentityMicroservice.sln --no-restore
- name: Test
run: dotnet test ./src/CSharp/EasyMicroservices.IdentityMicroservice.sln --no-build --verbosity normal
- name: Create the package
run: dotnet pack ./src/CSharp/EasyMicroservices.IdentityMicroservice.sln --output nupkgs
- name: Publish the package to NuGet.org
run: dotnet nuget push nupkgs\*.nupkg -k ${{secrets.NUGET_KEY}} -s https://api.nuget.org/v3/index.json --skip-duplicate
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace EasyMicroservices.IdentityMicroservice.Contracts.Responses
{
public class UserResponseContract
public class UserResponseContract
{
public string Token { get; set; }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace EasyMicroservices.IdentityMicroservice.Interfaces
{
public interface IJWTManager
{
Task<ListMessageContract<ClaimContract>> GetClaimsFromToken(string token);
Task<ListMessageContract<ClaimContract>> GetClaimsFromToken(string token);
Task<MessageContract<UserResponseContract>> EditTokenClaims(EditTokenClaimRequestContract request);
Task<MessageContract<UserResponseContract>> GenerateTokenWithClaims(List<ClaimContract> claims);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public class MicroserviceClientTest
{
const int Port = 1201;
string _routeAddress = "";
public static HttpClient HttpClient { get; set; } = new HttpClient();
public static HttpClient HttpClient { get; set; } = new HttpClient();
public MicroserviceClientTest()
{
_routeAddress = $"http://localhost:{Port}";
Expand Down

0 comments on commit c69d800

Please sign in to comment.