Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GHA] Create reusable workflow #2767

Merged
merged 1 commit into from
Jul 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -12,6 +24,7 @@ concurrency:
jobs:
unit-tests:
name: Unit tests
if: ${{ inputs.enable_unit_tests }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand All @@ -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
Expand All @@ -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
Expand Down