From aa2f5fef857aaa77559c9097d6c56c6cc7e6c1ee Mon Sep 17 00:00:00 2001 From: Shane Bartholomeusz Date: Thu, 19 Oct 2023 20:40:41 +0800 Subject: [PATCH] Updated and renamed dotnet.yml to dotnet-test.yml * Updated and renamed dotnet.yml to dotnet-test.yml * Reworked action to leverage reusable gh actions workflow --- .github/workflows/dotnet-test.yml | 36 +++++++++++++++++++++++++++++++ .github/workflows/dotnet.yml | 31 -------------------------- 2 files changed, 36 insertions(+), 31 deletions(-) create mode 100644 .github/workflows/dotnet-test.yml delete mode 100644 .github/workflows/dotnet.yml diff --git a/.github/workflows/dotnet-test.yml b/.github/workflows/dotnet-test.yml new file mode 100644 index 0000000..b65ceb6 --- /dev/null +++ b/.github/workflows/dotnet-test.yml @@ -0,0 +1,36 @@ +name: dotnet-test + +# +# Purpose: Run dotnet tests +# + +on: + # Run workflow manually + workflow_dispatch: + + # PR for any branch + pull_request: + + # Staged PR's for any branch + merge_group: + + # push on any branch + push: + +defaults: + run: + shell: bash + working-directory: src + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + test: + uses: sbartholomeusz/gh-actions-common/.github/workflows/dotnet-test.yml@main + with: + dotnet_version: '3.1.x' + path: './src/Canary.sln' + os-platform: 'windows-latest' + secrets: inherit diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml deleted file mode 100644 index dc14e96..0000000 --- a/.github/workflows/dotnet.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: dotnet-unit-tests - -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - -defaults: - run: - working-directory: ./src - -jobs: - build: - - runs-on: windows-latest - - steps: - - uses: actions/checkout@v2 - - name: Setup .NET - uses: actions/setup-dotnet@v1 - with: - dotnet-version: 3.1.x - - name: Clean - run: dotnet clean - - name: Restore dependencies - run: dotnet restore - - name: Build - run: dotnet build --no-restore - - name: Test - run: dotnet test --no-build --verbosity normal