-
Notifications
You must be signed in to change notification settings - Fork 2
138 lines (129 loc) · 4.35 KB
/
run_build.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
name: DLCS Build, Test & Publish
on:
push:
branches: [ "main", "develop" ]
tags: [ "v*" ]
pull_request:
branches: [ "main", "develop" ]
paths-ignore:
- "docs/**"
jobs:
test-dotnet:
runs-on: ubuntu-latest
defaults:
run:
working-directory: src/protagonist
env:
BUILD_CONFIG: "Release"
SOLUTION: "protagonist.sln"
steps:
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'zulu' # Alternative distribution options are available.
- id: checkout
uses: actions/checkout@v4
- id: setup-dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: "6.0.x"
- name: Cache SonarCloud packages
uses: actions/cache@v3
with:
path: ~/sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Install SonarCloud scanners and code coverage tools
run: |
dotnet tool install --global dotnet-sonarscanner
dotnet tool install --global JetBrains.dotCover.GlobalTool
- id: restore-dotnet-dependencies
run: dotnet restore $SOLUTION
- id: build-dotnet
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
dotnet-sonarscanner begin /k:"dlcs_protagonist" /o:"dlcs" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.dotcover.reportsPaths=dotCover.Output.html
dotnet build $SOLUTION --configuration $BUILD_CONFIG --no-restore
dotnet dotcover test --dcReportType=HTML --filter 'Category!=Manual' --configuration $BUILD_CONFIG --no-restore --no-build --verbosity normal
dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"
build-push-orchestrator:
runs-on: ubuntu-latest
needs: test-dotnet
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/docker-build-and-push
name: build and push
with:
image-name: "orchestrator"
dockerfile: "Dockerfile.Orchestrator"
context: "./src/protagonist"
github-token: ${{ secrets.GITHUB_TOKEN }}
build-push-thumbs:
runs-on: ubuntu-latest
needs: test-dotnet
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/docker-build-and-push
with:
image-name: "thumbs"
dockerfile: "Dockerfile.Thumbs"
context: "./src/protagonist"
github-token: ${{ secrets.GITHUB_TOKEN }}
build-push-engine:
runs-on: ubuntu-latest
needs: test-dotnet
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/docker-build-and-push
with:
image-name: "engine"
dockerfile: "Dockerfile.Engine"
context: "./src/protagonist"
github-token: ${{ secrets.GITHUB_TOKEN }}
build-push-portal:
runs-on: ubuntu-latest
needs: test-dotnet
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/docker-build-and-push
with:
image-name: "portal"
dockerfile: "Dockerfile.Portal"
context: "./src/protagonist"
github-token: ${{ secrets.GITHUB_TOKEN }}
build-push-api:
runs-on: ubuntu-latest
needs: test-dotnet
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/docker-build-and-push
with:
image-name: "api"
dockerfile: "Dockerfile.API"
context: "./src/protagonist"
github-token: ${{ secrets.GITHUB_TOKEN }}
build-push-cleanuphandler:
runs-on: ubuntu-latest
needs: test-dotnet
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/docker-build-and-push
with:
image-name: "cleanuphandler"
dockerfile: "Dockerfile.CleanupHandler"
context: "./src/protagonist"
github-token: ${{ secrets.GITHUB_TOKEN }}
build-push-migrator:
runs-on: ubuntu-latest
needs: test-dotnet
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/docker-build-and-push
with:
image-name: "migrator"
dockerfile: "Dockerfile.Migrator"
context: "./src/protagonist"
github-token: ${{ secrets.GITHUB_TOKEN }}