#202 - codegen #1019
Workflow file for this run
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: Develop Workflow | |
| on: | |
| push: | |
| branches-ignore: | |
| - 'release' | |
| pull_request: | |
| branches-ignore: | |
| - 'release' | |
| permissions: | |
| actions: write | |
| checks: write | |
| contents: write | |
| issues: write | |
| pull-requests: write | |
| jobs: | |
| build-and-test: | |
| name: Build & Test | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| dotnet-version: 10.0.x | |
| - name: Setup GitVersion | |
| uses: gittools/actions/gitversion/[email protected] | |
| with: | |
| versionSpec: '6.4.x' | |
| - name: Determine Version | |
| id: version_step | |
| uses: gittools/actions/gitversion/[email protected] | |
| - name: Push New Version Tag | |
| if: github.ref == 'refs/heads/master' && github.event_name == 'push' | |
| run: | | |
| $gv = 'v${{ steps.version_step.outputs.majorMinorPatch }}' #gitversion result | |
| $lt = $( git describe --tags --abbrev=0 ) # last tag version result | |
| if ( -Not ( $gv -eq $lt ) ) | |
| { | |
| git tag $gv | |
| git push origin --tags | |
| } | |
| - name: Restore dependencies | |
| run: dotnet restore | |
| - name: Build | |
| run: dotnet build /p:Version=${{ steps.version_step.outputs.fullSemVer }} --no-restore -c Debug -v n | |
| - name: Unit Tests | |
| run: dotnet test -c Debug --no-build -v n --filter-trait Category=Unit | |
| - name: Integration Tests | |
| run: | | |
| dotnet test --project tests/HydraScript.IntegrationTests -c Debug --no-build -v n --coverage --coverage-output-format cobertura --coverage-output coverage.cobertura.xml | |
| mkdir coverage-report | |
| - name: Code Coverage Summary Report For Merge Request | |
| if: github.event_name == 'pull_request' | |
| uses: 5monkeys/cobertura-action@master | |
| with: | |
| path: ./tests/HydraScript.IntegrationTests/bin/Debug/net10.0/TestResults/coverage.cobertura.xml | |
| repo_token: ${{ secrets.GITHUB_TOKEN }} | |
| minimum_coverage: 80 | |
| fail_below_threshold: true | |
| show_class_names: true | |
| show_missing: true | |
| link_missing_lines: true | |
| show_branch: true | |
| only_changed_files: true | |
| - name: ReportGenerator | |
| uses: danielpalme/[email protected] | |
| with: | |
| reports: './tests/HydraScript.IntegrationTests/bin/Debug/net10.0/TestResults/coverage.cobertura.xml' | |
| targetdir: './coverage-report' | |
| - name: Upload coverage report artifact | |
| if: github.event_name == 'push' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: CoverageReport | |
| path: coverage-report | |
| - name: Upload Windows Build | |
| if: github.ref != 'refs/heads/master' && github.event_name == 'push' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: windows_build_${{ steps.version_step.outputs.fullSemVer }} | |
| path: ./src/HydraScript/bin/Debug/net10.0 |