Merge pull request #22 from SpartaDeveloper93/main #243
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: 'Build and Test' | |
on: | |
push: | |
pull_request: | |
branches: [ main ] | |
release: | |
types: | |
- published | |
env: | |
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true | |
DOTNET_CLI_TELEMETRY_OPTOUT: true | |
# Project name to pack and publish | |
PROJECT_NAME: GeoJSON.Text | |
jobs: | |
build: | |
name: 'Build and Test' | |
runs-on: windows-2019 | |
env: | |
VSTEST_CONNECTION_TIMEOUT: 900 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup .NET Core | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: | | |
3.1.x | |
5.0.x | |
6.0.x | |
7.0.x | |
- name: Install dependencies | |
run: dotnet restore src/${{ env.PROJECT_NAME }}.sln | |
- name: Build solution | |
run: dotnet build src/${{ env.PROJECT_NAME }}.sln -c Release --no-restore | |
- name: Test | |
run: dotnet test src/${{ env.PROJECT_NAME }}.sln -c Release --no-build /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:CoverletOutput=../coverage/ | |
- uses: codecov/codecov-action@v2 | |
if: github.ref == 'refs/heads/main' | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
directory: src/coverage | |
flags: unittests | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: nupkg | |
path: src/${{ env.PROJECT_NAME }}/bin/Release/*.nupkg |