Skip to content

Commit

Permalink
Add matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeyzimarev committed Apr 3, 2024
1 parent 1b11eb2 commit 8446276
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 15 deletions.
56 changes: 41 additions & 15 deletions .github/workflows/pull-request.yml
Expand Up @@ -7,43 +7,69 @@ permissions:
checks: write

jobs:
event_file:
name: "Event File"
runs-on: ubuntu-latest
steps:
- name: Upload
uses: actions/upload-artifact@v4
with:
name: Event File
path: ${{ github.event_path }}
test-windows:
runs-on: windows-latest
strategy:
matrix:
dotnet: ['net472', 'net6.0', 'net7.0', 'net8.0']

steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.0'
uses: actions/checkout@v4
# -
# name: Setup .NET
# uses: actions/setup-dotnet@v3
# with:
# dotnet-version: '8.0'
-
name: Run tests
run: dotnet test
run: dotnet test -f ${{ matrix.dotnet }}
-
name: Upload Test Results
if: always()
uses: actions/upload-artifact@v4
with:
name: Test Results Windows ${{ matrix.dotnet }}
path: |
test-results/**/*.xml
test-results/**/*.trx
test-results/**/*.json
test-linux:
runs-on: ubuntu-latest
strategy:
matrix:
dotnet: ['net6.0', 'net7.0', 'net8.0']

steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.0'
# -
# name: Setup .NET
# uses: actions/setup-dotnet@v3
# with:
# dotnet-version: '8.0'
-
name: Run tests
run: dotnet test
-
name: Publish test results
uses: EnricoMi/publish-unit-test-result-action@v2
name: Upload Test Results
if: always()
uses: actions/upload-artifact@v4
with:
files: |
name: Test Results Ubuntu ${{ matrix.dotnet }}
path: |
test-results/**/*.xml
test-results/**/*.trx
test-results/**/*.json
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/test-results.yml
@@ -0,0 +1,37 @@
name: Test Results

on:
workflow_run:
workflows: ["Build and test PRs"]
types:
- completed
permissions: {}

jobs:
test-results:
name: Test Results
runs-on: ubuntu-latest
if: github.event.workflow_run.conclusion != 'skipped'

permissions:
checks: write
pull-requests: write
actions: read

steps:
-
name: Download and Extract Artifacts
uses: dawidd6/action-download-artifact@e7466d1a7587ed14867642c2ca74b5bcc1e19a2d
with:
run_id: ${{ github.event.workflow_run.id }}
path: artifacts
-
name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
with:
commit: ${{ github.event.workflow_run.head_sha }}
event_file: artifacts/Event File/event.json
event_name: ${{ github.event.workflow_run.event }}
files: |
artifacts/**/*.xml
artifacts/**/*.trx

0 comments on commit 8446276

Please sign in to comment.