Skip to content

Commit 1b37d01

Browse files
committed
Test windows test
1 parent 26d48a1 commit 1b37d01

File tree

1 file changed

+100
-0
lines changed

1 file changed

+100
-0
lines changed

.github/workflows/windows.yml

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
---
2+
name: Foreman Proxy on Windows
3+
4+
on:
5+
pull_request:
6+
push:
7+
branches:
8+
- 'develop'
9+
- '*-stable'
10+
11+
env:
12+
BUNDLE_WITHOUT: "development"
13+
14+
concurrency:
15+
group: ${{ github.ref_name }}-${{ github.workflow }}
16+
cancel-in-progress: true
17+
18+
jobs:
19+
bundle-smart-proxy:
20+
runs-on: windows-latest
21+
defaults:
22+
run:
23+
shell: pwsh
24+
strategy:
25+
matrix:
26+
rubyversion: ['3.3', '3.4']
27+
proxytag: ['3.16.1']
28+
29+
steps:
30+
- name: Determine tag to fetch
31+
id: tag
32+
run: |
33+
$ErrorActionPreference = 'Stop'
34+
$repo = 'theforeman/smart-proxy'
35+
36+
if ('${{ github.event.inputs.version }}') {
37+
$tag = '${{ github.event.inputs.version }}'
38+
} else {
39+
$tag = '${{ matrix.proxytag }}'
40+
}
41+
"tag=$tag" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
42+
43+
- name: Set up Ruby (Windows)
44+
uses: ruby/setup-ruby@v1
45+
with:
46+
ruby-version: ${{ matrix.rubyversion }}
47+
bundler-cache: false
48+
49+
- name: Install Bundler
50+
run: |
51+
gem install bundler --no-document
52+
53+
- name: Install rake
54+
run: |
55+
gem install rake --no-document
56+
57+
- name: Print debug info
58+
shell: pwsh
59+
run: |
60+
$repo = 'theforeman/smart-proxy'
61+
$tag = '${{ steps.tag.outputs.tag }}'
62+
$zip = "$env:RUNNER_TEMP\smart-proxy-$tag.zip"
63+
$url = "https://github.com/$repo/archive/refs/tags/$tag.zip"
64+
Write-Host "Repo: $repo"
65+
Write-Host "Tag: $tag"
66+
Write-Host "URL: $url"
67+
Write-Host "ZIP: $zip"
68+
69+
- name: Download release source ZIP
70+
run: |
71+
$repo = 'theforeman/smart-proxy'
72+
$tag = '${{ steps.tag.outputs.tag }}'
73+
$zip = "$env:RUNNER_TEMP\smart-proxy-$tag.zip"
74+
$url = "https://github.com/$repo/archive/refs/tags/$tag.zip"
75+
Invoke-WebRequest -Uri $url -OutFile $zip
76+
Expand-Archive -Path $zip -DestinationPath $env:RUNNER_TEMP -Force
77+
# Move to a stable path
78+
$extracted = Get-ChildItem "$env:RUNNER_TEMP\smart-proxy-*" -Directory | Select-Object -First 1
79+
Move-Item $extracted.FullName "$env:GITHUB_WORKSPACE\smart-proxy"
80+
81+
- name: Show Ruby env (sanity)
82+
working-directory: smart-proxy
83+
run: |
84+
ruby -v
85+
gem -v
86+
ridk version
87+
88+
- name: Bundle install smart-proxy
89+
working-directory: smart-proxy
90+
run: |
91+
# Optional: keep gems in repo-local path
92+
bundle config set path vendor/bundle
93+
bundle config set without 'test krb5 libvirt'
94+
bundle install --jobs 4
95+
96+
# Optional: quick smoke (does it parse & list rake tasks?)
97+
- name: Rake sanity
98+
working-directory: smart-proxy
99+
run: |
100+
bundle exec rake -T

0 commit comments

Comments
 (0)