Merge pull request #18 from Ali-YousefiTelori/develop #13
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | | |
6.0.x | |
7.0.x | |
8.0.x | |
- name: Clone and run Authentication | |
run: | | |
git clone https://github.com/EasyMicroservices/Authentications-Microservice.git | |
cd Authentications-Microservice | |
dotnet run --project src/CSharp/EasyMicroservices.AuthenticationsMicroservice.WebApi/EasyMicroservices.AuthenticationsMicroservice.WebApi.csproj & | |
AUTH_PID=$! | |
echo "Started Authentication Service with PID $AUTH_PID" | |
cd .. | |
shell: bash | |
- name: Clone and run WhiteLabel | |
run: | | |
git clone https://github.com/EasyMicroservices/WhiteLabels-Microservice.git | |
cd WhiteLabels-Microservice | |
dotnet run --project src/CSharp/EasyMicroservices.WhiteLabelsMicroservice.WebApi/EasyMicroservices.WhiteLabelsMicroservice.WebApi.csproj & | |
WHITELABEL_PID=$! | |
echo "Started WhiteLabel Service with PID $WHITELABEL_PID" | |
cd .. | |
shell: bash | |
- 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 }} | |
- name: Cleanup | |
if: always() | |
run: echo "Shutting down Authentication Service with PID $AUTH_PID" | |
kill $AUTH_PID echo "Authentication Service shutdown failed" | |
echo "Shutting down WhiteLabel Service with PID $WHITELABEL_PID" | |
kill $WHITELABEL_PID echo "WhiteLabel Service shutdown failed" |