-
-
Notifications
You must be signed in to change notification settings - Fork 5
157 lines (135 loc) · 4.42 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
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/[email protected]
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
node-version: 18
cache: 'npm'
cache-dependency-path: 'source/Gnomeshade.WebApi/Node/package-lock.json'
- name: Cache NuGet packages
uses: actions/[email protected]
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
- name: Cache Docker images
uses: ScribeMD/[email protected]
with:
key: docker-${{ runner.os }}-${{ hashFiles('**/WebserverSetup.cs') }}
- 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
- name: Gather Code Coverage
uses: codecov/[email protected]
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/[email protected]
- uses: actions/[email protected]
- uses: actions/[email protected]
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/[email protected]
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/[email protected]
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
steps:
- uses: actions/[email protected]
- uses: actions/[email protected]
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/[email protected]
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/[email protected]
- run: ./deployment/test-docker.sh ${{ github.run_number }} ${{ secrets.DEMO_ADMIN_PASSWORD }}
resharper:
name: Resharper
runs-on: ubuntu-latest
if: false # Too many false positives, latest versions don't work
steps:
- uses: actions/[email protected]
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
node-version: 18
cache: 'npm'
cache-dependency-path: 'source/Gnomeshade.WebApi/Node/package-lock.json'
- name: Cache NuGet packages
uses: actions/[email protected]
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
- run: ./deployment/build.sh
- name: ReSharper annotations
timeout-minutes: 10
uses: VMelnalksnis/[email protected]
with:
solution: Gnomeshade.sln
resharper-version: 2023.3.0