Skip to content

Commit

Permalink
Merge pull request #210 from tonybaloney/ci-for-forks
Browse files Browse the repository at this point in the history
Supporting forks in CI better
  • Loading branch information
aaronpowell authored Sep 18, 2024
2 parents 438a18e + 5ecd069 commit 929974a
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 31 deletions.
21 changes: 0 additions & 21 deletions .github/workflows/dotnet-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,24 +108,3 @@ jobs:
working-directory: samples
env:
PYTHON_VERSION: ${{ steps.installpython.outputs.python-version }}

test-reporting:
permissions:
contents: read
actions: read
checks: write
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
merge-multiple: true

- name: Test Report
uses: dorny/test-reporter@v1
if: success() || failure()
with:
name: ".NET Tests"
path: "*.trx"
reporter: dotnet-trx
10 changes: 1 addition & 9 deletions .github/workflows/dotnet-publish-ci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net

name: .NET Publish (GitHub Packages)
name: .NET Publish (CI)

on:
pull_request:
Expand All @@ -15,11 +15,6 @@ env:
jobs:
publish-github-packages:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
attestations: write
id-token: write
steps:
- uses: actions/checkout@v4

Expand Down Expand Up @@ -49,6 +44,3 @@ jobs:
with:
name: nuget-packages
path: ./nuget

- name: Publish to GitHub packages
run: dotnet nuget push ./nuget/*.nupkg --source "https://nuget.pkg.github.com/tonybaloney/index.json" --api-key ${{ secrets.GITHUB_TOKEN }}
19 changes: 19 additions & 0 deletions .github/workflows/dotnet-publish-gh-packages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: "Publish NuGet packages to GitHub Packages"
on:
workflow_run:
workflows: [".NET Publish (CI)"]
types:
- completed
jobs:
report:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
attestations: write
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
name: nuget-packages
run-id: ${{ github.event.workflow_run.id }}
2 changes: 1 addition & 1 deletion .github/workflows/dotnet-publish-main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net

name: .NET Publish (NuGet)
name: .NET Publish (main)

on:
push:
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/test-reporting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: "Test Report"
on:
workflow_run:
workflows: [".NET CI"]
types:
- completed
jobs:
report:
runs-on: ubuntu-latest
steps:
- uses: phoenix-actions/test-reporting@v15
id: test-report
with:
path: "*.trx"
reporter: dotnet-trx
artifact: /test-results-(.*)/
name: ".NET Test report $1"

0 comments on commit 929974a

Please sign in to comment.