Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,10 @@ jobs:
with:
plugin: foreman_theme_satellite
foreman_version: ${{ matrix.foreman }}

toc-check:
name: Check TOC
uses: ./.github/workflows/toc-check.yml
with:
plugin_repository: ''
plugin_version: ''
77 changes: 77 additions & 0 deletions .github/workflows/toc-check.yml
Original file line number Diff line number Diff line change
@@ -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
1 change: 0 additions & 1 deletion lib/tasks/foreman_theme_satellite_tasks.rake
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it's still worth to keep it for local checks/dev? I'd hope to never run it again, but you never know :/

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was hoping we could dogfood the reusable workflow here. I can put it back, but then we'd either be checking the links twice or not dogfood the workflow.

Loading