mirror of
https://github.com/apple/swift-nio
synced 2026-11-29 05:24:21 +00:00
# Motivation For longer scripts we want to use a standalone shell script instead of using a multiline script inside the workflow yml. # Modification This PR uses the existing doc script instead of an inline script in the workflow # Result Better maintainability of the scripts.
98 lines
3.1 KiB
YAML
98 lines
3.1 KiB
YAML
name: Pull Request
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
unit_tests_linux_enabled:
|
|
type: boolean
|
|
description: "Boolean to enable the unit tests linux job. Defaults to true."
|
|
default: true
|
|
api_breakage_check_enabled:
|
|
type: boolean
|
|
description: "Boolean to enable the API breakage check job. Defaults to true."
|
|
default: true
|
|
docs_check_enabled:
|
|
type: boolean
|
|
description: "Boolean to enable the docs check job. Defaults to true."
|
|
default: true
|
|
unacceptable_language_check_enabled:
|
|
type: boolean
|
|
description: "Boolean to enable the acceptable language check job. Defaults to true."
|
|
default: true
|
|
unacceptable_language_check_word_list:
|
|
type: string
|
|
description: "List of unacceptable words. Defaults to a sensible list of words."
|
|
default: "blacklist whitelist slave master sane sanity insane insanity kill killed killing hang hung hanged hanging" #ignore-unacceptable-language
|
|
|
|
## We are cancelling previously triggered workflow runs
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
unit-tests-linux:
|
|
name: Unit tests
|
|
if: ${{ inputs.unit_tests_linux_enabled }}
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
swift:
|
|
- image: swift:5.8-jammy
|
|
- image: swift:5.9-jammy
|
|
- image: swift:5.10-noble
|
|
- image: swiftlang/swift:nightly-6.0-jammy
|
|
- image: swiftlang/swift:nightly-main-jammy
|
|
container:
|
|
image: ${{ matrix.swift.image }}
|
|
timeout-minutes: 20
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
- name: Run tests
|
|
run: swift test
|
|
|
|
api-breakage-check:
|
|
name: API breakage check
|
|
if: ${{ inputs.api_breakage_check_enabled }}
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: swift:5.10-noble
|
|
timeout-minutes: 20
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
# We need to fetch everything otherwise only the head commit will be fetched.
|
|
fetch-depth: 0
|
|
- name: Mark the workspace as safe
|
|
# https://github.com/actions/checkout/issues/766
|
|
run: git config --global --add safe.directory ${GITHUB_WORKSPACE}
|
|
- name: Run API breakage check
|
|
run: swift package diagnose-api-breaking-changes origin/main
|
|
|
|
docs-check:
|
|
name: Documentation check
|
|
if: ${{ inputs.docs_check_enabled }}
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: swift:5.10-noble
|
|
timeout-minutes: 20
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
- name: Run documentation check
|
|
run: ./scripts/check-docs.sh
|
|
|
|
unacceptable-language-check:
|
|
name: Unacceptable language check
|
|
if: ${{ inputs.unacceptable_language_check_enabled }}
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 1
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
- name: Run unacceptable language check
|
|
env:
|
|
UNACCEPTABLE_WORD_LIST: ${{ inputs.unacceptable_language_check_word_list}}
|
|
run: ./scripts/check-unacceptable-language.sh |