-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (49 loc) · 1.57 KB
/
newbuild.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
name: Build Project
on:
push:
branches:
- master
pull_request:
branches:
- master
workflow_dispatch: ## turn available trigger manually the workflow
jobs:
versioning:
runs-on: ubuntu-latest
name: Versioning
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
fetch-depth: 0
- uses: codacy/git-version@2.8.0
id: version
with:
release-branch: master
prefix: v
## prefix to version
build:
runs-on: ubuntu-latest
name: Build Project
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x' # Adjust the version as needed
cache: true
cache-dependency-path: ./src/**/packages.lock.json # Needs to enable cache directly in the main project first, adding that flag as true RestorePackagesWithLockFile
- name: Restore dependencies
run: dotnet restore
- name: Build the project
run: dotnet build --configuration Release --no-restore
# Do the tests and generate the file
- name: Test
run: |
dotnet test --no-build --no-restore ./AspirePoc.sln --configuration Release --logger trx --results-directory "TestResults"
- uses: actions/upload-artifact@v4 # generate artifacts that turn available to download
with:
name: dotnet-test-results
path: TestResults