From f4be35f3cf6aa3234a1aa3b33d94b18c0b8bbb99 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Wed, 27 Nov 2024 11:41:37 -0700 Subject: [PATCH 1/2] Activate GitHub build action --- .github/workflows/build.yml | 142 ++++++++++++++++++++++++++++++++++++ azure-pipelines.yml | 2 +- 2 files changed, 143 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..5e56b79 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,142 @@ +name: CI + +on: + push: + branches: + - main + - validate/* + tags: + - v*.* + pull_request: + +env: + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true + BUILDCONFIGURATION: Release + codecov_token: 4dc9e7e2-6b01-4932-a180-847b52b43d35 + NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages/ + +jobs: + build: + + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: + - ubuntu-22.04 + - macos-14 + - windows-2022 + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 # avoid shallow clone so nbgv can do its work. + - name: โš™ Install prerequisites + run: | + ./init.ps1 -UpgradePrerequisites + dotnet --info + + # Print mono version if it is present. + if (Get-Command mono -ErrorAction SilentlyContinue) { + mono --version + } + shell: pwsh + - name: โš™๏ธ Set pipeline variables based on source + run: azure-pipelines/variables/_pipelines.ps1 + shell: pwsh + - name: ๐Ÿ›  build + run: dotnet build -t:build,pack --no-restore -c ${{ env.BUILDCONFIGURATION }} -warnAsError -warnNotAsError:NU1901,NU1902,NU1903,NU1904 /bl:"${{ runner.temp }}/_artifacts/build_logs/build.binlog" + - name: ๐Ÿงช test + run: azure-pipelines/dotnet-test-cloud.ps1 -Configuration ${{ env.BUILDCONFIGURATION }} -Agent ${{ runner.os }} + shell: pwsh + - name: ๐Ÿ’…๐Ÿป Verify formatted code + run: dotnet format --verify-no-changes --no-restore + shell: pwsh + if: runner.os == 'Linux' + - name: ๐Ÿ“š Verify docfx build + run: dotnet docfx docfx/docfx.json --warningsAsErrors --disableGitFeatures + if: runner.os == 'Linux' + - name: โš™ Update pipeline variables based on build outputs + run: azure-pipelines/variables/_pipelines.ps1 + shell: pwsh + - name: ๐Ÿ“ฅ Collect artifacts + run: azure-pipelines/artifacts/_stage_all.ps1 + shell: pwsh + if: always() + - name: ๐Ÿ“ข Upload project.assets.json files + if: always() + uses: actions/upload-artifact@v4 + with: + name: projectAssetsJson-${{ runner.os }} + path: ${{ runner.temp }}/_artifacts/projectAssetsJson + continue-on-error: true + - name: ๐Ÿ“ข Upload variables + uses: actions/upload-artifact@v4 + with: + name: variables-${{ runner.os }} + path: ${{ runner.temp }}/_artifacts/Variables + continue-on-error: true + - name: ๐Ÿ“ข Upload build_logs + if: always() + uses: actions/upload-artifact@v4 + with: + name: build_logs-${{ runner.os }} + path: ${{ runner.temp }}/_artifacts/build_logs + continue-on-error: true + - name: ๐Ÿ“ข Upload test_logs + if: always() + uses: actions/upload-artifact@v4 + with: + name: test_logs-${{ runner.os }} + path: ${{ runner.temp }}/_artifacts/test_logs + continue-on-error: true + - name: ๐Ÿ“ข Upload testResults + if: always() + uses: actions/upload-artifact@v4 + with: + name: testResults-${{ runner.os }} + path: ${{ runner.temp }}/_artifacts/testResults + continue-on-error: true + - name: ๐Ÿ“ข Upload coverageResults + if: always() + uses: actions/upload-artifact@v4 + with: + name: coverageResults-${{ runner.os }} + path: ${{ runner.temp }}/_artifacts/coverageResults + continue-on-error: true + - name: ๐Ÿ“ข Upload symbols + uses: actions/upload-artifact@v4 + with: + name: symbols-${{ runner.os }} + path: ${{ runner.temp }}/_artifacts/symbols + continue-on-error: true + - name: ๐Ÿ“ข Upload deployables + uses: actions/upload-artifact@v4 + with: + name: deployables-${{ runner.os }} + path: ${{ runner.temp }}/_artifacts/deployables + if: always() + - name: ๐Ÿ“ข Publish code coverage results to codecov.io + run: ./azure-pipelines/publish-CodeCov.ps1 -CodeCovToken "${{ env.codecov_token }}" -PathToCodeCoverage "${{ runner.temp }}/_artifacts/coverageResults" -Name "${{ runner.os }} Coverage Results" -Flags "${{ runner.os }}" + shell: pwsh + timeout-minutes: 3 + continue-on-error: true + if: env.codecov_token != '' + + ship: + if: startsWith(github.ref, 'refs/tags/v') + needs: build + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 1 + + - name: ๐Ÿ”ป Download deployables artifacts + uses: actions/download-artifact@v4 + with: + name: deployables-Linux + path: ${{ runner.temp }}/deployables + + - name: ๐Ÿš€ Push NuGet packages + run: dotnet nuget push ${{ runner.temp }}/deployables/*.nupkg --source https://api.nuget.org/v3/index.json -k '${{ secrets.NUGET_API_KEY }}' diff --git a/azure-pipelines.yml b/azure-pipelines.yml index a5e3cbb..f17cd3a 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -25,7 +25,7 @@ parameters: variables: DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true BuildConfiguration: Release - codecov_token: 4dc9e7e2-6b01-4932-a180-847b52b43d35 # Get a new one from https://codecov.io/ + codecov_token: 4dc9e7e2-6b01-4932-a180-847b52b43d35 ci_feed: https://pkgs.dev.azure.com/andrewarnott/OSS/_packaging/PublicCI/nuget/v3/index.json # Azure Artifacts feed URL NUGET_PACKAGES: $(Agent.TempDirectory)/.nuget/packages/ From 678eae3852bc4647f765be78b2eb413a7073f0bf Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Wed, 27 Nov 2024 11:44:25 -0700 Subject: [PATCH 2/2] Fix docfx build --- docfx/docfx.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docfx/docfx.json b/docfx/docfx.json index 729d673..1c94779 100644 --- a/docfx/docfx.json +++ b/docfx/docfx.json @@ -3,7 +3,7 @@ { "src": [ { - "src": "../src/Library", + "src": "../src/Xunit.SkippableFact", "files": [ "**/*.csproj" ] @@ -39,8 +39,8 @@ "modern" ], "globalMetadata": { - "_appName": "Library", - "_appTitle": "Library", + "_appName": "Xunit.SkippableFact", + "_appTitle": "Xunit.SkippableFact", "_enableSearch": true, "pdf": false }