-
-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (49 loc) · 1.76 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
name: CI Build
on:
push:
branches:
- "**"
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Start MongoDB
uses: supercharge/[email protected]
with:
mongodb-version: "6.0"
mongodb-replica-set: rs0
# Pull in a matching machine repo branch if it exists to use it rather than the released version of Machine.
- name: Check if there is a corresponding branch in Machine
id: find_matching_branch
continue-on-error: true
if: ${{ github.ref_name }} != "main"
run: cd .. && git clone https://github.com/sillsdev/machine.git --branch ${{ github.ref_name }} && dotnet build machine
- name: Restore dotnet tools
run: dotnet tool restore
- name: Restore dependencies
run: dotnet restore
- name: Check formatting
run: dotnet csharpier --check .
- name: Build
run: dotnet build --no-restore -c Release
- name: Pre-Test
run: sudo mkdir -p /var/lib/serval && sudo chmod 777 /var/lib/serval
- name: Test
run: dotnet test --verbosity normal --filter "TestCategory!=E2E&TestCategory!=E2EMissingServices" --collect:"Xplat Code Coverage" --logger "trx;LogFileName=test-results.trx"
- name: Test report
uses: dorny/test-reporter@v1
if: success() || failure()
with:
name: NUnit Tests
path: src/**/TestResults/test-results.trx
reporter: dotnet-trx
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}