diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 993574f345a..4bcb0932d64 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/publish-artifacts.yml b/.github/workflows/publish-artifacts.yml index 07452b5516a..f0a48a7a29f 100644 --- a/.github/workflows/publish-artifacts.yml +++ b/.github/workflows/publish-artifacts.yml @@ -14,12 +14,6 @@ on: - '**' workflow_dispatch: -# cancel older runs of a pull request; -# this will not cancel anything for normal git pushes -concurrency: - group: cancel-old-pr-runs-${{ github.workflow }}-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - jobs: build-artifacts: # when in master repo, publish all tags and manual runs on main diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index febe40cd5c8..1c4a69e8e71 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -32,28 +32,36 @@ name: Run Tests on: push: pull_request: + types: + - opened + - reopened + - synchronize + - ready_for_review workflow_dispatch: # cancel older runs of a pull request; # this will not cancel anything for normal git pushes concurrency: - group: cancel-old-pr-runs-${{ github.workflow }}-${{ github.head_ref || github.run_id }} + group: cancel-old-pr-runs-${{ github.workflow }}-${{ github.ref_name }} cancel-in-progress: true 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.action == 'ready_for_review') || (github.event.pull_request.draft == false) uses: ./.github/workflows/pre-build.yml with: os: ubuntu-latest build-windows: + if: (github.event.action == 'ready_for_review') || (github.event.pull_request.draft == false) uses: ./.github/workflows/pre-build.yml with: os: windows-latest test-docs: + if: (github.event.action == 'ready_for_review') || (github.event.pull_request.draft == false) runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -62,6 +70,7 @@ jobs: - run: ./mill -i docs.githubPages + docs.checkBrokenLinks mac: + if: (github.event.action == 'ready_for_review') || (github.event.pull_request.draft == false) runs-on: macos-latest steps: - uses: actions/checkout@v4