From 98a153b161433dec003609ec68b89a6f4a763d87 Mon Sep 17 00:00:00 2001 From: Adam Ruzicka Date: Mon, 4 May 2026 14:34:45 +0200 Subject: [PATCH 1/3] Add a reusable workflow to check docs --- .github/workflows/main.yml | 4 ++ .github/workflows/toc-check.yml | 77 +++++++++++++++++++++++++++++++++ 2 files changed, 81 insertions(+) create mode 100644 .github/workflows/toc-check.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0da43e40..ba98f07a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -31,3 +31,7 @@ jobs: with: plugin: foreman_theme_satellite foreman_version: ${{ matrix.foreman }} + + toc-check: + name: Check TOC + uses: ./.github/workflows/toc-check.yml diff --git a/.github/workflows/toc-check.yml b/.github/workflows/toc-check.yml new file mode 100644 index 00000000..6ece7bee --- /dev/null +++ b/.github/workflows/toc-check.yml @@ -0,0 +1,77 @@ +--- +name: Check TOC + +on: + workflow_call: + inputs: + plugin: + type: string + default: 'foreman_theme_satellite' + plugin_repository: + type: string + default: 'RedHatSatellite/foreman_theme_satellite' + plugin_version: + type: string + default: 'develop' + foreman_repository: + default: theforeman/foreman + type: string + foreman_version: + default: develop + type: string + documentation_toc_artifact: + description: >- + Caller artifact with toc.json and aliases.json (any layout under the artifact root). + When empty, skip download and /tmp/toc.json is not created here. + default: "" + type: string + +env: + BUNDLE_WITHOUT: "console:development:journald:libvirt" + +jobs: + verify-toc: + runs-on: ubuntu-latest + steps: + - name: Download documentation TOC + if: ${{ inputs.documentation_toc_artifact != '' }} + uses: actions/download-artifact@v8 + with: + name: ${{ inputs.documentation_toc_artifact }} + path: /tmp/documentation-toc-artifact + + - name: Check out Foreman + uses: actions/checkout@v6 + with: + repository: ${{ inputs.foreman_repository }} + ref: ${{ inputs.foreman_version }} + path: foreman + + - name: Check out plugin + uses: actions/checkout@v6 + with: + repository: ${{ inputs.plugin_repository }} + ref: ${{ inputs.plugin_version }} + path: ${{ inputs.plugin }} + + - name: Set up dependencies + run: | + echo 'gemspec name: "${{ inputs.plugin }}", path: "../${{ inputs.plugin }}"' >> foreman/bundler.d/foreman_theme_satellite.local.rb + + - name: Setup Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: '3.1' + bundler-cache: true + working-directory: foreman + + - name: Deploy TOC files + if: ${{ inputs.documentation_toc_artifact != '' }} + run: | + [ -f /tmp/documentation-toc-artifact/toc.json ] && cp /tmp/documentation-toc-artifact/toc.json ${{ inputs.plugin }}/test/fixtures/toc.json + [ -f /tmp/documentation-toc-artifact/aliases.json ] && cp /tmp/documentation-toc-artifact/aliases.json ${{ inputs.plugin }}/test/fixtures/aliases.json + + - name: Check TOC + working-directory: foreman + run: | + bundle exec rake foreman_theme_satellite:validate_docs From 2c91572d7fd62adb12be446d429d413a2bd0472a Mon Sep 17 00:00:00 2001 From: Adam Ruzicka Date: Mon, 4 May 2026 15:21:27 +0200 Subject: [PATCH 2/3] Detach link checking from main test rake task --- lib/tasks/foreman_theme_satellite_tasks.rake | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/tasks/foreman_theme_satellite_tasks.rake b/lib/tasks/foreman_theme_satellite_tasks.rake index a5e484c7..cbd220bb 100644 --- a/lib/tasks/foreman_theme_satellite_tasks.rake +++ b/lib/tasks/foreman_theme_satellite_tasks.rake @@ -48,4 +48,3 @@ namespace :foreman_theme_satellite do end Rake::Task[:test].enhance ['test:foreman_theme_satellite'] -Rake::Task['test:foreman_theme_satellite'].enhance ['foreman_theme_satellite:validate_docs'] From 09c36719446a335c4c8bbdfc45933a2c90039edb Mon Sep 17 00:00:00 2001 From: Adam Ruzicka Date: Mon, 4 May 2026 15:37:00 +0200 Subject: [PATCH 3/3] Inherit the plugin repo --- .github/workflows/main.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ba98f07a..dc87bf40 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -35,3 +35,6 @@ jobs: toc-check: name: Check TOC uses: ./.github/workflows/toc-check.yml + with: + plugin_repository: '' + plugin_version: ''