Skip to content
Merged
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
48 changes: 48 additions & 0 deletions .github/workflows/smart_proxy_plugin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
name: Foreman Proxy Plugin

on:
workflow_call:
inputs:
foreman_proxy_version:
description: Foraman Proxy version to use
default: 'develop'
required: false
type: string
foreman_proxy_repository:
description: Foreman Proxy repository to use
default: 'theforeman/smart-proxy'
required: false
type: string
plugin_repository:
description: Plugin repository to use
required: false
type: string
plugin_version:
description: Plugin version to use
required: false
type: string

jobs:
rubies:
name: Verify supported Ruby versions
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
repository: ${{ inputs.plugin_repository }}
ref: ${{ inputs.plugin_version }}
- name: Verify supported Ruby versions
uses: theforeman/gha-matrix-ruby-verifier@v0
with:
repository: ${{ inputs.foreman_proxy_repository }}
ref: ${{ inputs.foreman_proxy_version }}
test:
name: Tests
uses: theforeman/actions/.github/workflows/test-gem.yml@v0
with:
command: bundle exec rake test
environment_variables: |
SMART_PROXY_BRANCH=${{ inputs.foreman_proxy_version }}
gem_repository: ${{ inputs.plugin_repository }}
gem_version: ${{ inputs.plugin_version }}
19 changes: 19 additions & 0 deletions .github/workflows/smart_proxy_plugin_workflow_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
name: Test smart_proxy_plugin.yml

on:
pull_request:
paths:
- '.github/workflows/smart_proxy_plugin.yml'
- '.github/workflows/smart_proxy_plugin_workflow_test.yml'

concurrency:
group: ${{ github.ref_name }}-${{ github.workflow }}
cancel-in-progress: true

jobs:
test:
name: Ruby
uses: ./.github/workflows/smart_proxy_plugin.yml
with:
plugin_repository: theforeman/smart_proxy_pulp
21 changes: 21 additions & 0 deletions .github/workflows/test-gem.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,19 @@ on:
default: bundle exec rake spec
required: false
type: string
environment_variables:
description: arbitrary environment variables from caller
required: false
default: ''
type: string
gem_repository:
description: Gem repository to use
required: false
type: string
gem_version:
description: Gem version to use
required: false
type: string

jobs:
setup_matrix:
Expand All @@ -24,6 +37,9 @@ jobs:
steps:
- id: ruby
uses: ekohl/ruby-version@v0
with:
repository: ${{ inputs.gem_repository }}
ref: ${{ inputs.gem_version }}

test:
name: "Ruby ${{ matrix.ruby }}"
Expand All @@ -34,7 +50,12 @@ jobs:
matrix:
ruby: ${{ fromJSON(needs.setup_matrix.outputs.ruby) }}
steps:
- name: Load environment variables from caller
run: echo "${{ inputs.environment_variables }}" >> $GITHUB_ENV
- uses: actions/checkout@v4
with:
repository: ${{ inputs.gem_repository }}
ref: ${{ inputs.gem_version }}
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
Expand Down