From 7093a450d069a6068dd63f6866929583ada30fc4 Mon Sep 17 00:00:00 2001 From: Tom Schraitle Date: Tue, 4 Apr 2023 13:15:15 +0200 Subject: [PATCH 01/10] GHA: Add job summary Taken from https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary --- .github/workflows/docbook.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/docbook.yml b/.github/workflows/docbook.yml index 0735e0a73..5425e5754 100644 --- a/.github/workflows/docbook.yml +++ b/.github/workflows/docbook.yml @@ -56,11 +56,21 @@ jobs: matrix: dc-files: ${{ fromJson(needs.select-dc-files.outputs.validate-list) }} steps: + - name: Adding Markdown + run: | + echo '### Validation results' >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY # this is a blank line - uses: actions/checkout@v3 - name: Validating DC file(s) ${{ matrix.dc-files }} uses: openSUSE/doc-ci@gha-validate with: dc-files: ${{ matrix.dc-files }} + - name: Print in case of success + if: ${{ success() }} + run: echo '* :heavy_check_mark:' "${{ matrix.dc-files }}" >> $GITHUB_STEP_SUMMARY + - name: Print in case of error + if: ${{ failure() }} + run: echo '* :negative_squared_cross_mark:' "${{ matrix.dc-files }}" >> $GITHUB_STEP_SUMMARY build-html: From 4ef9dbc31c99cea11a300f984e4d60451444f711 Mon Sep 17 00:00:00 2001 From: Tom Schraitle Date: Tue, 4 Apr 2023 13:19:20 +0200 Subject: [PATCH 02/10] Trigger test run --- DC-concept-bci | 1 + 1 file changed, 1 insertion(+) diff --git a/DC-concept-bci b/DC-concept-bci index b6998a264..022e727df 100644 --- a/DC-concept-bci +++ b/DC-concept-bci @@ -1,5 +1,6 @@ # This file originates from the project https://github.com/openSUSE/doc-kit # This file can be edited downstream. +# MAIN="concept-bci.xml" ROOTID="concept-bci" From ca0097e1462e6511e2212c017d14bbccf593e67b Mon Sep 17 00:00:00 2001 From: Tom Schraitle Date: Tue, 4 Apr 2023 16:55:08 +0200 Subject: [PATCH 03/10] Use for-loops to separate files --- .github/workflows/docbook.yml | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/.github/workflows/docbook.yml b/.github/workflows/docbook.yml index 5425e5754..545ee0893 100644 --- a/.github/workflows/docbook.yml +++ b/.github/workflows/docbook.yml @@ -56,10 +56,6 @@ jobs: matrix: dc-files: ${{ fromJson(needs.select-dc-files.outputs.validate-list) }} steps: - - name: Adding Markdown - run: | - echo '### Validation results' >> $GITHUB_STEP_SUMMARY - echo "" >> $GITHUB_STEP_SUMMARY # this is a blank line - uses: actions/checkout@v3 - name: Validating DC file(s) ${{ matrix.dc-files }} uses: openSUSE/doc-ci@gha-validate @@ -67,10 +63,21 @@ jobs: dc-files: ${{ matrix.dc-files }} - name: Print in case of success if: ${{ success() }} - run: echo '* :heavy_check_mark:' "${{ matrix.dc-files }}" >> $GITHUB_STEP_SUMMARY + run: | + echo '### Successful validation results' >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY # this is a blank line + for file in ${{ matrix.dc-files }}; do + echo '* :heavy_check_mark:' "${{ file }}" >> $GITHUB_STEP_SUMMARY + done + - name: Print in case of error if: ${{ failure() }} - run: echo '* :negative_squared_cross_mark:' "${{ matrix.dc-files }}" >> $GITHUB_STEP_SUMMARY + run: | + echo '### Falied validation results' >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY # this is a blank line + for file in ${{ matrix.dc-files }}; do + echo '* :negative_squared_cross_mark:' "$file" >> $GITHUB_STEP_SUMMARY + done build-html: From 8af5b32879bf3dc2ddff8339a0d6d95fe5bca4aa Mon Sep 17 00:00:00 2001 From: Tom Schraitle Date: Tue, 4 Apr 2023 16:56:35 +0200 Subject: [PATCH 04/10] Trigger test run --- DC-concept-bci | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DC-concept-bci b/DC-concept-bci index 022e727df..2801f412a 100644 --- a/DC-concept-bci +++ b/DC-concept-bci @@ -1,6 +1,6 @@ # This file originates from the project https://github.com/openSUSE/doc-kit # This file can be edited downstream. -# +## MAIN="concept-bci.xml" ROOTID="concept-bci" From c7f2d5875449af8b3c68ffbc38da594cf33e61f2 Mon Sep 17 00:00:00 2001 From: Tom Schraitle Date: Tue, 4 Apr 2023 16:57:44 +0200 Subject: [PATCH 05/10] Fix syntax error --- .github/workflows/docbook.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docbook.yml b/.github/workflows/docbook.yml index 545ee0893..1c22def4f 100644 --- a/.github/workflows/docbook.yml +++ b/.github/workflows/docbook.yml @@ -67,7 +67,7 @@ jobs: echo '### Successful validation results' >> $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_STEP_SUMMARY # this is a blank line for file in ${{ matrix.dc-files }}; do - echo '* :heavy_check_mark:' "${{ file }}" >> $GITHUB_STEP_SUMMARY + echo '* :heavy_check_mark:' "$file" >> $GITHUB_STEP_SUMMARY done - name: Print in case of error From f01b680c067fd01e0e90a98370524a5ec2780464 Mon Sep 17 00:00:00 2001 From: Tom Schraitle Date: Tue, 4 Apr 2023 16:58:32 +0200 Subject: [PATCH 06/10] Trigger test run #3 --- DC-concept-bci | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DC-concept-bci b/DC-concept-bci index 2801f412a..022e727df 100644 --- a/DC-concept-bci +++ b/DC-concept-bci @@ -1,6 +1,6 @@ # This file originates from the project https://github.com/openSUSE/doc-kit # This file can be edited downstream. -## +# MAIN="concept-bci.xml" ROOTID="concept-bci" From c3c0611e6491d54ba75d51041920ee7952ff1f4b Mon Sep 17 00:00:00 2001 From: Tom Schraitle Date: Tue, 4 Apr 2023 17:01:34 +0200 Subject: [PATCH 07/10] Testing a failed validation #1 --- xml/concept-bci.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xml/concept-bci.xml b/xml/concept-bci.xml index bc366f10b..3cd59d4e9 100644 --- a/xml/concept-bci.xml +++ b/xml/concept-bci.xml @@ -31,7 +31,7 @@ e.g. concept-fencing--> xmlns="http://docbook.org/ns/docbook" version="5.1" xmlns:its="http://www.w3.org/2005/11/its" xmlns:xi="http://www.w3.org/2001/XInclude" - xmlns:xlink="http://www.w3.org/1999/xlink"> + xmlns:xlink="http://www.w3.org/1999/xlink" Introduction to &slsa; &bci; From bae29a1ac89176602f756e94dd70c627b48b91e4 Mon Sep 17 00:00:00 2001 From: Tom Schraitle Date: Wed, 5 Apr 2023 08:36:49 +0200 Subject: [PATCH 08/10] Create a job summary --- .github/workflows/docbook.yml | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/.github/workflows/docbook.yml b/.github/workflows/docbook.yml index 1c22def4f..52e9ce877 100644 --- a/.github/workflows/docbook.yml +++ b/.github/workflows/docbook.yml @@ -1,3 +1,4 @@ +--- name: Validate/build docs on: @@ -50,6 +51,9 @@ jobs: validate: runs-on: ubuntu-latest needs: select-dc-files + outputs: + failed-dc-files: ${{ steps.gha-validate.outputs.failed-dc-files }} + successful-dc-files: ${{ steps.gha-validate.outputs.successful-dc-files }} strategy: # don't cancel all validation runners when one of them fails, we want full results fail-fast: false @@ -59,25 +63,24 @@ jobs: - uses: actions/checkout@v3 - name: Validating DC file(s) ${{ matrix.dc-files }} uses: openSUSE/doc-ci@gha-validate + id: gha-validate with: dc-files: ${{ matrix.dc-files }} - - name: Print in case of success - if: ${{ success() }} - run: | - echo '### Successful validation results' >> $GITHUB_STEP_SUMMARY - echo "" >> $GITHUB_STEP_SUMMARY # this is a blank line - for file in ${{ matrix.dc-files }}; do - echo '* :heavy_check_mark:' "$file" >> $GITHUB_STEP_SUMMARY - done - - - name: Print in case of error - if: ${{ failure() }} + + + summary: + runs-on: ubuntu-latest + needs: [validate] + steps: + - name: Collecting files for job summary run: | - echo '### Falied validation results' >> $GITHUB_STEP_SUMMARY - echo "" >> $GITHUB_STEP_SUMMARY # this is a blank line - for file in ${{ matrix.dc-files }}; do + echo '### Validation results' >> $GITHUB_STEP_SUMMARY + for file in ${{ job.validate.outputs.failed-dc-files }}; do echo '* :negative_squared_cross_mark:' "$file" >> $GITHUB_STEP_SUMMARY done + for file in ${{ job.validate.outputs.successful-dc-files }}; do + echo '* :heavy_check_mark:' "$file" >> $GITHUB_STEP_SUMMARY + done build-html: From 03701ae5c111891bfacb7a2d37aa3174616bcaf3 Mon Sep 17 00:00:00 2001 From: Tom Schraitle Date: Wed, 5 Apr 2023 08:37:18 +0200 Subject: [PATCH 09/10] Trigger test run #4 --- DC-concept-bci | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DC-concept-bci b/DC-concept-bci index 022e727df..2801f412a 100644 --- a/DC-concept-bci +++ b/DC-concept-bci @@ -1,6 +1,6 @@ # This file originates from the project https://github.com/openSUSE/doc-kit # This file can be edited downstream. -# +## MAIN="concept-bci.xml" ROOTID="concept-bci" From cde7fd325102ed89aae72e4b86a6f81b82839088 Mon Sep 17 00:00:00 2001 From: Tom Schraitle Date: Wed, 5 Apr 2023 08:41:15 +0200 Subject: [PATCH 10/10] Always run summary job --- .github/workflows/docbook.yml | 1 + DC-concept-bci | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docbook.yml b/.github/workflows/docbook.yml index 52e9ce877..b56fedda4 100644 --- a/.github/workflows/docbook.yml +++ b/.github/workflows/docbook.yml @@ -71,6 +71,7 @@ jobs: summary: runs-on: ubuntu-latest needs: [validate] + if: ${{ always() }} steps: - name: Collecting files for job summary run: | diff --git a/DC-concept-bci b/DC-concept-bci index 2801f412a..022e727df 100644 --- a/DC-concept-bci +++ b/DC-concept-bci @@ -1,6 +1,6 @@ # This file originates from the project https://github.com/openSUSE/doc-kit # This file can be edited downstream. -## +# MAIN="concept-bci.xml" ROOTID="concept-bci"