Skip to content

Commit

Permalink
Split PR publishing and tests
Browse files Browse the repository at this point in the history
This way, PR publishing can work when tests fail
  • Loading branch information
Matyrobbrt committed Apr 18, 2024
1 parent 4340d14 commit 2384c5b
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 8 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/build-prs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# File generated by the GradleUtils `setupGitHubActionsWorkflows` task, avoid modifying it directly
# The template can be found at https://github.com/neoforged/GradleUtils/blob/287df22f683ed8422bc93deb9eb4a62099cc061f/src/actionsTemplate/resources/.github/workflows/build-prs.yml

name: Build PRs

on:
pull_request:
types:
- synchronize
- opened
- ready_for_review
- reopened
push:
branches:
- 'feature/**'
workflow_dispatch:

jobs:
build:
uses: neoforged/actions/.github/workflows/build-prs.yml@main
with:
java: 8
gradle_tasks: assemble
4 changes: 2 additions & 2 deletions .github/workflows/publish-prs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name: Publish PRs to GitHub Packages

on:
workflow_run:
workflows: ['Build Pull Request']
workflows: ['Build PRs']
types:
- completed
issue_comment:
Expand All @@ -24,7 +24,7 @@ jobs:
uses: neoforged/actions/.github/workflows/publish-prs.yml@main
with:
artifact_base_path: net/neoforged/gradle/
uploader_workflow_name: 'Build Pull Request'
uploader_workflow_name: 'Build PRs'
secrets:
PR_PUBLISHING_GH_APP_ID: ${{ secrets.PR_PUBLISHING_GH_APP_ID }}
PR_PUBLISHING_GH_APP_KEY: ${{ secrets.PR_PUBLISHING_GH_APP_KEY }}
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/pr.yml → .github/workflows/test-prs.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: 'Build Pull Request'
run-name: Build for PR ${{ github.event.pull_request.number }}
name: Test PRs
run-name: Tests for PR ${{ github.event.pull_request.number }}

on:
pull_request:
Expand Down Expand Up @@ -61,9 +61,6 @@ jobs:
- name: Build
run: ./gradlew --info -s -x assemble

- name: Publish artifacts
uses: neoforged/action-pr-publishing/upload@v1

test:
name: Test
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-report.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: 'Test Report'
on:
workflow_run:
workflows: ['Build Pull Request']
workflows: ['Test PRs']
types:
- completed
permissions:
Expand Down

0 comments on commit 2384c5b

Please sign in to comment.