-
-
Notifications
You must be signed in to change notification settings - Fork 7
65 lines (51 loc) · 1.77 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
name: CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
formatting:
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v3
- name: Check formatting
run: dotnet format --verify-no-changes --severity error
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
env:
OS: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Print Debug Info
run: dotnet --info
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Run Tests
run: dotnet test --no-build --no-restore --logger "GitHubActions" --collect:"XPlat Code Coverage;Format=opencover"
- name: Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.xml
fail_ci_if_error: false
env_vars: OS
flags: ${{ env.OS }}
- name: Publish (Linux)
if: runner.os == 'Linux'
run: dotnet publish other/GameFinder.Example/GameFinder.Example.csproj -o ${{ github.workspace }}/bin/${{ runner.os }} -p:PublishReadyToRun=true -p:PublishSingleFile=true -p:PublishTrimmed=false
- name: Publish (Windows)
if: runner.os == 'Windows'
run: dotnet publish other/GameFinder.Example/GameFinder.Example.csproj -o ${{ github.workspace }}/bin/${{ runner.os }} -p:PublishReadyToRun=true -p:PublishSingleFile=true -p:PublishTrimmed=false
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: GameFinder.Example-${{ runner.os }}-${{ github.sha }}
path: ${{ github.workspace }}/bin/${{ runner.os }}/GameFinder*
if-no-files-found: error