diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 3c626a4..e46f620 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -7,8 +7,14 @@ on: pull_request: branches: - main + paths-ignore: + - "**/*.md" workflow_dispatch: +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + env: DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 DOTNET_NOLOGO: true @@ -21,6 +27,7 @@ permissions: jobs: build: + name: Build and package runs-on: ubuntu-latest steps: - name: Checkout main branch @@ -42,8 +49,27 @@ jobs: run: dotnet build --configuration Release --no-restore --nologo shell: bash + test: + name: Test + runs-on: ubuntu-latest + # Run tests independently so build, test, and format feedback can complete in parallel. + steps: + - name: Checkout main branch + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + fetch-depth: 0 + + - name: Setup .NET Core + uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7 # v5.2.0 + with: + dotnet-version: ${{ env.DOTNET_VERSION }} + + - name: Restore NuGet Packages + run: dotnet restore --locked-mode + shell: bash + - name: Run Tests - run: dotnet test --logger "trx;LogFileName=test-results.trx" --configuration Release --no-build --nologo + run: dotnet test --logger "trx;LogFileName=test-results.trx" --configuration Release --no-restore --nologo shell: bash - name: Collect Test Results @@ -64,6 +90,7 @@ jobs: **/*.received.* format: + name: Format runs-on: ubuntu-latest steps: - name: Checkout main branch