Skip to content

Commit

Permalink
Refactor github workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
mcpride committed May 3, 2023
1 parent d5329bf commit dc6ce72
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 158 deletions.
57 changes: 50 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,58 @@
name: CI Build
name: CI

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
tags:
- "McPride.Markdig*-v[0-9]+.[0-9]+.[0-9]+"
- "McPride.Markdig*-v[0-9]+.[0-9]+.[0-9]+-alpha[0-9]+.[0-9]+"
- "McPride.Markdig*-v[0-9]+.[0-9]+.[0-9]+-beta[0-9]+.[0-9]+"
- "McPride.Markdig*-v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+.[0-9]+"
- "McPride.Markdig*-v[0-9]+.[0-9]+.[0-9]+-preview[0-9]+.[0-9]+"
- "McPride.Markdig*-v[0-9]+.[0-9]+.[0-9]+-prerelease[0-9]+.[0-9]+"
- "McPride.Markdig*-v[0-9]+.[0-9]+.[0-9]+-pre[0-9]+.[0-9]+"

jobs:
shared:
uses: ./.github/workflows/shared.yml
build:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
- name: Restore dependencies
run: dotnet restore src/mcpride-markdig-extensions.sln
- name: Build Debug
run: dotnet build src/mcpride-markdig-extensions.sln --no-restore --configuration Debug
- name: Test
run: dotnet test src/mcpride-markdig-extensions.sln --no-build --verbosity normal --collect:"XPlat Code Coverage" --logger trx --results-directory ./coverage
- name: Code Coverage Summary Report
uses: irongut/[email protected]
with:
filename: coverage/*/coverage.cobertura.xml
badge: true
fail_below_min: false
format: markdown
hide_branch_rate: false
hide_complexity: false
indicators: true
output: both
thresholds: '60 80'
- name: Add Coverage PR Comment
uses: marocchino/sticky-pull-request-comment@v2
if: github.event_name == 'pull_request'
with:
recreate: true
path: code-coverage-results.md
- name: Write to Job Summary
run: cat code-coverage-results.md >> $GITHUB_STEP_SUMMARY
release:
if: github.event_name == 'tags'
needs: test
runs-on: ubuntu-latest
needs: shared
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -21,6 +62,8 @@ jobs:
with:
dotnet-version: 6.0.x
- name: Restore dependencies
run: dotnet restore src/mcpride-markdig-extensions.sln
run: dotnet restore src/mcpride-markdig-extensions.sln
- name: Build release
run: dotnet build src/mcpride-markdig-extensions.sln --no-restore --configuration Release
run: dotnet build src/mcpride-markdig-extensions.sln --no-restore --configuration Release
- name: Push packages to nuget.org
run: dotnet nuget push ./**/Release/McPride.Markdig.*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_PUSH_API_KEY }}
54 changes: 0 additions & 54 deletions .github/workflows/prerelease.yml

This file was deleted.

55 changes: 0 additions & 55 deletions .github/workflows/release.yml

This file was deleted.

42 changes: 0 additions & 42 deletions .github/workflows/shared.yml

This file was deleted.

0 comments on commit dc6ce72

Please sign in to comment.