diff --git a/.github/workflows/ci-on-pull_request.yml b/.github/workflows/ci-on-pull_request.yml new file mode 100644 index 00000000000..8295fc2592a --- /dev/null +++ b/.github/workflows/ci-on-pull_request.yml @@ -0,0 +1,41 @@ +name: "CI" + +on: [pull_request] +jobs: + pre-commit: + uses: ./.github/workflows/pre-commit.yml + secrets: inherit + with: + gh_event: ${{ github.event_name }} + phan: + uses: ./.github/workflows/phan.yml + secrets: inherit + needs: [pre-commit] + with: + gh_event: ${{ github.event_name }} + phpstan: + uses: ./.github/workflows/phpstan.yml + secrets: inherit + needs: [pre-commit] + with: + gh_event: ${{ github.event_name }} + #windows-ci: + # needs: [pre-commit, phan, phpstan] + # secrets: inherit + # uses: ./.github/workflows/windows-ci.yml + # with: + # gh_event: ${{ github.event_name }} + gh-travis: # Runs travis script on github runner (not on travis) + if: false + # needs: [pre-commit, phan] + # needs: [windows-ci] + secrets: inherit + needs: [pre-commit, phan, phpstan] + uses: ./.github/workflows/gh-travis.yml + with: + gh_event: ${{ github.event_name }} + +# Note (not tested, from https://github.com/orgs/community/discussions/38361) +# To cancel jobs if one fails, the following action may help +# - if: "failure()" +# uses: "andymckay/cancel-action@0.3" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci-on-push.yml similarity index 92% rename from .github/workflows/ci.yml rename to .github/workflows/ci-on-push.yml index 7e2854a9522..c031779db76 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci-on-push.yml @@ -1,6 +1,6 @@ name: "CI" -on: [push, pull_request] +on: [push] jobs: pre-commit: uses: ./.github/workflows/pre-commit.yml @@ -20,7 +20,7 @@ jobs: with: gh_event: ${{ github.event_name }} windows-ci: - needs: [pre-commit, phpstan, phan] + needs: [pre-commit, phan, phpstan] secrets: inherit uses: ./.github/workflows/windows-ci.yml with: @@ -30,11 +30,11 @@ jobs: # needs: [pre-commit, phan] # needs: [windows-ci] secrets: inherit + needs: [pre-commit, phan, phpstan] uses: ./.github/workflows/gh-travis.yml with: gh_event: ${{ github.event_name }} - # Note (not tested, from https://github.com/orgs/community/discussions/38361) # To cancel jobs if one fails, the following action may help # - if: "failure()" diff --git a/.github/workflows/gh-travis.yml b/.github/workflows/gh-travis.yml index 30c10765f07..9d1d6aa4de0 100644 --- a/.github/workflows/gh-travis.yml +++ b/.github/workflows/gh-travis.yml @@ -3,13 +3,13 @@ name: Travis # Controls when the workflow will run on: - # push: - # pull_request: + # workflow called by the parent workflow ci.yml workflow_call: inputs: gh_event: required: true type: string + # can run job manually workflow_dispatch: concurrency: diff --git a/.github/workflows/phan.yml b/.github/workflows/phan.yml index c1c1d610048..20aa67b3598 100644 --- a/.github/workflows/phan.yml +++ b/.github/workflows/phan.yml @@ -1,15 +1,12 @@ --- on: - # pull_request: - # push: - # schedule: - # # execute once a day, the 1st - # - cron: 10 9 * * * + # workflow called by the parent workflow ci.yml workflow_call: inputs: gh_event: required: true type: string + # can run job manually workflow_dispatch: concurrency: diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index 77e8d998de2..844ad46af3c 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -3,18 +3,17 @@ name: PHPStan # Controls when the workflow will run on: - # push: - # pull_request: + # workflow called by the parent workflow ci.yml workflow_call: inputs: gh_event: required: true type: string + # can run job manually workflow_dispatch: concurrency: - group: stan-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref - }} + group: stan-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true env: gh_event: ${{ inputs.gh_event || github.event_name }} diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index f2056f63a14..53383d31023 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -1,13 +1,13 @@ --- name: pre-commit on: - # pull_request: - # push: + # workflow called by the parent workflow ci.yml workflow_call: inputs: gh_event: required: true type: string + # can run job manually workflow_dispatch: concurrency: diff --git a/.github/workflows/windows-ci.yml b/.github/workflows/windows-ci.yml index 976a5415a42..26c61384b21 100644 --- a/.github/workflows/windows-ci.yml +++ b/.github/workflows/windows-ci.yml @@ -2,13 +2,13 @@ name: Win CI # yamllint disable-line rule:truthy on: - # push: - # pull_request: + # workflow called by the parent workflow ci.yml workflow_call: inputs: gh_event: required: true type: string + # can run job manually workflow_dispatch: concurrency: