Skip to content

Commit 2c37e98

Browse files
committed
Generate the CI matrix
1 parent ad255a9 commit 2c37e98

2 files changed

Lines changed: 25 additions & 3 deletions

File tree

.github/workflows/build.yml

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,28 @@ on:
1111
- master
1212

1313
jobs:
14+
generate-language-list:
15+
name: Generate languages list
16+
runs-on: ubuntu-latest
17+
outputs:
18+
langs: ${{ steps.language-list.outputs.langs }}
19+
steps:
20+
- uses: actions/checkout@v6
21+
with:
22+
submodules: true
23+
- id: language-list
24+
name: Send languages to outputs
25+
run: |
26+
echo "langs=[$(make list-languages-as-json)]" >> $GITHUB_OUTPUT
27+
1428
build-docs:
1529
name: Build the documentation
1630
runs-on: ubuntu-latest
31+
needs: generate-language-list
32+
strategy:
33+
fail-fast: false
34+
matrix:
35+
include: ${{ fromJSON(needs.generate-language-list.outputs.langs) }}
1736
steps:
1837
- uses: actions/checkout@v6
1938
with:
@@ -22,9 +41,9 @@ jobs:
2241
run: sudo apt install sphinx-doc python3-sphinx
2342
- name: Install gettext
2443
run: sudo apt-get install -y gettext
25-
- name: Build the documentation
26-
run: make html SPHINXOPTS='-n -W -a'
44+
- name: Build the documentation (${{ matrix.languageCode }})
45+
run: make html-${{ matrix.languageCode }} SPHINXOPTS='-n -W -a'
2746
- name: Build the documentation and show all errors
2847
if: ${{ failure() }}
2948
# This mode will not exit on the first error and will display all of them
30-
run: make html SPHINXOPTS='-n -a'
49+
run: make html-${{ matrix.languageCode }} SPHINXOPTS='-n -a'

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ all: $(FAKE_MOFILES) $(MOFILES) $(CONFIGS)
3030
SECONDARY: $(POFILES) $(INDEXFILES)
3131
.phony: all html $(addprefix html-,$(LANGUAGES))
3232

33+
list-languages-as-json:
34+
@echo '$(addprefix {"languageCode":",$(addsuffix "},$(LANGUAGES)))' | tr ' ' ','
35+
3336
docs/%/conf.py: $(SOURCE_DIR)conf.py Makefile $(SOURCES)
3437
@mkdir -p docs/$*
3538
@cd docs/$* && ln -sf ../../$(SOURCE_DIR)* .

0 commit comments

Comments
 (0)