Skip to content

Fixes #38909 - Use syslog gem not in windows #2

Fixes #38909 - Use syslog gem not in windows

Fixes #38909 - Use syslog gem not in windows #2

Workflow file for this run

---
name: Foreman Proxy on Windows
on:
pull_request:
push:
branches:
- 'develop'
- '*-stable'
workflow_dispatch:
inputs:
version:
description: "smart-proxy release tag (e.g. v3.10.0). Leave empty for latest."
required: false
default: ""
env:
BUNDLE_WITHOUT: "development"
concurrency:
group: ${{ github.ref_name }}-${{ github.workflow }}
cancel-in-progress: true
jobs:
bundle-smart-proxy:
runs-on: windows-latest
defaults:
run:
shell: pwsh
steps:
- name: Determine tag to fetch
id: tag
run: |
$ErrorActionPreference = 'Stop'
$repo = 'theforeman/smart-proxy'
if ('${{ github.event.inputs.version }}') {
$tag = '${{ github.event.inputs.version }}'
} else {
$rel = Invoke-RestMethod -Uri "https://api.github.com/repos/$repo/releases/latest"
$tag = $rel.tag_name
}
"tag=$tag" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
- name: Download release source ZIP
run: |
$repo = 'theforeman/smart-proxy'
$tag = '${{ steps.tag.outputs.tag }}'
$zip = "$env:RUNNER_TEMP\smart-proxy-$tag.zip"
$url = "https://github.com/$repo/archive/refs/tags/$tag.zip"
Invoke-WebRequest -Uri $url -OutFile $zip
Expand-Archive -Path $zip -DestinationPath $env:RUNNER_TEMP -Force
# Move to a stable path
$extracted = Get-ChildItem "$env:RUNNER_TEMP\smart-proxy-*" -Directory | Select-Object -First 1
Move-Item $extracted.FullName "$env:GITHUB_WORKSPACE\smart-proxy"
- name: Set up Ruby (Windows)
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2' # RubyInstaller (mingw) on Windows
bundler-cache: false # we'll run bundler ourselves
# Tip: this provides a DevKit-capable Ruby for native gems on Windows
- name: Show Ruby env (sanity)
working-directory: smart-proxy
run: |
ruby -v
gem -v
ridk version # RubyInstaller DevKit info
- name: Install Bundler
run: |
gem install bundler --no-document
- name: Bundle install smart-proxy
working-directory: smart-proxy
run: |
# Optional: avoid pulling dev/test groups on CI
bundle config set without 'development test'
# Optional: keep gems in repo-local path
bundle config set path vendor/bundle
bundle install --jobs 4
# Optional: quick smoke (does it parse & list rake tasks?)
- name: Rake sanity
working-directory: smart-proxy
run: |
bundle exec rake -T