opentelemetry-dotnet/.github/workflows/dotnet-core.yml

56 lines
1.4 KiB
YAML

name: .NET
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build-test-pack:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, ubuntu-latest]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # fetching all
- name: Setup .NET Core 2.1
if: ${{ matrix.os == 'ubuntu-latest' }}
uses: actions/setup-dotnet@v1
with:
dotnet-version: 2.1.807
- name: Setup .NET Core 3.1
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.301
# For linux, we have to apply a workaround to enable both dotnet versions at same time
- name: .net SxS
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
rsync -a ${DOTNET_ROOT/3.1.301/2.1.807}/* $DOTNET_ROOT/
- name: Install dependencies
run: dotnet restore
- name: dotnet build
run: dotnet build --configuration Release --no-restore -p:Deterministic=true
- name: dotnet test
run: dotnet test -p:CollectCoverage=false --configuration Release --no-build --logger:"console;verbosity=detailed"
- name: dotnet pack
run: dotnet pack OpenTelemetry.proj --configuration Release --no-build
- name: Publish Artifacts
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.os }}-packages
path: '**/bin/**/*.*nupkg'