Skip to content

Commit

Permalink
Execute GitHub Actions for every pull request
Browse files Browse the repository at this point in the history
  • Loading branch information
eXpl0it3r committed Feb 13, 2023
1 parent e1b26f8 commit 79e7433
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,24 @@
name: .NET Core

on:
push:
branches:
- dev
- master
pull_request:
branches:
- dev
workflow_dispatch:
on: [push, pull_request, workflow_dispatch]
jobs:
build:
env:
TESTS_PROJECT: 'SharpFileSystem.Tests/SharpFileSystem.Tests.csproj' # path to test project or solution
PUBLISH_NUGET: true # if true a nuget will be published on version change
RUN_TESTS: true # if true tests are run and coverage data is published to coveralls and a coverage report is produced.
MAIN_CSPROJ: 'SharpCoreFileSystem/SharpCoreFileSystem.csproj' # main project (for nuget packaging)
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v3
with:
dotnet-version: 3.1.101
- name: Clean artifacts and nugets
run: dotnet clean --configuration Release && dotnet nuget locals all --clear
run: dotnet clean --configuration Release && dotnet nuget locals all --clear
- name: Build with dotnet
run: dotnet build --configuration Release
- name: Test with dotnet
Expand Down Expand Up @@ -55,7 +46,7 @@ jobs:
verbosity: 'Info' # The verbosity level of the log messages. Values: Verbose, Info, Warning, Error, Off
tag: '${{ github.run_number }}_${{ github.run_id }}'
- name: publish nuget
if: matrix.os == 'windows-latest' && env.PUBLISH_NUGET
if: matrix.os == 'windows-latest' && github.event_name == 'push' && contains(github.ref, 'refs/tags/')
id: publish_nuget
uses: brandedoutcast/publish-nuget@v2.5.5
with:
Expand Down Expand Up @@ -86,6 +77,7 @@ jobs:
asset_name: ${{ steps.publish_nuget.outputs.PACKAGE_NAME }}
asset_content_type: application/zip
- name: Invoke refresh readme badges
if: contains(github.ref, 'master')
uses: benc-uk/workflow-dispatch@v1
with:
workflow: refresh readme badges
Expand Down

0 comments on commit 79e7433

Please sign in to comment.