forked from andrewjsaid/builderbuilder
-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (50 loc) · 1.55 KB
/
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
name: "Run tests"
on:
push:
pull_request:
paths:
- "**.cs"
- "**.csproj"
permissions:
contents: read
# https://www.meziantou.net/how-to-cancel-github-workflows-when-pushing-new-commits-on-a-branch.htm
concurrency:
# github.event.pull_request.number || github.ref: pull request number or branch name if not a pull request
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
test:
name: test-${{matrix.os}}
runs-on: ${{ matrix.os }}
timeout-minutes: 10
strategy:
matrix:
os: [ubuntu-latest]
steps:
- name: 'Checkout Repository'
uses: actions/checkout@v4.1.1
- name: Setup .NET Core
uses: actions/setup-dotnet@v3.2.0
with:
dotnet-version: "7.x"
dotnet-quality: "ga"
cache: true
cache-dependency-path: "**/packages.lock.json"
- name: Install dependencies
env:
COMMIT_VAR: ${{ contains(github.actor, 'dependabot') }}
run: |
if ${COMMIT_VAR} == true; then
dotnet restore --force-evaluate
else
dotnet restore
fi
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Test
run: dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura --no-restore --verbosity normal --logger GitHubActions
- name: Code coverage
uses: codecov/codecov-action@v3.1.4
with:
flags: unittests
verbose: true