Update build.yml #24
This file contains 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: Full Build | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup dotnet | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 9.x | |
dotnet-quality: 'preview' | |
- name: Install SQL Local DB | |
run: ./setup-sqllocaldb.ps1 | |
shell: pwsh | |
- name: Build | |
run: dotnet build QuerySpecification.sln --configuration Release | |
- name: Test | |
run: dotnet test QuerySpecification.sln --configuration Release --no-build --no-restore --collect:"XPlat Code Coverage" | |
- name: ReportGenerator | |
uses: danielpalme/[email protected] | |
with: | |
reports: tests/**/coverage.cobertura.xml | |
targetdir: ${{ runner.temp }}/coveragereport | |
reporttypes: 'Html;Badges;MarkdownSummaryGithub' | |
assemblyfilters: -*Tests* | |
- name: List content (for debugging) | |
run: ls -la | |
shell: bash | |
- name: Publish coverage report in build summary | |
run: cat '${{ runner.temp }}'/coveragereport/SummaryGithub.md >> $GITHUB_STEP_SUMMARY | |
shell: bash | |
- name: Update Gist with coverage report | |
run: | | |
gh gist edit $env:GIST_ID --add ${{ runner.temp }}/coveragereport/badge_combined.svg --filename badge_combined.svg | |
gh gist edit $env:GIST_ID --add ${{ runner.temp }}/coveragereport/SummaryGithub.md --filename SummaryGithub.md | |
env: | |
GH_TOKEN: ${{ secrets.GIST_TOKEN }} | |
GIST_ID: ${{ secrets.GIST_ID }} | |
- name: Create coverage-reports branch and push content | |
run: | | |
git fetch | |
git checkout coverage-reports || git checkout --orphan coverage-reports | |
git reset --hard | |
git clean -fd | |
cp -rp '${{ runner.temp }}'/coveragereport/* ./ | |
echo "queryspecification.fiseni.com" > CNAME | |
git config user.name github-actions | |
git config user.email [email protected] | |
git add . | |
git commit -m "Update coverage reports [skip ci]" || echo "No changes to commit" | |
git push origin coverage-reports --force | |
shell: bash |