-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds a new `reusable.yml` GitHub Actions workflow, that can be reused by the `doc-base` repo and individual `php/doc-*` repos. The new reusable workflow accepts inputs that control the repos it checks out, the name of the language, and other tasks that the `integration.yaml` file previously did. The new `build.yml` file then uses the `reusable.yml` workflow by passing parameters to run the same list of existing language builds. The advantage of this is that `doc-base` acts as the baseline GitHub Actions repo, and updates to it (such as changing the `runs-on` value, updating `uses` values for other actions such as `actions/checkout`, and other chores only need to be done on the `doc-base`, and not on every `php/doc-*` repo. Individual `php/doc-*` repos need to be updated to make use of the new reusable workflows, e.g.: ```yml name: "Build Ukrainian language documentation" on: push: pull_request: branches: "master" workflow_dispatch: jobs: build: uses: php/doc-base/.github/workflows/reusable.yml@master with: language: 'uk' ```
- Loading branch information
Showing
3 changed files
with
98 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# https://docs.github.com/en/actions | ||
|
||
name: "Integrate" | ||
|
||
on: | ||
pull_request: null | ||
push: | ||
|
||
jobs: | ||
build: | ||
name: "Build: ${{ matrix.language }}" | ||
strategy: | ||
matrix: | ||
language: | ||
- "de" | ||
- "en" | ||
- "es" | ||
- "fr" | ||
- "it" | ||
- "ja" | ||
- "pl" | ||
- "pt_br" | ||
# - "ro" | ||
- "ru" | ||
- "tr" | ||
- "uk" | ||
- "zh" | ||
|
||
uses: "./.github/workflows/reusable.yml" | ||
with: | ||
repo: 'php/doc-${{ matrix.language }}' | ||
repo_ref: '' | ||
language: ${{ matrix.language }} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
# Reusable GitHub Action to build the documentation for a given repository. | ||
|
||
name: "Build" | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
language: | ||
required: true | ||
type: string | ||
description: "Language code (e.g. de, it, es, etc) indicating the language of the documentation." | ||
repo: | ||
required: false | ||
type: string | ||
default: ${{ github.repository }} | ||
description: "Repo path (e.g. php/doc-de) to build the documentation from." | ||
repo_ref: | ||
required: false | ||
type: string | ||
default: ${{ github.ref }} | ||
description: "Repository checkout ref, defaults ref that triggered the action (github.ref)." | ||
doc_base: | ||
required: false | ||
type: string | ||
default: 'php/doc-base' | ||
description: "Repo path to the doc-base repository, defaults to php/doc-base." | ||
doc_en: | ||
required: false | ||
type: string | ||
default: 'php/doc-en' | ||
description: "Repo path to the doc-en repository, defaults to php/doc-en." | ||
|
||
jobs: | ||
build: | ||
name: "Build - ${{ inputs.language }} - ${{ inputs.repo }}" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: "Checkout doc-base" | ||
uses: "actions/checkout@v4" | ||
with: | ||
path: "doc-base" | ||
repository: ${{ inputs.doc_base }} | ||
|
||
- name: "Checkout ${{ inputs.language }} from ${{ inputs.repo }}" | ||
uses: "actions/checkout@v4" | ||
with: | ||
path: ${{ inputs.language }} | ||
repository: ${{ inputs.repo }} | ||
ref: ${{ inputs.repo_ref }} | ||
|
||
- name: "Checkout ${{ inputs.doc_en }} as fallback" | ||
if: "${{ inputs.language }} != 'en'" | ||
uses: "actions/checkout@v4" | ||
with: | ||
path: "en" | ||
repository: ${{ inputs.doc_en }} | ||
|
||
- name: "Run QA scripts for EN docs" | ||
if: "${{ inputs.language }} == 'en'" | ||
run: | | ||
php doc-base/scripts/qa/extensions.xml.php --check | ||
php doc-base/scripts/qa/section-order.php | ||
- name: "Build documentation for ${{ inputs.language }}" | ||
run: "php doc-base/configure.php --disable-libxml-check --enable-xml-details --redirect-stderr-to-stdout --with-lang=${{ inputs.language }}" |