mirror of
https://github.com/Stone-Red-Code/docs-desktop.git
synced 2026-09-04 09:06:04 +02:00
See dotnet/docs#27056 for details. In order for an action to be required for PRs to be merged, required actions must be triggered. If filters prevent them from starting, the action stays in the "pending" state forever.
66 lines
2.5 KiB
YAML
66 lines
2.5 KiB
YAML
# This is a basic workflow to help you get started with Actions
|
|
name: 'Snippets 5000'
|
|
|
|
# Controls when the action will run. Triggers the workflow on push or pull request
|
|
on:
|
|
pull_request_target:
|
|
paths:
|
|
branches: '*'
|
|
types: [opened, synchronize, reopened]
|
|
|
|
env:
|
|
DOTNET_INSTALLER_CHANNEL: '6.0'
|
|
DOTNET_DO_INSTALL: 'true'
|
|
EnableNuGetPackageRestore: 'True'
|
|
|
|
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
|
|
jobs:
|
|
# This workflow contains a single job called "build snippets"
|
|
build-snippets:
|
|
# The type of runner that the job will run on
|
|
runs-on: windows-latest
|
|
|
|
# Steps represent a sequence of tasks that will be executed as part of the job
|
|
steps:
|
|
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
|
|
- uses: actions/checkout@a81bbbf8298c0fa03ea29cdc473d45769f953675 #@v2
|
|
|
|
# Get the latest preview SDK (or sdk not installed by the runner)
|
|
- name: Setup .NET SDK
|
|
if: ${{ env.DOTNET_DO_INSTALL == 'true' }}
|
|
run: |
|
|
echo "Downloading dotnet-install.ps1"
|
|
Invoke-WebRequest https://raw.githubusercontent.com/dotnet/install-scripts/master/src/dotnet-install.ps1 -OutFile dotnet-install.ps1
|
|
echo "Installing dotnet version ${{ env.DOTNET_INSTALLER_CHANNEL }}"
|
|
.\dotnet-install.ps1 -InstallDir "c:\program files\dotnet" -Channel "${{ env.DOTNET_INSTALLER_CHANNEL }}"
|
|
|
|
# Print dotnet info
|
|
- name: Display .NET info
|
|
run: |
|
|
dotnet --info
|
|
|
|
# Install locate projs global tool
|
|
- name: Install LocateProjects tool
|
|
run: |
|
|
dotnet tool install --global --add-source ./.github/workflows/dependencies/ DotnetDocsTools.LocateProjects
|
|
|
|
# Run locate projs tool
|
|
- name: Locate projects for PR
|
|
env:
|
|
GitHubKey: ${{ secrets.GITHUB_TOKEN }}
|
|
LocateExts: ".cs;.vb;.fs;.cpp;.h;.xaml;.razor;.cshtml;.vbhtml;.csproj;.fsproj;.vbproj;.vcxproj;.sln"
|
|
run: |
|
|
./.github/workflows/dependencies/Get-MSBuildResults.ps1 "${{ github.workspace }}" -PullRequest ${{ github.event.number }} -RepoOwner ${{ github.repository_owner }} -RepoName ${{ github.event.repository.name }}
|
|
|
|
# Update build output json file
|
|
- name: Upload build results
|
|
uses: actions/upload-artifact@3446296876d12d4e3a0f3145a3c87e67bf0a16b5 #@v1
|
|
with:
|
|
name: build
|
|
path: ./output.json
|
|
|
|
# Return status based on json file
|
|
- name: Report status
|
|
run: |
|
|
./.github/workflows/dependencies/Out-GithubActionStatus.ps1
|