fix: publish correctly #5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| pull_request: | |
| branches: [master] | |
| push: | |
| branches: | |
| - master | |
| permissions: | |
| contents: write | |
| statuses: write | |
| checks: write | |
| pull-requests: write | |
| jobs: | |
| set-version: | |
| name: Set Version | |
| runs-on: ubuntu-latest | |
| container: | |
| image: mcr.microsoft.com/dotnet/sdk:10.0 | |
| outputs: | |
| semVer: ${{ steps.gitversion.outputs.semVer }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: install deps | |
| run: | | |
| apt-get update && apt-get install -y jq git | |
| git config --global --add safe.directory "$GITHUB_WORKSPACE" | |
| git config user.email ${{ github.actor }}-ci@gha.org | |
| git config user.name ${{ github.actor }} | |
| - name: Install GitVersion | |
| uses: gittools/actions/gitversion/setup@v4.1.0 | |
| with: | |
| versionSpec: "6.x" | |
| - name: Set SemVer Version | |
| uses: gittools/actions/gitversion/execute@v4.1.0 | |
| id: gitversion | |
| - name: echo VERSIONS | |
| run: | | |
| echo "REVISION -> $GITHUB_SHA" | |
| echo "VERSION -> $GITVERSION_SEMVER" | |
| test: | |
| runs-on: ubuntu-latest | |
| name: Run Tests | |
| needs: set-version | |
| env: | |
| SEMVER: ${{ needs.set-version.outputs.semVer }} | |
| GIT_TAG: ${{ needs.set-version.outputs.semVer }} | |
| GOVCS: false | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 1 | |
| - name: Install Eirctl | |
| uses: ensono/actions/eirctl-setup@v0.3.1 | |
| - name: Run Lint | |
| run: | | |
| eirctl run pipeline lints | |
| - name: Run Tests | |
| run: | | |
| eirctl run pipeline gha:unit:test | |
| - name: Publish Junit style Test Report | |
| uses: mikepenz/action-junit-report@v4 | |
| if: always() # always run even if the previous step fails | |
| with: | |
| report_paths: "**/.coverage/report-junit.xml" | |
| - name: Code Coverage Report | |
| uses: irongut/CodeCoverageSummary@v1.3.0 | |
| with: | |
| filename: "**/.coverage/report-cobertura.xml" | |
| badge: true | |
| fail_below_min: false | |
| format: markdown | |
| hide_branch_rate: false | |
| hide_complexity: true | |
| 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 |