Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
s2quake committed Jun 27, 2024
1 parent 4928f41 commit 752c1d0
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 32 deletions.
43 changes: 11 additions & 32 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,20 @@
name: Build and Test
name: Receive PR

on:
pull_request:
pull_request:

env:
TEST_RESULTS_PATH: ${{ github.workspace }}/test-results.trx

permissions:
contents: read
actions: read
checks: write

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4.1.7
- name: Setup .NET
uses: actions/setup-dotnet@v4.0.0
with:
dotnet-version: 8.0.100
- name: Dotnet Build
run: dotnet build --configuration Release
- name: Dotnet Test
- uses: actions/checkout@v2

- name: Save PR number
run: |
dotnet test --configuration Release --no-restore --no-build --logger "trx;LogFileName=${{ env.TEST_RESULTS_PATH }}"
- name: Upload test results
uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: test-results
path: ${{ env.TEST_RESULTS_PATH }}
- name: Upload test results
uses: dorny/test-reporter@v1.9.1
if: success() || failure()
mkdir -p ./pr
echo ${{ github.event.number }} > ./pr/NR
- uses: actions/upload-artifact@v2
with:
name: XUnit Tests
path: ${{ env.TEST_RESULTS_PATH }}
reporter: dotnet-trx
name: pr
path: pr/
21 changes: 21 additions & 0 deletions .github/workflows/report-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Comment on the pull request

on:
workflow_run:
workflows: ["Receive PR"]
types:
- completed

jobs:
upload:
runs-on: ubuntu-latest
if: >
${{ github.event.workflow_run.event == 'pull_request' &&
github.event.workflow_run.conclusion == 'success' }}
steps:
- name: 'Download artifact'
uses: actions/github-script@v3.1.0
with:
script: |
...
- run: unzip pr.zip

0 comments on commit 752c1d0

Please sign in to comment.