Merge pull request #5 from xo-energy/feature-ef-8.0 #23
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: CI | |
on: | |
pull_request: | |
types: [opened, synchronize] | |
push: | |
branches: | |
- 'main' | |
- 'release-*' | |
env: | |
DOTNET_CLI_TELEMETRY_OPTOUT: 1 | |
DOTNET_MULTILEVEL_LOOKUP: 1 | |
DOTNET_NOLOGO: 1 | |
NUGET_SOURCE: https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres:13 | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: password | |
ports: | |
- 5432:5432 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 # fetch full history for NBGV | |
- name: Set up dotnet | |
uses: actions/setup-dotnet@v3 | |
- name: Run dotnet restore | |
run: > | |
dotnet restore --locked-mode | |
-bl:"reports/dotnet-restore.binlog" | |
- name: Run dotnet build | |
run: > | |
dotnet build --no-restore | |
-bl:"reports/dotnet-build.binlog" | |
-c Release | |
- name: Run dotnet test | |
run: > | |
dotnet test --no-build | |
-bl:"reports/dotnet-test.binlog" | |
-c Release | |
--results-directory "reports" | |
--collect "XPlat Code Coverage" | |
--logger "GitHubActions" | |
--logger "trx;LogFilePrefix=${{ github.job }}" | |
- uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
- name: Run dotnet pack | |
run: > | |
dotnet pack --no-build | |
-bl:"reports/dotnet-pack.binlog" | |
-c Release | |
-o ${{ runner.temp }} | |
- name: Push packages to GitHub Packages | |
if: ${{ !startsWith(github.ref, 'refs/pull/') }} | |
run: > | |
dotnet nuget push ${{ runner.temp }}/*.nupkg | |
-k "${{ github.token }}" | |
-s "$NUGET_SOURCE" | |
--skip-duplicate | |
# publish release builds to nuget.org! | |
- name: Push packages to NuGet.org | |
if: startsWith(github.ref, 'refs/heads/release-') | |
run: > | |
dotnet nuget push ${{ runner.temp }}/*.nupkg | |
-k "${{ secrets.NUGET_API_KEY }}" | |
-s "https://api.nuget.org/v3/index.json" | |
--skip-duplicate | |
- name: Upload workflow artifact 'reports' | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: reports | |
path: reports/* |