Improve documentation #424
Workflow file for this run
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
# SPDX-FileCopyrightText: 2022 Frans van Dorsselaer | |
# | |
# SPDX-License-Identifier: MIT | |
--- | |
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json | |
name: Build | |
on: | |
push: | |
branches: [master] | |
pull_request: | |
branches: [master] | |
permissions: | |
contents: read | |
issues: read | |
checks: write | |
pull-requests: write | |
actions: write | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
- name: Cache | |
uses: actions/cache@v4 | |
with: | |
path: ~/.nuget/packages | |
key: ${{ runner.os }}-nuget-${{ hashFiles('global.json', '**/Directory.Packages.props') }} | |
- name: Restore dependencies | |
run: | | |
dotnet tool restore | |
dotnet restore | |
dotnet restore Documentation --no-dependencies | |
- name: Build | |
run: | | |
dotnet build --configuration Release --no-restore | |
- name: Test | |
run: | | |
dotnet test --configuration Release --no-build \ | |
-p:TestingPlatformCommandLineArguments="--report-trx --coverage --coverage-output-format cobertura --coverage-output coverage.cobertura.xml" | |
- name: Package | |
run: | | |
dotnet pack --configuration Release --no-build | |
- name: Upload Package Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: nuget-package | |
path: | | |
**/*.nupkg | |
**/*.snupkg | |
- name: Build Documentation | |
run: | | |
dotnet build --configuration Release --no-restore Documentation | |
- name: Upload GitHub Pages as artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: Documentation/_site/ | |
- name: Convert test results | |
if: ${{ !cancelled() }} | |
run: | | |
find . -name "*.trx" -exec dotnet tool run trx2junit --output TestResults/JUnit {} + | |
- name: Upload test results to Codecov | |
if: ${{ !cancelled() }} | |
uses: codecov/test-results-action@v1 | |
with: | |
fail_ci_if_error: true | |
files: TestResults/JUnit/*.xml | |
token: ${{ secrets.CODECOV_TOKEN }} | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v5 | |
with: | |
fail_ci_if_error: true | |
token: ${{ secrets.CODECOV_TOKEN }} | |
deploy: | |
needs: build | |
if: ${{ always() && github.event_name == 'push' && needs.build.result == 'success' }} | |
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment | |
permissions: | |
pages: write # to deploy to Pages | |
id-token: write # to verify the deployment originates from an appropriate source | |
# Deploy to the github-pages environment | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
# Specify runner + deployment step | |
runs-on: ubuntu-latest | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |