Skip to content

Commit 9a9b83d

Browse files
authored
Merge pull request #3 from feO2x/build-and-test-action
Build and Test GitHub action
2 parents b9edf54 + a907284 commit 9a9b83d

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Build and Test
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
build-and-test:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
- name: Set up .NET
16+
uses: actions/setup-dotnet@v4
17+
with:
18+
dotnet-version: 8.0.x
19+
- name: Cache NuGet packages
20+
uses: actions/cache@v4
21+
with:
22+
path: ~/.nuget/packages
23+
key: nuget-${{ runner.os }}-${{ hashFiles('**/packages.lock.json') }}
24+
restore-keys: |
25+
nuget-${{ runner.os }}-
26+
- name: Restore dependencies
27+
run: dotnet restore ./Light.TemporaryStreams.sln
28+
- name: Build
29+
run: dotnet build ./Light.TemporaryStreams.sln --configuration Release --no-restore
30+
- name: Test
31+
run: dotnet test ./Light.TemporaryStreams.sln --configuration Release --no-build --no-restore --verbosity normal

Light.TemporaryStreams.sln

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SolutionItems", "SolutionIt
1616
Light.TemporaryStreams.sln.DotSettings = Light.TemporaryStreams.sln.DotSettings
1717
EndProjectSection
1818
EndProject
19+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{677E4EE1-7062-46AB-81FF-8D20E9316ED6}"
20+
EndProject
21+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{05D48EEC-A2AB-4143-9533-A633E7B25EA3}"
22+
ProjectSection(SolutionItems) = preProject
23+
.github\workflows\build-and-test.yml = .github\workflows\build-and-test.yml
24+
EndProjectSection
25+
EndProject
1926
Global
2027
GlobalSection(SolutionConfigurationPlatforms) = preSolution
2128
Debug|Any CPU = Debug|Any CPU
@@ -54,4 +61,7 @@ Global
5461
GlobalSection(SolutionProperties) = preSolution
5562
HideSolutionNode = FALSE
5663
EndGlobalSection
64+
GlobalSection(NestedProjects) = preSolution
65+
{05D48EEC-A2AB-4143-9533-A633E7B25EA3} = {677E4EE1-7062-46AB-81FF-8D20E9316ED6}
66+
EndGlobalSection
5767
EndGlobal

0 commit comments

Comments
 (0)