diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml new file mode 100644 index 0000000000..5ebeeca100 --- /dev/null +++ b/.github/workflows/pull_request.yml @@ -0,0 +1,10 @@ +name: Pull Request + +on: + pull_request: + types: [opened, reopened, synchronize, ready_for_review] + +jobs: + call-reusable-pull-request-workflow: + name: Checks + uses: ./.github/workflows/reusable_pull_request.yml \ No newline at end of file diff --git a/.github/workflows/pull_requests.yml b/.github/workflows/reusable_pull_request.yml similarity index 74% rename from .github/workflows/pull_requests.yml rename to .github/workflows/reusable_pull_request.yml index a455b2dabd..4a4b05bc5e 100644 --- a/.github/workflows/pull_requests.yml +++ b/.github/workflows/reusable_pull_request.yml @@ -1,8 +1,20 @@ name: Pull Request on: - pull_request: - types: [opened, reopened, synchronize, ready_for_review] + workflow_call: + inputs: + enable_unit_tests: + type: boolean + description: "Boolean to enable the unit tests job. Defaults to true." + default: true + enable_api_breakage_check: + type: boolean + description: "Boolean to enable the API breakage check job. Defaults to true." + default: true + enable_docs_check: + type: boolean + description: "Boolean to enable the docs check job. Defaults to true." + default: true ## We are cancelling previously triggered workflow runs concurrency: @@ -12,6 +24,7 @@ concurrency: jobs: unit-tests: name: Unit tests + if: ${{ inputs.enable_unit_tests }} runs-on: ubuntu-latest strategy: fail-fast: false @@ -31,8 +44,9 @@ jobs: - name: Run tests run: swift test - api-breakage: + api-breakage-check: name: API breakage check + if: ${{ inputs.enable_api_breakage_check }} runs-on: ubuntu-latest container: image: swift:5.10-noble @@ -51,6 +65,7 @@ jobs: docs-check: name: Documentation check + if: ${{ inputs.enable_docs_check }} runs-on: ubuntu-latest container: image: swift:5.10-noble