-
-
Notifications
You must be signed in to change notification settings - Fork 5
169 lines (146 loc) · 4.8 KB
/
build-and-test.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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
name: build and test
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
on:
push:
branches: [ master ]
paths-ignore:
- '**.md'
- 'docs/**'
pull_request:
branches: [ master ]
paths-ignore:
- '**.md'
- 'docs/**'
env:
DOTNET_NOLOGO: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
jobs:
build-and-test:
name: Build and test
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4.2.2
- uses: actions/setup-dotnet@v4.1.0
- uses: actions/setup-node@v4.1.0
with:
node-version: 18
cache: 'npm'
cache-dependency-path: 'source/Gnomeshade.WebApi/Node/package-lock.json'
- name: Cache NuGet packages
uses: actions/cache@v4.1.2
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
- name: Cache Docker images
uses: ScribeMD/docker-cache@0.5.0
with:
key: docker-${{ runner.os }}-${{ hashFiles('**/WebserverSetup.cs') }}
- name: Run tests
run: ./deployment/test.sh
env:
Admin:Password: ${{ secrets.DEMO_ADMIN_PASSWORD }}
Nordigen:SecretId: ${{ secrets.NORDIGEN_SECRET_ID }}
Nordigen:SecretKey: ${{ secrets.NORDIGEN_SECRET_KEY }}
Serilog:MinimumLevel: Warning
OpenTelemetry__Enabled: false
- name: Gather Code Coverage
uses: codecov/codecov-action@v5.0.7
if: always()
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
- name: Gather Test Results
uses: codecov/test-results-action@v1.0.2
if: always()
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
build-deb:
name: Build debian package
runs-on: ubuntu-20.04
timeout-minutes: 10
steps:
- uses: actions/checkout@v4.2.2
- uses: actions/setup-dotnet@v4.1.0
- uses: actions/setup-node@v4.1.0
with:
node-version: 18
cache: 'npm'
cache-dependency-path: 'source/Gnomeshade.WebApi/Node/package-lock.json'
- run: echo "BUILD_TAG=-test"
- name: Cache NuGet packages
uses: actions/cache@v4.1.2
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
- name: Publish project
id: publish
run: deployment/publish.sh "Gnomeshade.WebApi" "linux-x64" "${{ github.run_number }}" "-test"
- name: Build debian package
run: deployment/debian.sh "${{ steps.publish.outputs.artifact }}" "${{ github.run_number }}"
- uses: actions/upload-artifact@v4.4.3
with:
name: Gnomeshade.WebApi_linux-x64.deb
path: "**/*.deb"
ansible:
name: Test ansible role
runs-on: ubuntu-20.04
timeout-minutes: 10
needs: build-deb
strategy:
matrix:
distro:
- debian10
- debian11
- debian12
- ubuntu2004
- ubuntu2204
- ubuntu2404
steps:
- uses: actions/checkout@v4.2.2
- uses: actions/download-artifact@v4.1.8
id: download
with:
name: Gnomeshade.WebApi_linux-x64.deb
- run: mv ${{ steps.download.outputs.download-path }}/gnomeshade.deb ./deployment/ansible/gnomeshade/molecule/default/gnomeshade.deb
- uses: gofrolist/molecule-action@v2.7.43
with:
molecule_working_dir: './deployment/ansible/gnomeshade'
env:
MOLECULE_DISTRO: ${{ matrix.distro }}
docker:
name: Test docker container
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4.2.2
- run: ./deployment/test-docker.sh ${{ github.run_number }} ${{ secrets.DEMO_ADMIN_PASSWORD }}
resharper:
name: Resharper
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.2.2
- uses: actions/setup-dotnet@v4.1.0
- uses: actions/setup-node@v4.1.0
with:
node-version: 18
cache: 'npm'
cache-dependency-path: 'source/Gnomeshade.WebApi/Node/package-lock.json'
- name: Cache NuGet packages
uses: actions/cache@v4.1.2
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
- run: ./deployment/build.sh
- name: ReSharper annotations
timeout-minutes: 10
uses: VMelnalksnis/resharper-inspect-action@v0.3.1
with:
solution: Gnomeshade.sln
resharper-version: 2023.3.0
treat-warnings-as-errors: true
extra-args: '--exclude=**.wixproj --exclude=**.wxs --no-build' # Hangs if WiX is not excluded