Skip to content

Retry when build fail #144

Retry when build fail

Retry when build fail #144

# https://github.com/marketplace/actions/publish-nuget
name: CI/CD
on:
push:
branches:
- master
jobs:
unit-test:
name: Unit Test
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Set up DotNet
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- name: Build
uses: nick-fields/retry@v2
with:
timeout_minutes: 5
max_attempts: 3
command: dotnet build --configuration Release
- name: Run unit tests
uses: zyborg/[email protected]
with:
project_path: UnitTest/UnitTest.csproj
report_name: unit-test-report
report_title: Unit Test Report
github_token: ${{ secrets.GITHUB_TOKEN }}
fail_build_on_failed_tests: false
no_build: true
msbuild_configuration: Release
extra_test_parameters: --filter Displayname!~BaseTest
publish:
name: Build, Pack & Publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Publish
- name: Publish
id: publish_nuget
uses: alirezanet/[email protected]
with:
# Filepath of the project to be packaged, relative to root of repository
PROJECT_FILE_PATH: BindableProps/BindableProps.csproj
NUGET_KEY: ${{secrets.NUGET_API_KEY}}