Update codeql-analysis.yml (#583) #540
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: .NET Core CI/CD | |
on: | |
push: | |
branches: | |
- master | |
tags: | |
- v* | |
paths: | |
- '**' | |
- '!**.md' | |
pull_request: | |
paths: | |
- '**' | |
- '!**.md' | |
jobs: | |
build: | |
name: Build & Test | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ ubuntu-latest, windows-latest, macos-latest ] | |
configuration: [ Debug, Release ] | |
include: | |
- os: ubuntu-latest | |
configuration: Release | |
is-main: true | |
- os: windows-latest | |
configuration: Release | |
is-netfx: true | |
env: | |
DOTNET_CLI_TELEMETRY_OPTOUT: 1 | |
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 | |
NUGET_XMLDOC_MODE: skip | |
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages | |
# COMPlus_EnableAVX: 0 | |
# COMPlus_EnableSSE: 0 | |
DYLD_FALLBACK_LIBRARY_PATH: /usr/local/Cellar/[email protected]/ | |
steps: | |
- uses: actions/checkout@v2 | |
# - name: Setup OpenSSL (macOS) | |
# if: matrix.os == 'macos-latest' | |
# run: | | |
# wget https://www.openssl.org/source/openssl-1.1.1c.tar.gz | |
# tar -xzvf openssl-1.1.1c.tar.gz | |
# cd openssl-1.1.1c | |
# ./config | |
# make | |
# sudo make install | |
- name: setup dotnet '2.2.x' | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: '2.2.x' | |
- name: Setup dotnet '3.1.x' | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: '3.1.x' | |
- name: Setup dotnet '5.x' | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: '5.0.x' | |
- name: Restore dependencies | |
run: dotnet restore | |
- name: Build | |
run: dotnet build -c ${{ matrix.configuration }} --no-restore | |
- name: Test | |
# disable macOS tests | |
if: matrix.os != 'macos-latest' | |
run: dotnet test -c ${{ matrix.configuration }} --no-build --collect:"XPlat Code Coverage" --settings coverlet.runsettings | |
- name: Upload coverage to Codecov | |
if: matrix.is-netfx | |
uses: codecov/codecov-action@v1 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
- name: Creates NuGet packages | |
if: matrix.is-main | |
run: dotnet pack -c ${{ matrix.configuration }} --output=nuget_packed --no-build | |
- name: Upload NuGet packages to Artifacts | |
if: matrix.is-main | |
uses: actions/upload-artifact@v2 | |
with: | |
name: nuget-packages | |
path: | | |
nuget_packed/*.nupkg | |
nuget_packed/*.snupkg | |
publish: | |
name: Publish packages | |
if: contains(github.ref, 'tags/v') | |
needs: [build] | |
runs-on: ubuntu-latest | |
env: | |
DOTNET_CLI_TELEMETRY_OPTOUT: 1 | |
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 | |
NUGET_XMLDOC_MODE: skip | |
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages | |
steps: | |
- name: Download generated NuGet packages | |
uses: actions/download-artifact@v2 | |
with: | |
name: nuget-packages | |
- name: Push packages to api.nuget.org | |
run: dotnet nuget push **/*.nupkg --api-key=${{ secrets.NUGET_APIKEY }} --source=https://api.nuget.org/v3/index.json --skip-duplicate |