Skip to content

Commit

Permalink
chapter-3 nuget.config setup in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
anddrzejb committed Apr 14, 2024
1 parent cb545ad commit 581d19f
Showing 1 changed file with 21 additions and 23 deletions.
44 changes: 21 additions & 23 deletions .github/workflows/chapter-3-contracts-workflow.yml
Original file line number Diff line number Diff line change
@@ -1,43 +1,42 @@
name: Chapter 3 Contracts
on:
push:
branches: [ "main" ]
branches: ["main"]
paths:
- 'Chapter-3-microservice-extraction/Fitnet.Contracts/Src/**'
- "Chapter-3-microservice-extraction/Fitnet.Contracts/Src/**"
pull_request:
branches: [ "main" ]
branches: ["main"]
paths:
- 'Chapter-3-microservice-extraction/Fitnet.Contracts/Src/**'
- "Chapter-3-microservice-extraction/Fitnet.Contracts/Src/**"

env:
CHAPTER_DIR: 'Chapter-3-microservice-extraction/Fitnet.Contracts/Src'
CHAPTER_DIR: "Chapter-3-microservice-extraction/Fitnet.Contracts/Src"

jobs:
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: 8.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: Add Evolutionary Architecture Nuget Source
uses: anddrzejb/evolutionary-architecture-by-example/.github@feature/add-github-nuget-feed-as-part-of-solution
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
owner: ${{ github.repository_owner }}
path: ${{ env.CHAPTER_DIR }}
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore

test:
defaults:
run:
Expand All @@ -51,14 +50,13 @@ jobs:
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.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: Add Evolutionary Architecture Nuget Source
uses: evolutionary-architecture/evolutionary-architecture-by-example/.github@feature/nuget_config
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
owner: ${{ github.repository_owner }}
path: ${{ env.CHAPTER_DIR }}
- name: Restore dependencies
run: dotnet restore
- name: Test
run: dotnet test
run: dotnet test

0 comments on commit 581d19f

Please sign in to comment.