-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
77 additions
and
90 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,85 +1,85 @@ | ||
name: Build .NET | ||
on: | ||
workflow_call: | ||
inputs: | ||
os_matrix: | ||
description: 'A JSON string array of OS matrix to build against' | ||
default: "[\"macos-latest\", \"ubuntu-latest\", \"windows-latest\"]" | ||
required: false | ||
type: string | ||
workflow_call: | ||
inputs: | ||
os_matrix: | ||
description: "A JSON string array of OS matrix to build against" | ||
default: '["macos-latest", "ubuntu-latest", "windows-latest"]' | ||
required: false | ||
type: string | ||
|
||
jobs: | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: ${{fromJson(inputs.os_matrix)}} | ||
env: | ||
# https://www.donovanbrown.com/post/Stop-wasting-time-during-NET-Core-builds | ||
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: '1' | ||
DOTNET_NOLOGO: '1' | ||
DOTNET_CLI_TELEMETRY_OPTOUT: '1' | ||
# See more here: https://docs.microsoft.com/en-us/dotnet/core/dependency-loading/default-probing#how-do-i-debug-the-probing-properties-construction. | ||
COREHOST_TRACE: '0' | ||
# See more here: https://docs.microsoft.com/en-us/nuget/reference/cli-reference/cli-ref-environment-variables. | ||
NUGET_XMLDOC_MODE: 'skip' | ||
DOTNET_MULTILEVEL_LOOKUP: 0 | ||
CI_BUILD: 'true' | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: Install .NET | ||
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' | ||
run: | | ||
./eng/install-sdk.sh | ||
echo "DOTNET_ROOT=$GITHUB_WORKSPACE/eng/.dotnet" >> $GITHUB_ENV | ||
echo "$GITHUB_WORKSPACE/eng/.dotnet" >> $GITHUB_PATH | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: ${{fromJson(inputs.os_matrix)}} | ||
env: | ||
# https://www.donovanbrown.com/post/Stop-wasting-time-during-NET-Core-builds | ||
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: "1" | ||
DOTNET_NOLOGO: "1" | ||
DOTNET_CLI_TELEMETRY_OPTOUT: "1" | ||
# See more here: https://docs.microsoft.com/en-us/dotnet/core/dependency-loading/default-probing#how-do-i-debug-the-probing-properties-construction. | ||
COREHOST_TRACE: "0" | ||
# See more here: https://docs.microsoft.com/en-us/nuget/reference/cli-reference/cli-ref-environment-variables. | ||
NUGET_XMLDOC_MODE: "skip" | ||
DOTNET_MULTILEVEL_LOOKUP: 0 | ||
CI_BUILD: "true" | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: Install .NET | ||
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' | ||
run: | | ||
./eng/install-sdk.sh | ||
echo "DOTNET_ROOT=$GITHUB_WORKSPACE/eng/.dotnet" >> $GITHUB_ENV | ||
echo "$GITHUB_WORKSPACE/eng/.dotnet" >> $GITHUB_PATH | ||
- name: Install .NET | ||
if: matrix.os == 'windows-latest' | ||
run: | | ||
./eng/install-sdk.ps1 | ||
echo "DOTNET_ROOT=$Env:GITHUB_WORKSPACE/eng/.dotnet" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append | ||
echo "$Env:GITHUB_WORKSPACE/eng/.dotnet" | Out-File -FilePath $Env:GITHUB_PATH -Encoding utf-8 -Append | ||
- name: Install .NET | ||
if: matrix.os == 'windows-latest' | ||
run: | | ||
./eng/install-sdk.ps1 | ||
echo "DOTNET_ROOT=$Env:GITHUB_WORKSPACE/eng/.dotnet" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append | ||
echo "$Env:GITHUB_WORKSPACE/eng/.dotnet" | Out-File -FilePath $Env:GITHUB_PATH -Encoding utf-8 -Append | ||
- name: Print host info | ||
run: printenv && dotnet --info | ||
- name: Print host info | ||
run: printenv && dotnet --info | ||
|
||
- name: Restore dependencies | ||
run: dotnet restore | ||
- name: Restore dependencies | ||
run: dotnet restore | ||
|
||
- name: Build | ||
run: dotnet build --no-restore --no-incremental /WarnAsError | ||
- name: Build | ||
run: dotnet build --no-restore --no-incremental /WarnAsError | ||
|
||
- name: Test | ||
run: dotnet test --no-build | ||
- name: Test | ||
run: dotnet test --no-build | ||
|
||
- name: Run Tool PowerShell | ||
if: matrix.os == 'windows-latest' | ||
shell: pwsh | ||
run: ./src/dotnet-affected/bin/Debug/net6.0/dotnet-affected -p $Env:GITHUB_WORKSPACE --assume-changes dotnet-affected -v | ||
- name: Run Tool PowerShell | ||
if: matrix.os == 'windows-latest' | ||
shell: pwsh | ||
run: ./src/dotnet-affected/bin/Debug/net9.0/dotnet-affected -p $Env:GITHUB_WORKSPACE --assume-changes dotnet-affected -v | ||
|
||
- name: Run Tool Bash | ||
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' | ||
shell: bash | ||
run: ./src/dotnet-affected/bin/Debug/net6.0/dotnet-affected -p $GITHUB_WORKSPACE --assume-changes dotnet-affected -v | ||
- name: Run Tool Bash | ||
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' | ||
shell: bash | ||
run: ./src/dotnet-affected/bin/Debug/net9.0/dotnet-affected -p $GITHUB_WORKSPACE --assume-changes dotnet-affected -v | ||
|
||
- name: Pack | ||
if: success() && matrix.os == 'ubuntu-latest' | ||
run: dotnet pack --no-restore --no-build --configuration Debug --include-symbols -p:SymbolPackageFormat=snupkg -o $GITHUB_WORKSPACE/packages | ||
- name: Pack | ||
if: success() && matrix.os == 'ubuntu-latest' | ||
run: dotnet pack --no-restore --no-build --configuration Debug --include-symbols -p:SymbolPackageFormat=snupkg -o $GITHUB_WORKSPACE/packages | ||
|
||
- uses: actions/upload-artifact@v3 | ||
name: 'Upload Packages' | ||
if: success() && matrix.os == 'ubuntu-latest' | ||
with: | ||
name: packages | ||
path: ${{ github.workspace }}/packages/**/* | ||
- uses: actions/upload-artifact@v3 | ||
name: "Upload Packages" | ||
if: success() && matrix.os == 'ubuntu-latest' | ||
with: | ||
name: packages | ||
path: ${{ github.workspace }}/packages/**/* | ||
|
||
- uses: actions/upload-artifact@v3 | ||
name: 'Upload Artifacts' | ||
if: success() && matrix.os == 'ubuntu-latest' | ||
with: | ||
name: artifacts | ||
path: src/dotnet-affected/bin/Debug/net8.0/ | ||
- uses: actions/upload-artifact@v3 | ||
name: "Upload Artifacts" | ||
if: success() && matrix.os == 'ubuntu-latest' | ||
with: | ||
name: artifacts | ||
path: src/dotnet-affected/bin/Debug/net9.0/ |
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
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
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
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