Skip to content

Commit

Permalink
[GHA] Move docs check to script (#2776)
Browse files Browse the repository at this point in the history
# 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.
  • Loading branch information
FranzBusch authored Jul 10, 2024
1 parent 4d87167 commit fd31c95
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 15 deletions.
21 changes: 6 additions & 15 deletions .github/workflows/reusable_pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ name: Pull Request
on:
workflow_call:
inputs:
unit_tests_enabled:
unit_tests_linux_enabled:
type: boolean
description: "Boolean to enable the unit tests job. Defaults to true."
description: "Boolean to enable the unit tests linux job. Defaults to true."
default: true
api_breakage_check_enabled:
type: boolean
Expand All @@ -30,9 +30,9 @@ concurrency:
cancel-in-progress: true

jobs:
unit-tests:
unit-tests-linux:
name: Unit tests
if: ${{ inputs.unit_tests_enabled }}
if: ${{ inputs.unit_tests_linux_enabled }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand Down Expand Up @@ -82,16 +82,7 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4
- name: Run documentation check
shell: bash
run: |
set -eu
raw_targets=$(sed -E -n -e 's/^.* - documentation_targets: \[(.*)\].*$/\1/p' .spi.yml)
targets=(${raw_targets//,/ })
for target in "${targets[@]}"; do
swift package plugin generate-documentation --target "$target" --warnings-as-errors --analyze --level detailed
done
run: ./scripts/check-docs.sh

unacceptable-language-check:
name: Unacceptable language check
Expand All @@ -104,4 +95,4 @@ jobs:
- name: Run unacceptable language check
env:
UNACCEPTABLE_WORD_LIST: ${{ inputs.unacceptable_language_check_word_list}}
run: ./scripts/unacceptable_language_check.sh
run: ./scripts/check-unacceptable-language.sh
File renamed without changes.

0 comments on commit fd31c95

Please sign in to comment.