mirror of
https://github.com/OpenLogics/MewtocolNet.git
synced 2025-12-06 03:01:24 +00:00
Dev (#9)
* Added autodoc builder step * Added ignore badges branch for push events * Fixed doc builder
This commit is contained in:
23
.github/workflows/test-pipeline.yml
vendored
23
.github/workflows/test-pipeline.yml
vendored
@@ -9,6 +9,8 @@ on:
|
||||
required: false
|
||||
type: string
|
||||
push:
|
||||
branches-ignore:
|
||||
- badges
|
||||
paths-ignore:
|
||||
- '**.md'
|
||||
|
||||
@@ -37,6 +39,25 @@ jobs:
|
||||
- name: 'Run tests'
|
||||
run: dotnet test "./MewtocolTests" /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:CoverletOutput=../Builds/TestResults/coverage.opencover.xml
|
||||
|
||||
- name: 'Run docbuilder'
|
||||
run: dotnet run --project "./DocBuilder/DocBuilder.csproj" "./DocBuilder/Docs/plctypes.md"
|
||||
|
||||
- name: 'Commit generated docs to branch'
|
||||
run: |
|
||||
git fetch
|
||||
git checkout ${{ steps.extract_branch.outputs.branch }}
|
||||
git config --local user.email "action@github.com"
|
||||
git config --local user.name "GitHub Action"
|
||||
git add "./DocBuilder/Docs/plctypes.md" -f
|
||||
git commit -m "(AUTO_DOC) add documentation for branch ${{ steps.extract_branch.outputs.branch }}"
|
||||
|
||||
- name: 'Push docs commit'
|
||||
uses: ad-m/github-push-action@master
|
||||
if: ${{ success() }}
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
branch: ${{ steps.extract_branch.outputs.branch }}
|
||||
|
||||
- name: Report Generator
|
||||
uses: danielpalme/ReportGenerator-GitHub-Action@5.1.22
|
||||
with:
|
||||
@@ -74,7 +95,7 @@ jobs:
|
||||
git add "./Builds/TestResults/summary_${{ steps.extract_branch.outputs.branch }}.html" -f
|
||||
git commit -m "Add/Update badge for branch ${{ steps.extract_branch.outputs.branch }}"
|
||||
|
||||
- name: Push badge commit
|
||||
- name: 'Push badge commit'
|
||||
uses: ad-m/github-push-action@master
|
||||
if: ${{ success() }}
|
||||
with:
|
||||
|
||||
@@ -17,7 +17,18 @@ Console.WriteLine("Building docs for PLC types...");
|
||||
var entryLoc = Assembly.GetEntryAssembly();
|
||||
ArgumentNullException.ThrowIfNull(entryLoc);
|
||||
|
||||
string filePath = Path.Combine(entryLoc.Location, @"..\..\..\..\Docs\plctypes.md");
|
||||
string filePath = null!;
|
||||
|
||||
if(args.Length == 0) {
|
||||
|
||||
filePath = Path.Combine(entryLoc.Location, @"..\..\..\..\Docs\plctypes.md");
|
||||
|
||||
} else {
|
||||
|
||||
filePath = args[0];
|
||||
|
||||
}
|
||||
|
||||
Console.WriteLine($"{filePath}");
|
||||
|
||||
StringBuilder markdownBuilder = new StringBuilder();
|
||||
|
||||
Reference in New Issue
Block a user