From ad8dd0868e936fe71b89312c7e1251cde47a9fdd Mon Sep 17 00:00:00 2001 From: Sean Killeen Date: Tue, 7 Jan 2025 08:23:16 -0500 Subject: [PATCH] Update .NET in build runner to 9.x; node to v22 (#1008) * Update .NET version to 8.x * On second thought, make it 9.x * and node 22 while we're at it. --- .github/workflows/build-process.yml | 286 ++++++++++++++-------------- 1 file changed, 143 insertions(+), 143 deletions(-) diff --git a/.github/workflows/build-process.yml b/.github/workflows/build-process.yml index 5579a6b34..7e2053133 100644 --- a/.github/workflows/build-process.yml +++ b/.github/workflows/build-process.yml @@ -1,143 +1,143 @@ -name: NUnit Documentation Build Process - -on: - push: - branches: - - master - pull_request: - branches: - - master - -env: - NUNIT_VERSION_FOR_API_DOCS: "4.3.2" - -jobs: - linting: - name: "Markdown linting" - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - name: Check out the code - - uses: actions/setup-node@v4 - name: Setup node - with: - node-version: "18" - - run: npm install -g markdownlint-cli2 - name: Install markdownlint-cli2 - - run: markdownlint-cli2 --config ".github/linters/.markdownlint.yml" "docs/**/*.md" - name: run Markdownlint - spellcheck: - name: "Spell check" - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - name: Check out the code - - uses: actions/setup-node@v4 - name: Setup node - with: - node-version: "18" - - run: npm install -g cspell - name: Install cSpell - - run: cspell --config ./cSpell.json "docs/**/*.md" --no-progress - name: run cSpell - build: - name: "Build the site with docfx" - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - name: Check out the code - - name: Get latest NUnit Asset dir - uses: dsaltares/fetch-gh-release-asset@master - with: - repo: 'nunit/nunit' - version: 'tags/${{ env.NUNIT_VERSION_FOR_API_DOCS }}' - file: 'NUnit.Framework-${{ env.NUNIT_VERSION_FOR_API_DOCS }}.zip' - token: ${{ secrets.GITHUB_TOKEN }} - - name: Unzip NUnit Asset zip file into its own directory - run: unzip NUnit.Framework-${{ env.NUNIT_VERSION_FOR_API_DOCS }}.zip -d ./NUnit.Framework-${{ env.NUNIT_VERSION_FOR_API_DOCS }} - - name: Copy NUnit Asset dir - run: mkdir ./code-output && cp -r ./NUnit.Framework-${{ env.NUNIT_VERSION_FOR_API_DOCS }}/bin/net6.0/* ./code-output - - uses: "nunit/docfx-action@v3.4.2" - name: Build with Docfx - with: - args: docs/docfx.json --warningsAsErrors true - - name: zip site contents - run: zip -r _site.zip docs/_site/ - - name: Archive site artifacts - uses: actions/upload-artifact@v4 - with: - name: siteArtifact - path: _site.zip - - name: Start deployment (PR only) - if: ${{ github.ref != 'refs/heads/master'}} - uses: bobheadxi/deployments@v1 - id: deployment - with: - env: preview_${{github.event.number}} - step: start - token: ${{ secrets.SEAN_PAT_TO_MANAGE_ENVIRONMENTS }} - - name: Deploy to Netlify (PR only) - if: ${{ github.ref != 'refs/heads/master'}} - uses: South-Paw/action-netlify-cli@v2 - id: netlify - with: - # note that the --json flag has been passed so we can parse outputs - args: deploy --json --dir './docs/_site' --message 'preview [${{ github.sha }}]' - env: - NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} - NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} - - name: Update Preview link comment - if: ${{ github.ref != 'refs/heads/master'}} - uses: marocchino/sticky-pull-request-comment@v2 - with: - header: previewlink - message: | - Preview link: ${{ fromJson(steps.netlify.outputs.NETLIFY_OUTPUT).deploy_url }} - - name: Finish deployment - uses: bobheadxi/deployments@v1 - if: ${{ github.ref != 'refs/heads/master'}} - with: - env: ${{ steps.deployment.outputs.env }} - step: finish - status: ${{ job.status }} - deployment_id: ${{ steps.deployment.outputs.deployment_id }} - env_url: ${{ fromJson(steps.netlify.outputs.NETLIFY_OUTPUT).deploy_url }} - token: ${{ secrets.SEAN_PAT_TO_MANAGE_ENVIRONMENTS }} - snippets: - name: "Build/Test Snippets" - runs-on: ubuntu-latest - env: - SOLUTION_LOCATION: "./docs/snippets/Snippets.sln" - steps: - - name: Check out the code - uses: actions/checkout@v4 - - name: Setup .NET - uses: actions/setup-dotnet@v4 - with: - dotnet-version: 6.x - - name: Restore dependencies - run: dotnet restore $SOLUTION_LOCATION - - name: Build - run: dotnet build --no-restore $SOLUTION_LOCATION - - name: Test - run: dotnet test --no-build --verbosity normal $SOLUTION_LOCATION - publish: - name: Publish (master branch only) - needs: [linting, spellcheck, build] - runs-on: ubuntu-latest - if: ${{ github.ref == 'refs/heads/master'}} - steps: - - name: Download site artifacts - uses: actions/download-artifact@v4 - with: - name: siteArtifact - - name: unzip site contents - run: unzip _site.zip - - name: Push to gh-pages branch (master only) - if: ${{ github.ref == 'refs/heads/master'}} - uses: peaceiris/actions-gh-pages@v4 - with: - commit_message: ${{ github.event.head_commit.message }} - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./docs/_site - publish_branch: gh-pages +name: NUnit Documentation Build Process + +on: + push: + branches: + - master + pull_request: + branches: + - master + +env: + NUNIT_VERSION_FOR_API_DOCS: "4.3.2" + +jobs: + linting: + name: "Markdown linting" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + name: Check out the code + - uses: actions/setup-node@v4 + name: Setup node + with: + node-version: "18" + - run: npm install -g markdownlint-cli2 + name: Install markdownlint-cli2 + - run: markdownlint-cli2 --config ".github/linters/.markdownlint.yml" "docs/**/*.md" + name: run Markdownlint + spellcheck: + name: "Spell check" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + name: Check out the code + - uses: actions/setup-node@v4 + name: Setup node + with: + node-version: "22" + - run: npm install -g cspell + name: Install cSpell + - run: cspell --config ./cSpell.json "docs/**/*.md" --no-progress + name: run cSpell + build: + name: "Build the site with docfx" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + name: Check out the code + - name: Get latest NUnit Asset dir + uses: dsaltares/fetch-gh-release-asset@master + with: + repo: 'nunit/nunit' + version: 'tags/${{ env.NUNIT_VERSION_FOR_API_DOCS }}' + file: 'NUnit.Framework-${{ env.NUNIT_VERSION_FOR_API_DOCS }}.zip' + token: ${{ secrets.GITHUB_TOKEN }} + - name: Unzip NUnit Asset zip file into its own directory + run: unzip NUnit.Framework-${{ env.NUNIT_VERSION_FOR_API_DOCS }}.zip -d ./NUnit.Framework-${{ env.NUNIT_VERSION_FOR_API_DOCS }} + - name: Copy NUnit Asset dir + run: mkdir ./code-output && cp -r ./NUnit.Framework-${{ env.NUNIT_VERSION_FOR_API_DOCS }}/bin/net6.0/* ./code-output + - uses: "nunit/docfx-action@v3.4.2" + name: Build with Docfx + with: + args: docs/docfx.json --warningsAsErrors true + - name: zip site contents + run: zip -r _site.zip docs/_site/ + - name: Archive site artifacts + uses: actions/upload-artifact@v4 + with: + name: siteArtifact + path: _site.zip + - name: Start deployment (PR only) + if: ${{ github.ref != 'refs/heads/master'}} + uses: bobheadxi/deployments@v1 + id: deployment + with: + env: preview_${{github.event.number}} + step: start + token: ${{ secrets.SEAN_PAT_TO_MANAGE_ENVIRONMENTS }} + - name: Deploy to Netlify (PR only) + if: ${{ github.ref != 'refs/heads/master'}} + uses: South-Paw/action-netlify-cli@v2 + id: netlify + with: + # note that the --json flag has been passed so we can parse outputs + args: deploy --json --dir './docs/_site' --message 'preview [${{ github.sha }}]' + env: + NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} + NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} + - name: Update Preview link comment + if: ${{ github.ref != 'refs/heads/master'}} + uses: marocchino/sticky-pull-request-comment@v2 + with: + header: previewlink + message: | + Preview link: ${{ fromJson(steps.netlify.outputs.NETLIFY_OUTPUT).deploy_url }} + - name: Finish deployment + uses: bobheadxi/deployments@v1 + if: ${{ github.ref != 'refs/heads/master'}} + with: + env: ${{ steps.deployment.outputs.env }} + step: finish + status: ${{ job.status }} + deployment_id: ${{ steps.deployment.outputs.deployment_id }} + env_url: ${{ fromJson(steps.netlify.outputs.NETLIFY_OUTPUT).deploy_url }} + token: ${{ secrets.SEAN_PAT_TO_MANAGE_ENVIRONMENTS }} + snippets: + name: "Build/Test Snippets" + runs-on: ubuntu-latest + env: + SOLUTION_LOCATION: "./docs/snippets/Snippets.sln" + steps: + - name: Check out the code + uses: actions/checkout@v4 + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 9.x + - name: Restore dependencies + run: dotnet restore $SOLUTION_LOCATION + - name: Build + run: dotnet build --no-restore $SOLUTION_LOCATION + - name: Test + run: dotnet test --no-build --verbosity normal $SOLUTION_LOCATION + publish: + name: Publish (master branch only) + needs: [linting, spellcheck, build] + runs-on: ubuntu-latest + if: ${{ github.ref == 'refs/heads/master'}} + steps: + - name: Download site artifacts + uses: actions/download-artifact@v4 + with: + name: siteArtifact + - name: unzip site contents + run: unzip _site.zip + - name: Push to gh-pages branch (master only) + if: ${{ github.ref == 'refs/heads/master'}} + uses: peaceiris/actions-gh-pages@v4 + with: + commit_message: ${{ github.event.head_commit.message }} + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./docs/_site + publish_branch: gh-pages