Skip to content

Fixes to publish (#221) #665

Fixes to publish (#221)

Fixes to publish (#221) #665

Workflow file for this run

name: Build for multiple SDK versions
on:
push:
branches:
- main
pull_request:
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
dotnet-version: ["", "8.0.x", "9.0.x"]
# these entries will mesh with the above combinations
include:
# just use what's in the repo
- global-json-file: "global.json"
dotnet-version: ""
label: "repo global.json"
build_net9: false
globaljson-command: "dotnet new globaljson --sdk-version 8.0.400"
# latest 8.0 stable
- global-json-file: "global.json"
dotnet-version: "8.0.x"
label: "8.0 stable"
build_net9: false
globaljson-command: "dotnet new globaljson --sdk-version 8.0.0 --roll-forward latestMinor"
# latest 9.0 stable
- global-json-file: "global.json"
dotnet-version: "9.0.x"
label: "9.0 stable"
build_net9: true
globaljson-command: "dotnet new globaljson --sdk-version 9.0.0 --roll-forward latestMinor"
fail-fast: false # we have timing issues on some OS, so we want them all to run
runs-on: ${{ matrix.os }}
timeout-minutes: 15
name: Build on ${{matrix.os}} for ${{ matrix.label }}
steps:
- uses: actions/checkout@v3
# setup .NET per the repo global.json
- name: Setup .NET
uses: actions/setup-dotnet@v4
# setup .NET per test session
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
global-json-file: ${{ matrix.global-json-file }}
dotnet-version: ${{ matrix.dotnet-version }}
# remove global.json, create new one to protect against CI machine installed defaults. Then the env configuration takes precedence
- name: Purge global.json
run: |
rm global.json
${{ matrix.globaljson-command }}
# let's make sure we're on the version we think we are.
- name: Announce .NET version
run: dotnet --info
- name: Restore tools
run: dotnet tool restore
- name: Run build and test
run: dotnet run --project build
env:
BuildNet9: ${{ matrix.build_net9 }}
- name: Archive test results
uses: actions/upload-artifact@v3
with:
name: test-results
path: test/**/TestResults/*.trx