-
Notifications
You must be signed in to change notification settings - Fork 1
66 lines (56 loc) · 2 KB
/
ci.yml
File metadata and controls
66 lines (56 loc) · 2 KB
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
name: CI
on:
push:
branches:
- master
- develop
paths-ignore:
- 'README.md'
- 'docs/**'
pull_request:
branches:
- master
- develop
env:
DOTNET_VERSION: '10.0'
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
jobs:
build-and-test:
name: Build and Test
runs-on: windows-latest
env:
BUILD_CONFIGURATION: Release
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Cache NuGet packages
uses: actions/cache@v4
with:
path: ${{ env.NUGET_PACKAGES }}
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: Restore packages
run: dotnet restore CyberdyneDevelopment.RoslynTools.sln
- name: Build
run: |
dotnet build-server shutdown
dotnet build CyberdyneDevelopment.RoslynTools.sln --configuration ${{ env.BUILD_CONFIGURATION }} --no-restore -p:UseSharedCompilation=false -p:ContinuousIntegrationBuild=true
- name: Run tests
run: dotnet test CyberdyneDevelopment.RoslynTools.sln --configuration ${{ env.BUILD_CONFIGURATION }} --no-build --verbosity normal
continue-on-error: ${{ github.ref == 'refs/heads/develop' }}
- name: Pack CLI tool
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop'
run: dotnet pack src/CyberdyneDevelopment.RoslynTools.CLI/CyberdyneDevelopment.RoslynTools.CLI.csproj --configuration ${{ env.BUILD_CONFIGURATION }} --no-build --output ${{ github.workspace }}/packages
- name: Upload packages
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop'
uses: actions/upload-artifact@v4
with:
name: packages
path: ${{ github.workspace }}/packages