Skip to content

Commit 52386b9

Browse files
committed
added workflows
1 parent d99ce53 commit 52386b9

3 files changed

Lines changed: 196 additions & 2 deletions

File tree

.github/workflows/BuildAndTest.yml

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
name: Build and Test
2+
3+
# PREREQUISITES FOR PUSH-BACK OF TEST RESULTS
4+
# Please note: test project usually required nuget package JUnitTestLogger
5+
# to be able to provide JUnit compatible test results XML file (required
6+
# for pushing back details on succeeded/failed tests)
7+
#
8+
# NuGet install command:
9+
# - Install-Package JUnitTestLogger
10+
11+
# Controls when the action will run.
12+
on:
13+
# Triggers the workflow on push or pull request events but only for the master branch
14+
push:
15+
branches: [main]
16+
pull_request:
17+
branches: [main]
18+
19+
# Allows you to run this workflow manually from the Actions tab
20+
workflow_dispatch:
21+
22+
env:
23+
# Path to the solution file relative to the root of the project
24+
SOLUTION_FILE_PATH: .
25+
26+
# Configuration type to build
27+
BUILD_CONFIGURATION: Debug
28+
29+
BUILD_OUTPUT: CompuMaster.Access/bin/Debug
30+
BUILD_OUTPUT_TEST: CompuMaster.Test.MsAccess/bin/Debug
31+
32+
jobs:
33+
34+
test:
35+
#needs: build
36+
runs-on: ${{ matrix.os }}
37+
38+
strategy:
39+
fail-fast: false
40+
matrix:
41+
os: [windows-latest, ubuntu-latest, macos-latest]
42+
include:
43+
- os: macos-latest
44+
runNetExe: mono
45+
46+
# the build-and-test job might be skipped, we don't need to run this job then
47+
#if: success() || failure()
48+
49+
env:
50+
RESULTS_PATH: TestResults.xml
51+
52+
steps:
53+
- name: Checkout
54+
uses: actions/checkout@v4
55+
56+
- name: Setup .NET Core
57+
uses: actions/setup-dotnet@v4
58+
with:
59+
dotnet-version: 8.0.x
60+
61+
- name: Dir Listing (Win)
62+
if: startsWith(matrix.os, 'windows')
63+
run: dir
64+
- name: Dir Listing (Linux/Mac)
65+
if: (!startsWith(matrix.os, 'windows'))
66+
run: ls -la
67+
68+
- name: Install dependencies
69+
run: dotnet restore
70+
71+
- name: Build
72+
run: dotnet build --configuration=${{env.BUILD_CONFIGURATION}} --no-restore
73+
74+
- name: Run Unit Tests
75+
run: dotnet test --framework net8.0 --results-directory test-results --logger junit --configuration=${{env.BUILD_CONFIGURATION}} --no-restore
76+
77+
- name: Dir Listing (Win) test-results
78+
if: startsWith(matrix.os, 'windows')
79+
run: dir test-results
80+
- name: Dir Listing (Linux/Mac) test-results
81+
if: (!startsWith(matrix.os, 'windows'))
82+
run: ls -la test-results
83+
84+
#Following lines maybe required again after test&dev?!
85+
# # the action is useless on pull_request events
86+
# # (it can not create check runs or pull request comments)
87+
# if: always() #&& startsWith(matrix.os, 'ubuntu') #&& github.event_name != 'pull_request'
88+
89+
- name: Unit Test Results (Linux)
90+
uses: EnricoMi/publish-unit-test-result-action@v2
91+
if: always() && startsWith(matrix.os, 'ubuntu')
92+
with:
93+
github_token: ${{ secrets.GITHUB_TOKEN }}
94+
files: "test-results/TestResults.xml"
95+
check_run_annotations: all tests
96+
comment_title: Unit Test Statistics (${{matrix.os}})
97+
check_name: Unit Test Results (${{matrix.os}})
98+
report_individual_runs: true
99+
100+
- name: Unit Test Results (Win/Mac)
101+
uses: EnricoMi/publish-unit-test-result-action/composite@v2
102+
if: always() && (!(startsWith(matrix.os, 'ubuntu')))
103+
with:
104+
github_token: ${{ secrets.GITHUB_TOKEN }}
105+
files: "test-results/TestResults.xml"
106+
check_run_annotations: all tests
107+
comment_title: Unit Test Statistics (${{matrix.os}})
108+
check_name: Unit Test Results (${{matrix.os}})
109+
report_individual_runs: true
110+
111+
- name: Publish Unit Test Results
112+
uses: actions/upload-artifact@v4
113+
if: always()
114+
with:
115+
name: NUnit Test Results ${{ matrix.os }}
116+
path: test-results/TestResults.xml
117+
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: Publish/Upload dotnet package on release
2+
3+
# PLEASE NOTE: PUBLISHING/DEPLOYMENT
4+
# Release is to be created manually at GitHub releases management page
5+
# - release name usually contains "v1.2.3"
6+
# After creating a GitHub release, following actions will automatically run:
7+
# 1. NuGet package (version as defined in VS.Net project property "package version")
8+
# 2. Attaching of compiled binaries to GitHub release
9+
10+
on:
11+
release:
12+
types: [created]
13+
14+
# Allows you to run this workflow manually from the Actions tab
15+
workflow_dispatch:
16+
17+
env:
18+
# Path to the solution file relative to the root of the project.
19+
SOLUTION_FILE_PATH: .
20+
21+
# Name of project configuration for build as well as name of the bin output subdirectory (both must match for "dotnet pack" to find compiled files!)
22+
BUILD_CONFIGURATION: Debug
23+
# Name of build project which creates required output for packaging/deployment
24+
BUILD_PROJECT: CompuMaster.Access/CompuMaster.Access.vbproj
25+
# Name of directory (e.g. "bin") containing the subdirectory (e.g. "CI_CD") with all output files (*.dll)
26+
BUILD_OUTPUT_BASEDIR: CompuMaster.Access/bin
27+
28+
29+
jobs:
30+
publish:
31+
runs-on: ubuntu-latest
32+
#if: false # always skip job
33+
34+
steps:
35+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
36+
- name: Checkout
37+
uses: actions/checkout@v4
38+
39+
- name: Setup .NET Core
40+
uses: actions/setup-dotnet@v4
41+
with:
42+
dotnet-version: 8.0.x
43+
44+
- name: Install dependencies
45+
run: dotnet restore
46+
47+
- name: Build
48+
run: dotnet build --configuration=${{env.BUILD_CONFIGURATION}} --no-restore
49+
50+
- name: Pack binaries
51+
run: |
52+
(cd ${{env.BUILD_OUTPUT_BASEDIR}}/${{env.BUILD_CONFIGURATION}} && zip $OLDPWD/bin.zip -r .)
53+
54+
- name: Publish binaries
55+
uses: softprops/action-gh-release@v1
56+
with:
57+
files: "bin.zip"
58+
env:
59+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
60+
61+
- name: Pack
62+
run: dotnet pack --no-build --configuration=${{env.BUILD_CONFIGURATION}} ${{env.BUILD_PROJECT}} --output .
63+
64+
- name: PushNuget
65+
run: dotnet nuget push *.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }} --skip-duplicate
66+
67+
- name: Publish Package Artifacts
68+
uses: actions/upload-artifact@v4
69+
with:
70+
name: Nupkg Artifacts
71+
path: ./**/*.nupkg

