-
Notifications
You must be signed in to change notification settings - Fork 2
78 lines (63 loc) · 2.42 KB
/
CI.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
name: CI
on:
push:
pull_request:
workflow_dispatch:
# see https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule
schedule:
# once a day
- cron: "0 0 * * *"
jobs:
buildAndTest-linux:
name: Build and Run Tests (Linux)
runs-on: ubuntu-22.04
container:
# TODO: move to 24.04 as soon as it is published in Apr2024
image: "ubuntu:23.10"
steps:
- uses: actions/checkout@v2
- name: Install required dependencies
run: |
apt update
apt install --yes sudo
sudo apt install --yes --no-install-recommends git
# workaround for https://github.com/actions/runner/issues/2033
git config --global --add safe.directory '*'
- name: Setup .NET
run: |
# We need to install `ca-certificates`, otherwise we get these errors in the CI:
# Unable to load the service index for source https://api.nuget.org/v3/index.json.
# The SSL connection could not be established, see inner exception.
# The remote certificate is invalid because of errors in the certificate chain: UntrustedRoot
apt install --yes --no-install-recommends ca-certificates
apt install --yes --no-install-recommends dotnet8
# Trust ASP.NET Core HTTPS development certificate so that GRPC server can be contacted through HTTPS.
# HTTPS connection is used in end-to-end GRPC tests.
dotnet dev-certs https
sudo -E dotnet dev-certs https --export-path /usr/local/share/ca-certificates/aspnet/https.crt --format PEM
sudo update-ca-certificates
- name: Restore nuget dependencies
run: dotnet restore
- name: Compile the main solution
run: dotnet build --no-restore
- name: Install and start Redis
run: |
sudo apt install --yes --no-install-recommends redis-server
redis-server --daemonize yes
- name: Run tests
run: dotnet test
buildAndTest-windows:
name: Build (Windows)
runs-on: windows-latest
steps:
- uses: actions/checkout@v1
with:
submodules: false
- name: Setup .NET SDK 8.0.x
uses: actions/setup-dotnet@v1.7.2
with:
dotnet-version: '8.0.101'
- name: Restore nuget dependencies
run: dotnet restore
- name: Compile the main solution
run: dotnet build --no-restore