Skip to content

Commit

Permalink
Merge pull request #130 from deeplex/feature/129-use-ci
Browse files Browse the repository at this point in the history
feat: Update workflow. Run it once
  • Loading branch information
klawr authored Mar 3, 2024
2 parents 38c5dfd + cfeaa5c commit 26d096f
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 31 deletions.
60 changes: 39 additions & 21 deletions .github/workflows/.github-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,69 +8,87 @@ on:

jobs:
build-svelte:
runs-on: self-hosted
runs-on: ubuntu-22.04
container:
image: node:18-alpine3.17
steps:
- run: |
- name: Checkout Repository
uses: actions/checkout@v2
- name: Build svelte app
run: |
cd Deeplex.Saverwalter.WebAPI/svelte
yarn install
yarn build
- name: svelte app
- name: Upload svelte artifact
uses: actions/upload-artifact@v3
with:
path: ./Deeplex.Saverwalter.WebAPI/wwwroot
name: svelte-app
path: Deeplex.Saverwalter.WebAPI/wwwroot

test-svelte:
runs-on: self-hosted
runs-on: ubuntu-22.04
container:
image: node:18-alpine3.17
steps:
- run: |
- name: Checkout Repository
uses: actions/checkout@v2
- name: Test svelte app
run: |
cd Deeplex.Saverwalter.WebAPI/svelte
yarn install
yarn run vitest --coverage
build-dotnet:
runs-on: self-hosted
runs-on: ubuntu-22.04
container:
image: mcr.microsoft.com/devcontainers/dotnet:0-6.0
image: mcr.microsoft.com/devcontainers/dotnet:8.0
steps:
- run: |
- name: Checkout Repository
uses: actions/checkout@v2
- name: Build dotnet app
run: |
cd Deeplex.Saverwalter.WebAPI
dotnet restore
dotnet publish -c release
- name: dotnet app
- name: Upload dotnet artifact
uses: actions/upload-artifact@v3
with:
path: ./Deeplex.Saverwalter.WebAPI/bin
name: dotnet-app
path: Deeplex.Saverwalter.WebAPI/bin

test-dotnet:
runs-on: self-hosted
runs-on: ubuntu-22.04
container:
image: mcr.microsoft.com/devcontainers/dotnet:0-6.0
image: mcr.microsoft.com/devcontainers/dotnet:8.0
steps:
- run: |
- name: Checkout Repository
uses: actions/checkout@v2
- name: Test dotnet app
run: |
export LC_ALL=de_DE.UTF-8
dotnet restore
dotnet test /p:CollectCoverage=true /p:ExcludeByFile="**/Migrations/Npgsql/*.cs" | grep '%' | awk '{print $0}{sum += substr($4,1,length($4)-1)} END {if (NR>0) print "Total coverage:" sum / NR "%" }'
build-docker:
runs-on: self-hosted
runs-on: ubuntu-22.04
container:
image: docker:23.0
needs:
- build-svelte
- build-dotnet
steps:
- uses: actions/download-artifact@v3
- name: Checkout Repository
uses: actions/checkout@v2
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: svelte app
path: ./Deeplex.Saverwalter.WebAPI/wwwroot
name: svelte-app
path: Deeplex.Saverwalter.WebAPI/wwwroot
- uses: actions/download-artifact@v3
with:
name: dotnet app
path: ./Deeplex.Saverwalter.WebAPI/bin
- run: |
name: dotnet-app
path: Deeplex.Saverwalter.WebAPI/bin
- name: Build docker image and deploy
run: |
cd Deeplex.Saverwalter.WebAPI
docker build -t "walter:latest" .
10 changes: 1 addition & 9 deletions Deeplex.Saverwalter.PrintService/TPrint.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2023-2024 Kai Lawrence
// Copyright (c) 2023-2024 Kai Lawrence
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
Expand Down Expand Up @@ -947,11 +947,3 @@ public static T Print(IErhaltungsaufwendungWohnung erhaltungsaufwendungen, IPrin
}
}
}
> { col1, col2, col3, col4 }.Select(w => w.ToArray()).ToArray();

printImpl.Table(widths, justification, bold.ToArray(), underlined.ToArray(), cols);

return printImpl.body;
}
}
}
3 changes: 2 additions & 1 deletion Deeplex.Saverwalter.WebAPI/Controllers/UmlageController.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2023-2024 Kai Lawrence
// Copyright (c) 2023-2024 Kai Lawrence
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
Expand All @@ -14,6 +14,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.

using Deeplex.Saverwalter.Model;
using Deeplex.Saverwalter.WebAPI.Services.ControllerService;
using Microsoft.AspNetCore.Mvc;
using static Deeplex.Saverwalter.WebAPI.Controllers.BetriebskostenrechnungController;
using static Deeplex.Saverwalter.WebAPI.Controllers.Services.SelectionListController;
Expand Down

0 comments on commit 26d096f

Please sign in to comment.