CompuMaster.MsAccess.sln

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio Version 17
4-
VisualStudioVersion = 17.4.33122.133
3+
# Visual Studio Version 18
4+
VisualStudioVersion = 18.0.11222.15 d18.0
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{778DAE3C-4631-46EA-AA77-85C1314464D9}") = "CompuMaster.MsAccess", "CompuMaster.Access\CompuMaster.MsAccess.vbproj", "{ABB5A567-756A-4DDC-9FD6-F54594CB9361}"
77
EndProject
@@ -11,6 +11,12 @@ Project("{778DAE3C-4631-46EA-AA77-85C1314464D9}") = "MsOfficeInteropTemplate.Tes
1111
EndProject
1212
Project("{778DAE3C-4631-46EA-AA77-85C1314464D9}") = "CompuMaster.Test.MsAccess", "CompuMaster.Test.MsAccess\CompuMaster.Test.MsAccess.vbproj", "{6A485176-A543-4A87-956A-08A6CA25D248}"
1313
EndProject
14+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Projektmappenelemente", "Projektmappenelemente", "{4EEDDF46-36FC-429C-8730-48DD3E27608A}"
15+
ProjectSection(SolutionItems) = preProject
16+
.github\workflows\BuildAndTest.yml = .github\workflows\BuildAndTest.yml
17+
.github\workflows\PublishRelease.yml = .github\workflows\PublishRelease.yml
18+
EndProjectSection
19+
EndProject
1420
Global
1521
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1622
Debug|Any CPU = Debug|Any CPU

0 commit comments

Comments
 (0)