Skip to content

Commit

Permalink
housekeeping: Update CI to do samples as well (#293)
Browse files Browse the repository at this point in the history
* housekeeping: Update CI to do samples as well

* Update sample name
  • Loading branch information
glennawatson committed Dec 14, 2020
1 parent e4844ea commit 1e665ca
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 5 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/build-samples.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Sample Build

on:
push:
branches: [ main ]
paths:
- 'Sample/**'
pull_request:
branches: [ main ]
paths:
- 'Sample/**'

jobs:
build-samples:
strategy:
matrix:
configuration: [Debug, Release]

runs-on: windows-latest

steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
lfs: true

# Install the .NET Core workload
- name: Install .NET Core 3.1.x
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.x

- name: Install .NET 5.0.x
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.x

# Add MSBuild to the PATH: https://github.com/microsoft/setup-msbuild
- name: Setup MSBuild.exe
uses: microsoft/setup-msbuild@v1.0.2

- name: Restore/Build the sample
run: msbuild SextantSample.sln /t:restore,build /maxcpucount /p:NoPackageAnalysis=true /verbosity:minimal /p:Configuration=$env:Configuration
working-directory: Sample
env:
Configuration: ${{ matrix.configuration }}
27 changes: 22 additions & 5 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,16 @@ name: Build
on:
push:
branches: [ main ]
paths:
- 'src/**'
- 'version.json'
pull_request:
types: [opened, synchronize, reopened, closed]
branches: [ main ]

paths:
- 'src/**'
- 'version.json'

env:
configuration: Release
productNamespacePrefix: "Sextant"
Expand All @@ -21,12 +27,25 @@ jobs:
uses: actions/checkout@v2
with:
fetch-depth: 0
lfs: true

- name: Install .NET Core
- name: Install .NET Core 3.1.x
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.x

- name: Install .NET 5.0.x
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.x

- name: Add MSBuild to PATH
uses: glennawatson/setup-msbuild@v1.0.3

- name: Update VS2019
shell: powershell
run: Start-Process -Wait -PassThru -FilePath "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installer.exe" -ArgumentList "update --passive --norestart --installpath ""C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise"""

- name: NBGV
id: nbgv
uses: dotnet/nbgv@master
Expand All @@ -36,9 +55,6 @@ jobs:
- name: NuGet Restore
run: dotnet restore
working-directory: src

- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v1

- name: Build
run: msbuild /t:build,pack /maxcpucount /p:NoPackageAnalysis=true /verbosity:minimal /p:Configuration=${{ env.configuration }}
Expand Down Expand Up @@ -120,3 +136,4 @@ jobs:
SOURCE_URL: https://api.nuget.org/v3/index.json
run: |
dotnet nuget push -s ${{ env.SOURCE_URL }} -k ${{ env.NUGET_AUTH_TOKEN }} **/*.nupkg

0 comments on commit 1e665ca

Please sign in to comment.