Skip to content

🏭 Build

🏭 Build #1096

Workflow file for this run

name: 🏭 Build
on:
push:
branches:
- main
- 'v*.*'
- validate/*
pull_request:
merge_group:
workflow_dispatch:
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
BUILDCONFIGURATION: Release
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages/
permissions:
contents: read
jobs:
build:
name: 🏭 Build
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-24.04
rid: linux
- os: macOS-15
rid: osx
- os: windows-2025
rid: win
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0 # avoid shallow clone so nbgv can do its work.
submodules: true
- name: ⚙ Install prerequisites
run: |
./init.ps1 -UpgradePrerequisites -NoNuGetCredProvider
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: tools/variables/_define.ps1
shell: pwsh
- name: 🛠 dotnet 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: 🧪 dotnet test
run: tools/dotnet-test-cloud.ps1 -Configuration ${{ env.BUILDCONFIGURATION }} -Agent ${{ runner.os }}
shell: pwsh
- name: 🧪 NativeAOT test
run: dotnet publish -c Release -r ${{ matrix.rid }}-x64 -warnaserror
working-directory: test/NativeAOTCompatibility
- name: ⚙️ Use Node.js 24.x
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7
with:
node-version: 24.x
- name: ⚙️ Setup pnpm
run: |
corepack enable
corepack prepare pnpm@11.12.0 --activate
pnpm --version
- name: ⚙️ pnpm install
run: corepack pnpm install --frozen-lockfile --fetch-retries=5 --fetch-timeout=120000
working-directory: src/nerdbank-streams
- name: 🛠️ pnpm build
run: corepack pnpm build
working-directory: src/nerdbank-streams
- name: 🧪 pnpm test
run: corepack pnpm test
working-directory: src/nerdbank-streams
- name: 🧪 pnpm lint
run: corepack pnpm lint
working-directory: src/nerdbank-streams
- name: 🦀 Install Rust 1.85.0
uses: dtolnay/rust-toolchain@1.85.0
with:
components: rustfmt, clippy
- name: 🦀 cargo build
run: cargo build --locked
working-directory: src/nerdbank-streams-rs
- name: 🦀 cargo test
run: cargo test --locked
working-directory: src/nerdbank-streams-rs
- name: 🦀 Verify Rust formatting
run: cargo fmt --check
working-directory: src/nerdbank-streams-rs
- name: 🦀 cargo clippy
run: cargo clippy --locked --all-targets -- -D warnings
working-directory: src/nerdbank-streams-rs
- name: 🦀 Package crate
run: tools/Pack-Cargo.ps1
shell: pwsh
if: runner.os == 'Linux'
- 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: tools/variables/_define.ps1
shell: pwsh
- name: 📢 Publish artifacts
uses: ./.github/actions/publish-artifacts
if: cancelled() == false
- name: 📢 Publish code coverage results to codecov.io
run: |
if ('${{ secrets.CODECOV_TOKEN }}') {
./tools/publish-CodeCov.ps1 -CodeCovToken '${{ secrets.CODECOV_TOKEN }}' -PathToCodeCoverage "${{ runner.temp }}/_artifacts/coverageResults" -Name "${{ runner.os }} Coverage Results" -Flags "${{ runner.os }}"
}
shell: pwsh
timeout-minutes: 3
continue-on-error: true
docs:
name: 📃 Docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: 🔗 Markup Link Checker (mlc)
uses: becheran/mlc@7ec24825cefe0c9c8c6bac48430e1f69e3ec356e # v1.2.0
with:
args: --do-not-warn-for-redirect-to https://learn.microsoft.com*,https://dotnet.microsoft.com/*,https://dev.azure.com/*,https://app.codecov.io/*,https://dotnetfoundation.org/*,https://docs.github.com/* -i https://www.npmjs.com/package/*,https://get.dot.net/ -p docfx,ext