This repository has been archived by the owner on Dec 18, 2023. It is now read-only.
forked from tiaringhio/Surreal.NET
-
Notifications
You must be signed in to change notification settings - Fork 6
96 lines (82 loc) · 2.73 KB
/
build-stable.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
name: Build & Test
on:
workflow_dispatch:
push:
branches:
- "master"
- "hotfix/**"
paths-ignore:
- ".github/**"
- "docs/**"
- "examples/**"
- "*.md"
- "*.yml"
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: true
defaults:
run:
shell: bash
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
dotnet:
[{ ch: "3.1", ver: "netcoreapp31" }, { ch: "6.0", ver: "net60" }]
channel: ["stable"]
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Initialize Cache
uses: actions/cache@v3
with:
path: ~/.nuget/packages
# Look to see if there is a cache hit for the corresponding requirements file
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
${{ runner.os }}-nuget
- name: Initialize SurrealDB
run: |
mkdir -p ~/.local/bin || exit 1
mkdir -p ~/tmp || exit 1
pushd ~/tmp || exit 1
curl -sSf https://install.surrealdb.com -o ./surealdb-install.sh
chmod +x ./surealdb-install.sh
./surealdb-install.sh ~/.local/bin --${{ matrix.channel }}
export PATH="$HOME/.local/bin/:$PATH"
popd
surreal version || exit 1
- name: Initialize .NET SDK
run: |
curl https://dot.net/v1/dotnet-install.sh -o ~/dotnet-install.sh
chmod +x ~/dotnet-install.sh
~/dotnet-install.sh -c ${{ matrix.dotnet.ch }}
dotnet --info
- name: Restore Dependencies
run: dotnet restore
- name: Build Solution
run: dotnet build --no-restore -f:${{ matrix.dotnet.ver }}
- name: Execute Unit-Tests
run: |
dotnet test --no-build -f:${{ matrix.dotnet.ver }} --verbosity normal --logger "trx;LogFileName=$(pwd)/test-results.trx" --collect:"XPlat Code Coverage" /p:CollectCoverage=true /p:CoverletOutputFormat=\"cobertura\" /p:CoverletOutput="$(pwd)/" /p:UseSourceLink=true
- name: Test Report
if: success() || failure()
uses: phoenix-actions/test-reporting@v8
with:
name: results-${{ matrix.dotnet.ver }}-${{ matrix.channel }}
path: test-results.trx
reporter: dotnet-trx
fail-on-error: false
- name: Test Coverage
if: ${{ github.ref == 'refs/heads/master' }}
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.cobertura.xml
flags: unittests
name: Surreal.Net
fail_ci_if_error: false
verbose: true