Skip to content

Commit

Permalink
test - splited
Browse files Browse the repository at this point in the history
  • Loading branch information
EliMoshkovich committed Oct 2, 2024
1 parent bebef2a commit 3164dc7
Showing 1 changed file with 35 additions and 15 deletions.
50 changes: 35 additions & 15 deletions .github/workflows/dotnet-sdk-publish.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
name: Test pack and Publish to NuGet
name: Test and Publish to NuGet

on: push
# release:
# types: [published]

jobs:
build:
# Job for running tests
test:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
Expand All @@ -17,7 +18,7 @@ jobs:
with:
dotnet-version: |
8.0.x
- name: Restore dependencies
working-directory: ./src/permit
run: dotnet restore
Expand All @@ -37,22 +38,41 @@ jobs:
PDP_DEBUG: true
run: docker run -d -p 7766:7000 permitio/pdp-v2:latest

- name: Run Tests
working-directory: ./tests/PermitTests
run: dotnet test

# Job for building and publishing the NuGet package
build-and-publish:
runs-on: ubuntu-latest
timeout-minutes: 15
needs: test # Ensures the build runs only if the test job passes
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
8.0.x
- name: Restore dependencies
working-directory: ./src/permit
run: dotnet restore

- name: Update VersionPrefix in .csproj
run: |
sed -i 's/<VersionPrefix>.*<\/VersionPrefix>/<VersionPrefix>${{ github.event.release.tag_name }}<\/VersionPrefix>/g' ./src/permit/PermitSDK.csproj
cat ./src/permit/PermitSDK.csproj
- name: Build project
working-directory: ./src/permit
run: dotnet build --configuration Release

- name: Run Tests
working-directory: ./tests/PermitTests
run: dotnet test

# - name: Update VersionPrefix in .csproj
# run: |
# sed -i 's/<VersionPrefix>.*<\/VersionPrefix>/<VersionPrefix>${{ github.event.release.tag_name }}<\/VersionPrefix>/g' ./src/permit/PermitSDK.csproj
# cat ./src/permit/PermitSDK.csproj

# - name: Pack project
# working-directory: ./src/permit
# run: dotnet pack --configuration Release
- name: Pack project
working-directory: ./src/permit
run: dotnet pack --configuration Release

# - name: Push package to NuGet
# working-directory: ./src/permit
Expand Down

0 comments on commit 3164dc7

Please sign in to comment.