From f6db72709e10c5150d7c17f59e98c41b6dcbe53a Mon Sep 17 00:00:00 2001 From: skibitsky Date: Mon, 11 Dec 2023 18:32:09 +0900 Subject: [PATCH] Cleanup GitHub Actions, upload build artifacts --- .github/actions/ci/action.yml | 6 ++-- .../workflows/{dotnet_build.yml => ci.yml} | 20 ++++++++++--- .github/workflows/pull_request.yml | 30 ------------------- .github/workflows/release.yml | 4 ++- 4 files changed, 21 insertions(+), 39 deletions(-) rename .github/workflows/{dotnet_build.yml => ci.yml} (61%) delete mode 100644 .github/workflows/pull_request.yml diff --git a/.github/actions/ci/action.yml b/.github/actions/ci/action.yml index c547286..437c3e1 100644 --- a/.github/actions/ci/action.yml +++ b/.github/actions/ci/action.yml @@ -15,17 +15,15 @@ inputs: runs: using: "composite" steps: - # Package buildss - name: Run tests if: inputs.type == 'unit-tests' shell: bash - run: dotnet test --verbosity normal --filter Category=unit + run: dotnet test --verbosity minimal --filter Category=unit - # Integration tests - name: Run integration tests if: inputs.type == 'integration-tests' shell: bash env: RELAY_ENDPOINT: ${{ inputs.relay-endpoint }} PROJECT_ID: ${{ inputs.project-id }} - run: dotnet test --verbosity normal --filter Category=integration + run: dotnet test --verbosity minimal --filter Category=integration diff --git a/.github/workflows/dotnet_build.yml b/.github/workflows/ci.yml similarity index 61% rename from .github/workflows/dotnet_build.yml rename to .github/workflows/ci.yml index ea27745..9c1a93b 100644 --- a/.github/workflows/dotnet_build.yml +++ b/.github/workflows/ci.yml @@ -2,8 +2,8 @@ name: .NET Build & Test on: push: - branches: [ main, 2.0 ] - + branches: [ main, '2.0' ] + pull_request: jobs: build: runs-on: ubuntu-latest @@ -17,15 +17,27 @@ jobs: uses: actions/setup-dotnet@v1 with: dotnet-version: | - 3.1.x 6.0.x + - name: Restore dependencies run: dotnet restore working-directory: ./ + - name: Build run: dotnet build --no-restore working-directory: ./ - - uses: ./.github/actions/ci + + - name: Run tests + uses: ./.github/actions/ci with: type: ${{ matrix.test-type }} project-id: ${{ secrets.PROJECT_ID }} + + - name: Upload build artifacts + uses: actions/upload-artifact@v3 + with: + name: build-artifacts + path: | + **/bin/**/*.dll + !**/Core Modules/**/bin/**/*.dll + !**/Tests/**/bin/**/*.dll \ No newline at end of file diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml deleted file mode 100644 index 45d2ae4..0000000 --- a/.github/workflows/pull_request.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: PR Build - -on: - pull_request: - -jobs: - build: - runs-on: ubuntu-latest - strategy: - matrix: - test-type: [ unit-tests, integration-tests ] - - steps: - - uses: actions/checkout@v2 - - name: Setup .NET - uses: actions/setup-dotnet@v1 - with: - dotnet-version: | - 3.1.x - 6.0.x - - name: Restore dependencies - run: dotnet restore - working-directory: ./ - - name: Build - run: dotnet build --no-restore - working-directory: ./ - - uses: ./.github/actions/ci - with: - type: ${{ matrix.test-type }} - project-id: ${{ secrets.PROJECT_ID }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5b02567..57cfb47 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,18 +11,20 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 + - name: Setup .NET uses: actions/setup-dotnet@v1 with: dotnet-version: | - 3.1.x 6.0.x + - name: Build run: dotnet build -c Release - uses: ./.github/actions/ci with: type: 'unit-tests' project-id: ${{ secrets.PROJECT_ID }} + - name: Pack nugets run: dotnet pack -c Release --no-build --output . - name: Push to NuGet