-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (71 loc) · 2.42 KB
/
CI-Workflow.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: CI Workflow
on:
push:
branches: [ "main" ]
paths:
- NotamManagement.Api/**
- NotamManagement.Core/**
- NotamManagement.UI/**
- NotamManagement.Tests/**
pull_request:
branches: [ "main" ]
jobs:
unit_tests:
name: Run Unit Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Test
run: dotnet test --no-build --verbosity normal
codecoverage_report:
name: Generate Code Coverage Report
runs-on: ubuntu-latest
needs: unit_tests
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore /p:ContinuousIntegrationBuild=true
- name: Test
run: dotnet test --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
- name: Codecov
uses: codecov/[email protected]
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
ui_docker_build:
name: Build UI Docker Image
runs-on: ubuntu-latest
needs: unit_tests
steps:
- uses: actions/checkout@v3
- name: Login to Registry
run: echo ${{ secrets.REGISTRY_PASSWORD }} | docker login registry.jazper.dk --username ${{ secrets.REGISTRY_USERNAME }} --password-stdin
- name: Build the UI Docker image
run: docker build -f ./UI.Dockerfile -t registry.jazper.dk/notam-management-ui:latest .
- name: Push to Registry
run: docker push registry.jazper.dk/notam-management-ui:latest
api_docker_build:
name: Build API Docker Image
runs-on: ubuntu-latest
needs: unit_tests
steps:
- uses: actions/checkout@v3
- name: Login to Registry
run: echo ${{ secrets.REGISTRY_PASSWORD }} | docker login registry.jazper.dk --username ${{ secrets.REGISTRY_USERNAME }} --password-stdin
- name: Build the API Docker image
run: docker build -f ./Api.Dockerfile -t registry.jazper.dk/notam-management-api:latest .
- name: Push to Registry
run: docker push registry.jazper.dk/notam-management-api:latest