Skip to content

feat: upgrade to .net 8 #51

feat: upgrade to .net 8

feat: upgrade to .net 8 #51

name: Chapter 3 Contracts
on:
push:
branches: [ "main" ]
paths:
- 'Chapter-3-microservice-extraction/Fitnet.Contracts/Src/**'
pull_request:
branches: [ "main" ]
paths:
- 'Chapter-3-microservice-extraction/Fitnet.Contracts/Src/**'
env:
CHAPTER_DIR: 'Chapter-3-microservice-extraction/Fitnet.Contracts/Src'
jobs:
build:
defaults:
run:
working-directory: ${{ env.CHAPTER_DIR }}
runs-on: ubuntu-latest
name: Build
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
- name: Add GitHub NuGet Source
run: |
dotnet nuget add source --username $OWNER --password $GITHUB_TOKEN --store-password-in-clear-text --name github "https://nuget.pkg.github.com/$OWNER/index.json"
dotnet nuget list source
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OWNER: ${{ github.repository_owner }}
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
test:
defaults:
run:
working-directory: ${{ env.CHAPTER_DIR }}
runs-on: ubuntu-latest
name: Test
needs: build
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
- name: Add GitHub NuGet Source
run: |
dotnet nuget add source --username $OWNER --password $GITHUB_TOKEN --store-password-in-clear-text --name github "https://nuget.pkg.github.com/$OWNER/index.json"
dotnet nuget list source
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OWNER: ${{ github.repository_owner }}
- name: Restore dependencies
run: dotnet restore
- name: Test
run: dotnet test