diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index d75fe1f170a..a1562c19df5 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -2,3 +2,6 @@ Please don't open issues for questions, but ask in our Discussions forum at http Mill installations via `coursier` or `cs` are unsupported. +Please open all PRs as drafts to avoid being bottlenecked by Mill CI, and only +convert to ready for review once CI on your own fork is green. There will be a +PR status check linking your fork's commit/CI history for convenient viewing \ No newline at end of file diff --git a/.github/workflows/draft-ci.yml b/.github/workflows/draft-ci.yml new file mode 100644 index 00000000000..a9b9fcee385 --- /dev/null +++ b/.github/workflows/draft-ci.yml @@ -0,0 +1,34 @@ +name: Draft CI + +permissions: write-all +on: + pull_request_target: + types: + - opened + - reopened + - synchronize + - ready_for_review + +jobs: + run: + runs-on: ubuntu-latest + permissions: write-all + steps: + - name: Debug Echos + run: | + echo ${{ github.event.action }} + echo ${{ github.event.action == 'ready_for_review' }} + echo "${{ github.event.pull_request.head.repo.html_url }}/commits/${{github.event.pull_request.head.ref}}" + - name: Create status + run: | + curl --request POST \ + --url ${{ github.event.pull_request.statuses_url }} \ + --header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \ + --header 'content-type: application/json' \ + --data '{ + "state": "${{(github.event.action != 'ready_for_review' && github.event.pull_request.draft) && 'pending' || 'success'}}", + "context": "Draft CI / link", + "target_url": ${{(github.event.action != 'ready_for_review' && github.event.pull_request.draft) && format('"{0}/commits/{1}"', github.event.pull_request.head.repo.html_url, github.event.pull_request.head.ref) || 'null'}}, + "description": "${{(github.event.action != 'ready_for_review' && github.event.pull_request.draft) && 'use CI on your repo fork (link on right) until this PR is ready for review' || 'PR is ready for review, running CI in Mill repo'}}" + }' \ + --fail-with-body diff --git a/.github/workflows/draft-status.yml b/.github/workflows/draft-status.yml deleted file mode 100644 index 9290dbb9a15..00000000000 --- a/.github/workflows/draft-status.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Draft Status - -permissions: write-all -on: - pull_request_target: - -jobs: - set_status: - if: github.event.pull_request.draft == true - runs-on: ubuntu-latest - permissions: write-all - steps: - - name: Get PR source repository URL - run: - echo "${{ github.event.pull_request.head.repo.html_url }}/commits/${{github.event.pull_request.head.ref}}" - - name: Create status - run: | - curl --request POST \ - --url ${{ github.event.pull_request.statuses_url }} \ - --header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \ - --header 'content-type: application/json' \ - --data '{ - "state": "pending", - "context": "Link to Fork Repo Actions", - "target_url": "${{ github.event.pull_request.head.repo.html_url }}/commits/${{github.event.pull_request.head.ref}}", - "description": "use fork github actions until ready for review", - }' \ - --fail-with-body diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 1165cfa3093..e56b61aa070 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -29,7 +29,7 @@ jobs: # Jobs are listed in rough order of priority: if multiple jobs fail, the first job # in the list should be the one that's most worth looking into build-linux: - if: github.event.pull_request.draft == false + if: (github.event.action == 'ready_for_review') || (github.event.pull_request.draft == false) uses: ./.github/workflows/run-mill-action.yml with: java-version: '11' @@ -37,7 +37,7 @@ jobs: populate_cache: true build-windows: - if: github.event.pull_request.draft == false + if: (github.event.action == 'ready_for_review') || (github.event.pull_request.draft == false) uses: ./.github/workflows/run-mill-action.yml with: os: windows-latest @@ -46,7 +46,7 @@ jobs: populate_cache: true test-docs: - if: github.event.pull_request.draft == false + if: (github.event.action == 'ready_for_review') || (github.event.pull_request.draft == false) runs-on: ubuntu-latest steps: - uses: actions/checkout@v4