Skip to content

Commit

Permalink
Finish updating snippets yml (#1778)
Browse files Browse the repository at this point in the history
* Update snippets5000.yml

* Update snippets5000.yml
  • Loading branch information
adegeo authored Feb 13, 2024
1 parent dfc2f0c commit 100365e
Showing 1 changed file with 12 additions and 25 deletions.
37 changes: 12 additions & 25 deletions .github/workflows/snippets5000.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# 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
Expand All @@ -15,33 +14,29 @@ on:
default: 'Manual run'

env:
DOTNET_INSTALLER_CHANNEL: '8.0'
DOTNET_DO_INSTALL: 'false' # True to install preview versions, False to use the pre-installed (released) SDK
DOTNET_VERSION: '9.0.*'
DOTNET_QUALITY: 'preview'
DOTNET_DO_INSTALL: 'true' # To install a version of .NET not provided by the runner, set to true
EnableNuGetPackageRestore: 'True'
repo: 'docs-desktop'

# 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 "snippets-build"
snippets-build:
# The type of runner that the job will run on
runs-on: windows-2022
permissions:
statuses: write

# 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@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 #@v3.1.0
# Checkout the repository for the PR
- name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #@v4.1.1

# Get the latest preview SDK (or sdk not installed by the runner)
- name: Setup .NET SDK
- name: Setup .NET
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 }}" -Quality preview
uses: actions/setup-dotnet@4d6c8fcf3c8f7a60068d26b594648e99df24cee3 #@4.0.0
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
dotnet-quality: ${{ env.DOTNET_QUALITY }}

# Print dotnet info
- name: Display .NET info
Expand All @@ -51,19 +46,11 @@ jobs:
# Clone docs tools repo
- name: Clone docs-tools repository
run: |
git clone --depth 1 --single-branch --branch adegeo-snippets https://github.com/dotnet/docs-tools
git clone --depth 1 https://github.com/dotnet/docs-tools
# Run snippets 5000
- name: Run snippets 5000 for PR
env:
GitHubKey: ${{ secrets.GITHUB_TOKEN }}
run: |
dotnet run --project docs-tools/snippets5000/Snippets5000/Snippets5000.csproj -- --sourcepath "${{ github.workspace }}" --pullrequest ${{ github.event.number }} --owner ${{ github.repository_owner }} --repo ${{ github.event.repository.name }}
# Update build output json file
- name: Upload build results
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce #@v3.1.2
with:
name: build
path: ./output.json

0 comments on commit 100365e

Please sign in to comment.