Build Toolkit NDepend Analysis for GitHub Pages #23
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
| # More GitHub Actions for Azure: https://github.com/Azure/actions | |
| name: Build Toolkit NDepend Analysis for GitHub Pages | |
| env: | |
| PROJECT_PATH_CORE: Stride.CommunityToolkit.sln | |
| on: | |
| workflow_dispatch: | |
| # Only allow one deployment at a time, cancel previous in-progress runs on new pushes | |
| concurrency: | |
| group: pages-toolkit | |
| cancel-in-progress: true | |
| permissions: | |
| contents: write # to push to gh-pages branch | |
| jobs: | |
| build-and-deploy: | |
| runs-on: windows-latest | |
| steps: | |
| - name: Dotnet Setup | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| dotnet-version: 10.x | |
| - name: Checkout Stride Community Toolkit | |
| uses: actions/checkout@v5 | |
| with: | |
| repository: stride3d/stride-community-toolkit | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| lfs: true | |
| path: source | |
| - name: Checkout gh-pages branch | |
| uses: actions/checkout@v5 | |
| with: | |
| ref: gh-pages | |
| path: gh-pages | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Restore Stride dependencies | |
| working-directory: source | |
| run: dotnet restore ${{ env.PROJECT_PATH_CORE }} --runtime win-x64 | |
| - name: Build Stride.CommunityToolkit.sln | |
| working-directory: source | |
| run: dotnet build ${{ env.PROJECT_PATH_CORE }} --no-restore | |
| - name: NDepend | |
| uses: ndepend/ndepend-action@v2 | |
| with: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| license: ${{ secrets.NDependLicense }} | |
| customconfig: source/Stride.CommunityToolkit.ndproj | |
| baseline: recent | |
| - name: Copy NDepend results to gh-pages | |
| shell: pwsh | |
| run: | | |
| $dest = "gh-pages/toolkit/ndepend" | |
| New-Item -ItemType Directory -Force -Path $dest | Out-Null | |
| Copy-Item -Path ..\..\_temp\NDependOut\NDependReport.html -Destination "$dest\NDependReport.html" -Force | |
| Copy-Item -Path ..\..\_temp\NDependOut\NDependReportFiles -Destination "$dest\" -Recurse -Force | |
| - name: Commit and push to gh-pages | |
| working-directory: gh-pages | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add . | |
| git diff --staged --quiet || git commit -m "Update Toolkit NDepend report" | |
| git push |